aetherg 0.5.0.beta → 0.5.0.beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 637408317b3ebd124ddc4a72b20801b8dc83c1c7
4
- data.tar.gz: f2bbf7875fa01ffb06238e2a63f1811d6177b8fa
3
+ metadata.gz: 8c14fc0b51212c45fc6b1a9ecd2a63e0c4919e61
4
+ data.tar.gz: 498aad0e46737bd2ca39a0fb4021d0561f2fc401
5
5
  SHA512:
6
- metadata.gz: 883541433acae2dd41c6e4c3e5e779c34d47dc37ac7a7d6768d18e38fbc039bec144e1e1da09cefe073ca9aa485b6c623dd9ba5aff9b4f30c1a4ee2e91d40592
7
- data.tar.gz: c9f952fde9203efd4456b42012e203a7fbc3d1dcf6b29db618fe43ec3284e1699e9f16710a4c11d0ec7186b758d7ee810cc0e067646fc9cc3f3eb92b57d16558
6
+ metadata.gz: c10c303c2583f5ffdd591365f6d573286eb4ba16e52281eef27797927b126a75ff5cc118fc63b52224db605bf50d551f980942aec0680658be67b34671670224
7
+ data.tar.gz: 43d5569efb69129f6c013bf3b6b72ae2e428acfe58ad6ee8a2657bbccc3d3eb4ddb81d83824eeb1af6b3760b07f44e47e594e5220dff2dea3cd0595c29e615c4
data/README.md CHANGED
@@ -29,4 +29,4 @@ Usage
29
29
 
30
30
  Copyright
31
31
  -----
32
- Copyright (c) 2016 Allen Chan, Inc. See LISENCE for detail.
32
+ Copyright (c) 2017 Allen Chan, Inc. See LISENCE for detail.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0.beta
1
+ 0.5.0.beta2
data/aetherg.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'aetherg'
3
- s.version = '0.5.0.beta'
4
- s.date = '2017-04-20'
3
+ s.version = '0.5.0.beta2'
4
+ s.date = '2017-04-27'
5
5
  s.summary = "Aetherg (Aether Generator) is a generator of sinatra app."
6
6
  s.description = "Aetherg (Aether Generator) is a sinatra based App generator. Light-weight for API service or full-stack Web apps"
7
7
  s.authors = ["Allen Chan"]
data/bin/aetherg CHANGED
@@ -8,4 +8,5 @@ if ARGV[0] == "--version" || ARGV[0] == "-v"
8
8
  exit
9
9
  end
10
10
 
11
+ puts "Aetherg is generating..."
11
12
  Aetherg::Generator.start
@@ -0,0 +1,6 @@
1
+ class Changchangchang::Application
2
+ # root default route
3
+ get "/" do
4
+ "Hello World! from Changchangchang."
5
+ end
6
+ end
File without changes
@@ -0,0 +1,36 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ module Changchangchang
4
+ class Application < Sinatra::Base
5
+
6
+ set :root, File.dirname(__FILE__)
7
+ set :public_dir, File.expand_path('../public', __FILE__)
8
+ set :raise_errors, true
9
+ set :app_file, __FILE__
10
+
11
+ AUTOLOAD_PATHS = ["#{root}/app/*", "#{root}/lib"]
12
+
13
+ def self.require_autoload_paths(paths)
14
+ paths.each do |path|
15
+ Dir[File.join(path, "*.rb")].each do |file|
16
+ require file
17
+ end
18
+ end
19
+ end
20
+
21
+ def self.initialize!
22
+ settings_file = File.expand_path('../config/settings.yml', __FILE__)
23
+
24
+ if File.exist? settings_file
25
+ YAML::load(open(settings_file))[self.environment.to_s]
26
+ else
27
+ raise Errno::ENOENT
28
+ end
29
+ end
30
+
31
+ end
32
+ end
33
+
34
+ $app_settings ||= Changchangchang::Application.initialize!
35
+ require File.expand_path('../config/initializer', __FILE__)
36
+ Changchangchang::Application.require_autoload_paths(Changchangchang::Application::AUTOLOAD_PATHS)
@@ -35,7 +35,7 @@ module Aetherg
35
35
  empty_directory File.join(@app_path, dir)
