aetherg 0.2.2 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/aetherg/aetherg.rb +16 -9
- data/lib/templates/Gemfile +2 -2
- data/lib/templates/README.md +1 -1
- data/lib/templates/application.rb +2 -0
- data/lib/templates/boot.rb +0 -2
- data/lib/templates/config/initializers/environment.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daa703c22c59a89dd84808192bd2027dc5a52f66
|
4
|
+
data.tar.gz: 490735bc92e745d8b23b1ecee150cc1e0ee1ead3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
32
|
-
|
32
|
+
Copyright (c) 2016 Allen Chan, Inc. See LISENCE for detail.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/lib/aetherg/aetherg.rb
CHANGED
@@ -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, :
|
7
|
-
class_option :database, :
|
8
|
-
class_option :no_database, :
|
9
|
-
class_option :redis, :
|
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/
|
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
|
data/lib/templates/Gemfile
CHANGED
@@ -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.
|
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
|
16
|
+
gem 'mysql2', '~> 0.4.3'
|
17
17
|
<%- end -%>
|
18
18
|
<%- if @redis -%>
|
19
19
|
gem 'redis'
|
data/lib/templates/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
## Description
|
4
4
|
|
5
|
-
A sinatra application generated by ![Aether](https://github.com/
|
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.
|
data/lib/templates/boot.rb
CHANGED
@@ -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.
|
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:
|
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.
|
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.
|