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 +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/aetherg.gemspec +2 -2
- data/bin/aetherg +1 -0
- data/changchangchang/app/routes/welcome.rb +6 -0
- data/changchangchang/app/views/layouts/application.erb +0 -0
- data/changchangchang/application.rb +36 -0
- data/lib/aetherg/aetherg.rb +3 -1
- data/lib/aetherg/version.rb +2 -2
- data/lib/templates/Gemfile +10 -5
- data/lib/templates/app/assets/javascripts/application.js +6 -0
- data/lib/templates/app/assets/stylesheets/application.css +9 -0
- data/lib/templates/app/views/layouts/application.erb +4 -2
- data/lib/templates/config/initializers/assets.rb +52 -31
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c14fc0b51212c45fc6b1a9ecd2a63e0c4919e61
|
4
|
+
data.tar.gz: 498aad0e46737bd2ca39a0fb4021d0561f2fc401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10c303c2583f5ffdd591365f6d573286eb4ba16e52281eef27797927b126a75ff5cc118fc63b52224db605bf50d551f980942aec0680658be67b34671670224
|
7
|
+
data.tar.gz: 43d5569efb69129f6c013bf3b6b72ae2e428acfe58ad6ee8a2657bbccc3d3eb4ddb81d83824eeb1af6b3760b07f44e47e594e5220dff2dea3cd0595c29e615c4
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.0.
|
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.
|
4
|
-
s.date = '2017-04-
|
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
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)
|
data/lib/aetherg/aetherg.rb
CHANGED
@@ -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/
|
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
|
|
data/lib/aetherg/version.rb
CHANGED
data/lib/templates/Gemfile
CHANGED
@@ -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
|
-
#
|
25
|
-
#
|
26
|
-
gem '
|
27
|
-
gem '
|
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,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=
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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.
|
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-
|
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
|