aetherg 0.2.2 → 0.2.5

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: 23bdadc17c0370a18a562f1653a19e23f30d060a
4
- data.tar.gz: ccb6682cda86e9104cc666abc37053215d124190
3
+ metadata.gz: daa703c22c59a89dd84808192bd2027dc5a52f66
4
+ data.tar.gz: 490735bc92e745d8b23b1ecee150cc1e0ee1ead3
5
5
  SHA512:
6
- metadata.gz: 92fe23f4295263180e436f4982b2e52cb464e82bbcceea89384fddc33e8f90a6bcdbd67578c52d2f4b0de0355ed79521d1236020a5991afd011abba7ac9a4d1b
7
- data.tar.gz: 05b786aeb1e31104a39ac72799117b8908dce756ff6e8676d2a0b8ca56b9dd244a6755a3663a293de955bfe1d2d6a06d99009c8fd140269c0039c89f6f03397d
6
+ metadata.gz: 4fc311fce1c037f68ac81ede30b3e996c375a6d4568c5ddd9b4944ce796a1c999c7a49526682735424c79b2062f664d017883ac3e00d1f2196edbdf5d5a64a74
7
+ data.tar.gz: 02d37a479fac0c79e93aecfb5dfb29ff8bbef9bfa8aea50267ada90bc60d182c1ea37ee80e1535d83b6afe3fe551370d8ce6ea13a67506995a393bb68f1d1c70
data/README.md CHANGED
@@ -25,8 +25,8 @@ Usage
25
25
  * `-d` with database options. "postgresql," "mysql," "sqlite",
26
26
  and "mongodb." Default is "mysql."
27
27
  * `--no-database` Don't include any database config options.
28
+ * `--no-views` Don't use views, only for API.
28
29
 
29
30
  Copyright
30
31
  -----
31
- Copyright (c) 2015 Allen Chan @ Octo Music, Inc. See LISENCE for detail.
32
-
32
+ Copyright (c) 2016 Allen Chan, Inc. See LISENCE for detail.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.5
@@ -3,10 +3,11 @@ module Aetherg
3
3
  include Thor::Actions
4
4
 
5
5
  desc "Create a new sinatra application with aetherg"
6
- argument :name, :type => :string, :desc => "What's the name of your application"
7
- class_option :database, :aliases => "-d", :default => "mysql", :desc => "The type of database to use, sqlite, mysql, postgresql supported"
8
- class_option :no_database, :type => :boolean, :desc => "Exclude all database configuration files"
9
- class_option :redis, :type => :boolean, :desc => "Include Redis configuration"
6
+ argument :name, type: :string, desc: "What's the name of your application"
7
+ class_option :database, aliases: "-d", default: "mysql", desc: "The type of database to use, sqlite, mysql, postgresql supported"
8
+ class_option :no_database, type: :boolean, desc: "Exclude all database configuration files"
9
+ class_option :redis, type: :boolean, desc: "Include Redis configuration"
10
+ class_option :no_views, type: :boolean, desc: "Disable/Enable views, default: true"
10
11
 
11
12
  # Creates instance variables from options passed to Aether
12
13
 
@@ -23,9 +24,13 @@ module Aetherg
23
24
 
24
25
  # Create empty directories
25
26
  def create_empty_directories
26
- %w{app/assets/images app/assets/javascripts app/assets/stylesheets app/models app/helpers app/routes app/views config/initializers db/migrate lib log tmp public}.each do |dir|
27
+ %w{app/models app/helpers app/routes config/initializers db/migrate lib log tmp}.each do |dir|
27
28
  empty_directory File.join(@app_path, dir)
28
29
  end
30
+
31
+ %w{app/assets app/assets/images app/assets/javascripts app/assets/stylesheets app/views public}.each do |dir|
32
+ empty_directory File.join(@app_path, dir)
33
+ end unless @no_views
29
34
  end
30
35
 
31
36
  def create_app
@@ -82,15 +87,17 @@ module Aetherg
82
87
  end
83
88
 