36
36
  end
37
37
 
38
- %w{app/assets app/assets/images app/assets/javascripts app/assets/stylesheets app/assets/fonts app/views app/views/layouts public}.each do |dir|
38
+ %w{app/assets app/assets/images app/assets/javascripts app/assets/stylesheets app/views app/views/layouts public}.each do |dir|
39
39
  empty_directory File.join(@app_path, dir)
40
40
  end unless @no_views
41
41
  end
@@ -48,6 +48,8 @@ module Aetherg
48
48
  def create_views_layout
49
49
  unless @no_views
50
50
  copy_file "app/views/layouts/application.erb", File.join(@app_path, "/app/views/layouts/application.erb")
51
+ copy_file "app/assets/javascripts/application.js", File.join(@app_path, "/app/assets/javascripts/applicatin.js")
52
+ copy_file "app/assets/stylesheets/application.css", File.join(@app_path, "/app/assets/stylesheets/application.css")
51
53
  end
52
54
  end
53
55
 
@@ -1,4 +1,4 @@
1
1
  module Aetherg
2
- VERSION = "0.5.0.beta"
3
- BUILD = "2017-04-20"
2
+ VERSION = "0.5.0.beta2"
3
+ BUILD = "2017-04-27"
4
4
  end
@@ -2,6 +2,9 @@ source "https://ruby.taobao.org"
2
2
  # source "https://rubygems.org" # Use rubygems if you're not in China
3
3
 
4
4
  gem 'sinatra', '~> 2.0.0.rc2', require: 'sinatra/base'
5
+ # sinatra-contrib gem was merged into sinatra in v2.0.0
6
+ # requirement can be changed when you use some/all of them
7
+ gem 'sinatra-contrib', '~> 2.0.0.rc2', require: false
5
8
  gem 'rake'
6
9
  <%- unless @no_database -%>
7
10
  gem 'activerecord'
@@ -21,12 +24,14 @@ gem 'redis'
21
24
  <%- end -%>
22
25
 
23
26
  <%- unless @no_views -%>
24
- # with assetpack, using sass, and uglifier
25
- # assetpack support by compass configure when using scss/sass import
26
- gem 'sinatra-assetpack', require: 'sinatra/assetpack'
27
- gem 'compass'
28
- gem 'sass'
27
+ # Sprockets for assets pipeline
28
+ # sass, coffescript, and compile with uglifier
29
+ gem 'sprockets', '~> 3.7.1'
30
+ gem 'sprockets-helpers'
29
31
  gem 'uglifier'
32
+ gem 'sass'
33
+ gem 'coffee-script'
34
+ gem 'execjs'
30
35
  <%- end %>
31
36
 
32
37
  <%- unless @no_views -%>
@@ -0,0 +1,6 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory can be referenced here using a relative path.
5
+ //
6
+ //= require_tree .
@@ -0,0 +1,9 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, can be referenced here using a relative path.
6
+ *
7
+ *= require_self
8
+ *= require style
9
+ */
@@ -3,14 +3,16 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv=X-UA-Compatible content="Chrome=1,IE=edge">
6
+ <meta name="renderer" content="webkit">
6
7
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, maximum-scale=1">
7
8
  <title></title>
8
-
9
+ <link rel="stylesheet" href="<%= stylesheet_path 'application' %>">
9
10
  <meta name="keywords" content="">
10
11
  <meta name="description" content="">
11
- <link rel="canonical" href="<%= $app_settings['url'] %>">
12
+ <link rel="canonical" href='<%= $app_settings['url'] %>'>
12
13
  </head>
13
14
  <body>
14
15
  <%= yield %>
16
+ <script src='<%= javascript_path 'application' %>' charset="utf-8"></script>
15
17
  </body>
16
18
  </html>
