aetherg 0.2.7 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db5f3f5da897e4e6069290805f5985736007d149
4
- data.tar.gz: 85a26938e831221277e0125b12e25d88c15890b4
3
+ metadata.gz: 9f189fe053e31d4969754ef79459d40868a5f7ce
4
+ data.tar.gz: 3c4cba59ca1d60781b87702881f5e56a031be0d4
5
5
  SHA512:
6
- metadata.gz: 3098f00a9c3f13c0282d1a6ee2192ecf72f2390b6778cd0155b916053729ceae71e4fc70c21e297f98fc1bb9f781163ffe79992b72de7bf6629c2438164c07db
7
- data.tar.gz: b69c0cf7e94c07c816b9dfac3b350dfe12344d075e396b3b971ba377db36786d3ec758f160190f5baa5f701f572fa92ece11335cb65cd7cca2c23110c5daea28
6
+ metadata.gz: 60b185903b52467ecdd75a778e498b69bfbd5b0e2cc0e92565e96e3c1b1273cde019d5e708c0911dfac1e7828827db2917f37e87b14001d79b1e07963addf663
7
+ data.tar.gz: 6654e1dd0aac9953adf6964aaa991efdba1c815f002334eff799b6b6ae4eb5f16532f9cc1d1c6cbc46ff36b99c428a8877ddcd88d6fa9a1c33659899d16f0eb4
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015 Allen Chan @ Octo Music, Inc.
3
+ Copyright (c) 2016 Allen Chan @ A/C, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.7
1
+ 0.3.1
data/bin/aetherg CHANGED
@@ -3,4 +3,9 @@
3
3
  $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))) unless $:.include? File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
4
4
  require "aetherg"
5
5
 
6
+ if ARGV[0] == "--version" || ARGV[0] == "-v"
7
+ puts "Aetherg v#{Aetherg::VERSION}(#{Aetheg::BUILD})"
8
+ exit
9
+ end
10
+
6
11
  Aetherg::Generator.start
data/lib/aetherg.rb CHANGED
@@ -2,3 +2,4 @@ require 'rubygems'
2
2
  require 'thor/group'
3
3
  require File.expand_path('../aetherg/string', __FILE__)
4
4
  require File.expand_path('../aetherg/aetherg', __FILE__)
5
+ require File.expand_path('../aetherg/version', __FILE__)
@@ -28,76 +28,83 @@ module Aetherg
28
28
  empty_directory File.join(@app_path, dir)
29
29
  end
30
30
 
31
- %w{app/assets app/assets/images app/assets/javascripts app/assets/stylesheets app/views public}.each do |dir|
31
+ %w{app/assets app/assets/images app/assets/javascripts app/assets/stylesheets app/assets/fonts app/views public}.each do |dir|
32
32
  empty_directory File.join(@app_path, dir)
33
33
  end unless @no_views
34
34
  end
35
35
 
36
36
  def create_app
37
- template "application.rb", File.join(@app_path, "application.rb")
38
- template "app/routes/welcome.rb", File.join(@app_path, "/app/routes/welcome.rb")
37
+ template "application.rb", File.join(@app_path, "application.rb")
38
+ template "app/routes/welcome.rb", File.join(@app_path, "/app/routes/welcome.rb")
39
39
  end
40
40
 
41
41
  def create_config_with_boot
42
- template "config.ru", File.join(@app_path, "config.ru")
43
- template "boot.rb", File.join(@app_path, "boot.rb")
42
+ template "config.ru", File.join(@app_path, "config.ru")
43
+ template "boot.rb", File.join(@app_path, "boot.rb")
44
44
  end
45
45
 
46
46
  def create_gemfile
47
- template "Gemfile", File.join(@app_path, "Gemfile")
47
+ template "Gemfile", File.join(@app_path, "Gemfile")
48
48
  end
49
49
 
50
50
  def create_rakefile
51
- template "Rakefile", File.join(@app_path, "Rakefile")
51
+ template "Rakefile", File.join(@app_path, "Rakefile")
52
52
  end
53
53
 
54
54
  def create_readme
55
- template "README.md", File.join(@app_path, "README.md")
55
+ template "README.md", File.join(@app_path, "README.md")
56
56
  end
57
57
 
58
58
  def create_server_config
59
- copy_file "config/puma.rb", File.join(@app_path, "config/puma.example.rb")
59
+ copy_file "config/puma.rb", File.join(@app_path, "config/puma.example.rb")
60
60
  end
61
61
  #
62
62
  def create_db_config
63
- template("config/database.yml", File.join(@app_path, "config/database.example.yml")) unless @no_database
64
- template("config/database.yml", File.join(@app_path, "config/database.yml")) unless @no_database
63
+ template("config/database.yml", File.join(@app_path, "config/database.example.yml")) unless @no_database
64
+ template("config/database.yml", File.join(@app_path, "config/database.yml")) unless @no_database
65
65
  end