84
89
  def create_gitkeep
85
- create_file File.join(@app_path, "app", "assets", "images", ".keep")
86
- create_file File.join(@app_path, "app", "assets", "stylesheets", ".keep")
87
- create_file File.join(@app_path, "app", "assets", "javascripts", ".keep")
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
88
93
  create_file File.join(@app_path, "app", "models", ".keep")
89
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")
90
97
  create_file File.join(@app_path, "app", "views", ".keep")
91
98
  create_file File.join(@app_path, "lib", ".keep")
92
99
  create_file File.join(@app_path, "db", "migrate", ".keep")
93
- create_file File.join(@app_path, "public", ".keep")
100
+ create_file File.join(@app_path, "public", ".keep") unless @no_views
94
101
  end
95
102
 
96
103
  end
@@ -1,7 +1,7 @@
1
1
  source "https://ruby.taobao.org"
2
2
  # source "https://rubygems.org" # Use rubygems if you're not in China
3
3
 
4
- gem 'sinatra', '~> 1.4.6', require: false
4
+ gem 'sinatra', '~> 1.4.7', require: 'sinatra/base'
5
5
  gem 'rake'
6
6
  <%- unless @no_database -%>
7
7
  gem 'activerecord'
@@ -13,7 +13,7 @@ gem 'sqlite3'
13
13
  gem 'mongoid'
14
14
  <%- else -%>
15
15
  # default database: mysql
16
- gem 'mysql2', '~> 0.3.20'
16
+ gem 'mysql2', '~> 0.4.3'
17
17
  <%- end -%>
18
18
  <%- if @redis -%>
19
19
  gem 'redis'
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Description
4
4
 
5
- A sinatra application generated by ![Aether](https://github.com/octomusic/aether)
5
+ A sinatra application generated by ![Aether](https://github.com/chenillen/aether)
6
6
 
7
7
  ## Introduction of Aether
8
8
  Aether is a self-used web service framework template. Based on sinatra, simply and lightweight.
@@ -4,7 +4,9 @@ module <%= @name.camelcase %>
4
4
  class Application < Sinatra::Base
5
5
 
6
6
  set :root, File.dirname(__FILE__)
7
+ <%- unless @no_views -%>
7
8
  set :public_dir, File.expand_path('../public', __FILE__)
9
+ <%- end -%>
8
10
  set :raise_errors, true
9
11
  set :app_file, __FILE__
10
12
 
@@ -2,6 +2,4 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
  # Set up gems listed in the Gemfile.
4
4
  Bundler.require(:default, ENV['RACK_ENV'] || 'development')
5
-
6
- require 'sinatra/base'
7
5
  require 'yaml'
@@ -4,11 +4,15 @@ class <%= @name.camelcase %>::Application
4
4
  end
5
5
 
6
6
  set :sessions, true
7
+ <%- unless @no_views -%>
7
8
  set :views, Proc.new { File.join(root, "/app/views") }
9
+ <%- end -%>
8
10
 
9
11
  configure do
10
12
  enable :logging
13
+ <%- unless @no_views -%>
11
14
  enable :static_cache_control
15
+ <%- end -%>
12
16
  file = File.new("#{root}/log/#{environment.to_s}.log", 'a+')
13
17
 
14
18
  <%- unless @no_database || @database == 'mongodb' || @database == 'mongo' -%>
@@ -22,8 +26,10 @@ class <%= @name.camelcase %>::Application
22
26
  # use Rack::Session::Cookie, secret: $app_settings["csrf_token"]
23
27
  # use Rack::Csrf, :raise => true
24
28
 
29
+ <%- unless @no_views -%>
25
30
  # set layouts
26
31
  set :erb, :layout => :'layouts/application', :escape_html => true
32
+ <%- end -%>
27
33
  end
28
34
 
29
35
  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.2.2
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Chan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-21 00:00:00.000000000 Z
11
+ date: 2016-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.4.6
83
+ rubygems_version: 2.4.8
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: Aetherg (Aether Generator) is a generator of sinatra app.