@@ -1,35 +1,56 @@
1
1
  class <%= @name.camelcase %>::Application
2
+ register Sprockets::Helpers
2
3
 
3
- register Sinatra::AssetPack
4
-
5
- # configuration with compass
6
- set :sass, Compass.sass_engine_options
7
- set :sass, { :load_paths => sass[:load_paths] + [ "#{root}/app/assets/stylesheets" ] }
8
- set :scss, sass
9
-
10
- # Config assets paths
11
- # with sass, uglify support
12
- # Also supports coffeescript
13
- # assets do
14
- # serve '/js', from: 'app/assets/javascripts'
15
- # serve '/css', from: 'app/assets/stylesheets'
16
- # serve '/fonts', from: 'app/assets/fonts'
17
- # serve '/images', from: 'app/assets/images'
18
- #
19
- # js :application, [
20
- # '/js/jquery.js',
21
- # '/js/util.js',
22
- # '/js/*.js'
23
- # ]
24
- #
25
- # css :application, [
26
- # '/css/application.css'
27
- # ]
28
- #
29
- # js_compression :uglify
30
- # css_compression :sass
31
- #
32
- # expires 86400*365, :public
33
- # end
4
+ set :sprockets, Sprockets::Environment.new
5
+ set :assets_prefix, '/assets'
6
+ set :digest_assets, true
7
+
8
+ configure do
9
+ # append assets paths
10
+ sprockets.append_path "app/assets/stylesheets"
11
+ sprockets.append_path "app/assets/javascripts"
12
+ sprockets.append_path "app/assets/images"
13
+ # Other assets path, you can add below
14
+ # sprockets.append_path "app/assets/fonts"
15
+
16
+ # compress assets
17
+ sprockets.js_compressor = :uglify
18
+ sprockets.css_compressor = :scss
19
+
20
+ # Configure Sprockets::Helpers (if necessary)
21
+ Sprockets::Helpers.configure do |config|
22
+ config.environment = sprockets
23
+ config.prefix = assets_prefix
24
+ config.digest = digest_assets
25
+ config.public_path = public_folder
26
+
27
+ # Force to debug mode in development mode
28
+ # Debug mode automatically sets
29
+ # expand = true, digest = false, manifest = false
30
+ config.debug = true if development?
31
+ end
32
+ end
33
+
34
+ helpers do
35
+ include Sprockets::Helpers
36
+
37
+ # Alternative method for telling Sprockets::Helpers which
38
+ # Sprockets environment to use.
39
+ # def assets_environment
40
+ # settings.sprockets
41
+ # end
42
+
43
+ # Use:
44
+ # stylesheet_path 'application'
45
+ # javascript_path 'application'
46
+ # as style and js path generator
47
+ end
48
+
49
+ # get assets
50
+ get "/assets/*" do
51
+ # if you changed assets_prefix, you need change it here
52
+ env["PATH_INFO"].sub!("/assets", "")
53
+ settings.sprockets.call(env)
54
+ end
34
55
 
35
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aetherg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.beta
4
+ version: 0.5.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Chan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-20 00:00:00.000000000 Z
11
+ date: 2017-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -41,6 +41,9 @@ files:
41
41
  - VERSION
42
42
  - aetherg.gemspec
43
43
  - bin/aetherg
44
+ - changchangchang/app/routes/welcome.rb
45
+ - changchangchang/app/views/layouts/application.erb
46
+ - changchangchang/application.rb
44
47
  - lib/aetherg.rb
45
48
  - lib/aetherg/aetherg.rb
46
49
  - lib/aetherg/array.rb
@@ -49,6 +52,8 @@ files:
49
52
  - lib/templates/Gemfile
50
53
  - lib/templates/README.md
51
54
  - lib/templates/Rakefile
55
+ - lib/templates/app/assets/javascripts/application.js
56
+ - lib/templates/app/assets/stylesheets/application.css
52
57
  - lib/templates/app/routes/welcome.rb
53
58
  - lib/templates/app/views/layouts/application.erb
54
59
  - lib/templates/application.rb