66
66
 
67
67
  def create_settings_config
68
- template("config/settings.yml", File.join(@app_path, "config/settings.example.yml"))
69
- template("config/settings.yml", File.join(@app_path, "config/settings.yml"))
68
+ template("config/settings.yml", File.join(@app_path, "config/settings.example.yml"))
69
+ template("config/settings.yml", File.join(@app_path, "config/settings.yml"))
70
70
  end
71
71
 
72
72
  def create_gitignore
73
- copy_file "gitignore", File.join(@app_path, ".gitignore")
73
+ copy_file "gitignore", File.join(@app_path, ".gitignore")
74
74
  end
75
75
 
76
76
  def create_initializers
77
- template("config/initializers/connection.rb", File.join(@app_path, "config/initializers/connection.rb")) unless @no_database
78
- template("config/initializers/environment.rb", File.join(@app_path, "config/initializers/environment.rb"))
79
- template("config/initializer.rb", File.join(@app_path, "config/initializer.rb"))
77
+ template("config/initializers/connection.rb", File.join(@app_path, "config/initializers/connection.rb")) unless @no_database
78
+ template("config/initializers/environment.rb", File.join(@app_path, "config/initializers/environment.rb"))
79
+ template("config/initializer.rb", File.join(@app_path, "config/initializer.rb"))
80
80
  end
81
81
 
82
82
  def create_redis_config_and_initializer
83
- if @redis
84
- copy_file("config/redis.yml", File.join(@app_path, "config/redis.yml"))
85
- template("config/initializers/redis.rb", File.join(@app_path, "config/initializers/redis.rb"))
86
- end
83
+ if @redis
84
+ copy_file("config/redis.yml", File.join(@app_path, "config/redis.yml"))
85
+ template("config/initializers/redis.rb", File.join(@app_path, "config/initializers/redis.rb"))
86
+ end
87
+ end
88
+
89
+ def create_assets_config
90
+ unless @no_views
91
+ template("config/initializers/assets.rb", File.join(@app_path, "config/initializers/assets.rb"))
92
+ end
87
93
  end
88
94
 
89
95
  def create_gitkeep
90
- create_file File.join(@app_path, "app", "assets", "images", ".keep") unless @no_views
91
- create_file File.join(@app_path, "app", "assets", "stylesheets", ".keep") unless @no_views
92
- create_file File.join(@app_path, "app", "assets", "javascripts", ".keep") unless @no_views
93
- create_file File.join(@app_path, "app", "models", ".keep")
94
- create_file File.join(@app_path, "app", "routes", ".keep")
95
- create_file File.join(@app_path, "log", ".keep")
96
- create_file File.join(@app_path, "tmp", ".keep")
97
- create_file File.join(@app_path, "app", "views", ".keep")
98
- create_file File.join(@app_path, "lib", ".keep")
99
- create_file File.join(@app_path, "db", "migrate", ".keep")
100
- create_file File.join(@app_path, "public", ".keep") unless @no_views
96
+ create_file File.join(@app_path, "app", "assets", "images", ".keep") unless @no_views
97
+ create_file File.join(@app_path, "app", "assets", "stylesheets", ".keep") unless @no_views
98
+ create_file File.join(@app_path, "app", "assets", "javascripts", ".keep") unless @no_views
99
+ create_file File.join(@app_path, "app", "assets", "fonts", ".keep") unless @no_views
100
+ create_file File.join(@app_path, "app", "models", ".keep")
101
+ create_file File.join(@app_path, "app", "routes", ".keep")
102
+ create_file File.join(@app_path, "log", ".keep")
103
+ create_file File.join(@app_path, "tmp", ".keep")
104
+ create_file File.join(@app_path, "app", "views", ".keep")
105
+ create_file File.join(@app_path, "lib", ".keep")
106
+ create_file File.join(@app_path, "db", "migrate", ".keep")
107
+ create_file File.join(@app_path, "public", ".keep") unless @no_views
101
108
  end
102
109
  end
103
110
  end
@@ -0,0 +1,4 @@
1
+ module Aetherg
2
+ VERSION = "0.3.1"
3
+ BUILD = "2016-12-22"
4
+ end
@@ -20,6 +20,20 @@ gem 'redis'
20
20
  <%- end -%>
21
21
  <%- end -%>
22
22
 
23
+ <%- 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'
29
+ gem 'uglifier'
30
+ <%- end %>
31
+
32
+ <%- unless @no_views -%>
33
+ # Rack csrf gem for authentication of form post action
34
+ gem 'rack_csrf', require: "rack/csrf"
35
+ <%- end %>
36
+
23
37
  group :development, :test do
24
38
  gem 'shotgun'
25
39
  gem 'pry'
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Description
4
4
 
5
- A sinatra application generated by ![Aether](https://github.com/chenillen/aether)
5
+ A sinatra application generated by ![Aetherg](https://github.com/chenillen/aetherg)
6
6
 
7
7
  ## Introduction of Aether
8
8
  Aether is a self-used web service framework template. Based on sinatra, simply and lightweight.
@@ -3,6 +3,6 @@ require "./application"
3
3
  desc "Default task"
4
4
  namespace :<%= @name %> do
5
5
  task :default do
6
- puts "Hello #{@name}"
6
+ puts "Hello <%= @name.camelcase %>"
7
7
  end
8
8
  end
@@ -1,6 +1,6 @@
1
1
  class <%= @name.camelcase %>::Application
2
2
  # root default route
3
3
  get "/" do
4
- "Hello World! from #{@name.camelcase}."
4
+ "Hello World! from <%= @name.camelcase %>."
5
5
  end
6
6
  end
@@ -1,7 +1,10 @@
1
+ <%- unless @no_views -%>
2
+ require File.expand_path('../initializers/assets', __FILE__)
3
+ <%- end %>
1
4
  <%- unless @no_database -%>
2
5
  require File.expand_path('../initializers/connection', __FILE__)
3
6
  <%- end -%>
7
+ require File.expand_path('../initializers/environment', __FILE__)
4
8
  <%- if @redis -%>
5
9
  require File.expand_path('../initializers/redis', __FILE__)
6
10
  <%- end -%>
7
- require File.expand_path('../initializers/environment', __FILE__)
@@ -0,0 +1,35 @@
1
+ class <%= @name.camelcase %>::Application
2
+
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
34
+
35
+ end
@@ -3,7 +3,6 @@ class <%= @name.camelcase %>::Application
3
3
  content_type 'text/html'
4
4
  end
5
5
 
6
- set :sessions, true
7
6
  <%- unless @no_views -%>
8
7
  set :views, Proc.new { File.join(root, "/app/views") }
9
8
  <%- end -%>
@@ -23,8 +22,11 @@ class <%= @name.camelcase %>::Application
23
22
  use Rack::CommonLogger, file
24
23
 
25
24
  # set CSRF
26
- # use Rack::Session::Cookie, secret: $app_settings["csrf_token"]
27
- # use Rack::Csrf, :raise => true
25
+
26
+ <%- unless @no_views -%>
27
+ use Rack::Session::Cookie, key: _<%= @name %>.session, secret: $app_settings["csrf_token"]
28
+ use Rack::Csrf, :raise => true
29
+ <%- end %>
28
30
 
29
31
  <%- unless @no_views -%>
30
32
  # set layouts
@@ -2,6 +2,7 @@ default: &default
2
2
  name: "<%= @name.camelcase %>"
3
3
  description: "<%= @name.camelcase %> API awesome!"
4
4
  url: "https://<%= @name.filename %>.com/"
5
+ csrf_token: <%= SecureRandom.hex(32) %>
5
6
 
6
7
  development:
7
8
  <<: *default
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.2.7
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Chan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -24,8 +24,8 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.19'
27
- description: Aetherg (Aether Generator) is a sinatra based App generator, let you
28
- quickly generate a sinatra app.
27
+ description: Aetherg (Aether Generator) is a sinatra based App generator. Light-weight
28
+ for API service or full-stack Web apps
29
29
  email: chenillen@gmail.com
30
30
  executables:
31
31
  - aetherg
@@ -43,6 +43,7 @@ files:
43
43
  - lib/aetherg.rb
44
44
  - lib/aetherg/aetherg.rb
45
45
  - lib/aetherg/string.rb
46
+ - lib/aetherg/version.rb
46
47
  - lib/templates/Gemfile
47
48
  - lib/templates/README.md
48
49
  - lib/templates/Rakefile
@@ -52,6 +53,7 @@ files:
52
53
  - lib/templates/config.ru
53
54
  - lib/templates/config/database.yml
54
55
  - lib/templates/config/initializer.rb
56
+ - lib/templates/config/initializers/assets.rb
55
57
  - lib/templates/config/initializers/connection.rb
56
58
  - lib/templates/config/initializers/environment.rb
57
59
  - lib/templates/config/initializers/redis.rb
@@ -79,8 +81,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
81
  version: '0'
80
82
  requirements: []
81
83
  rubyforge_project:
82
- rubygems_version: 2.4.8
84
+ rubygems_version: 2.6.6
83
85
  signing_key:
84
86
  specification_version: 4
85
87
  summary: Aetherg (Aether Generator) is a generator of sinatra app.
86
88
  test_files: []
89
+ has_rdoc: