appril-cli 0.0.6 → 0.0.7
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/boilerplate/app/base/api/rtcp_controller.rb +1 -1
- data/boilerplate/app/base/boot.rb +1 -1
- data/boilerplate/app/base/load.rb +2 -0
- data/boilerplate/app/config/config.rb +8 -3
- data/boilerplate/app/core/boot.rb +39 -35
- data/boilerplate/app/core/generate_configs.rb +1 -1
- data/boilerplate/app/core/load.rb +3 -7
- data/boilerplate/app/core/load_api.rb +10 -0
- data/boilerplate/app/core/load_helpers.rb +6 -0
- data/boilerplate/app/core/load_models.rb +6 -0
- data/boilerplate/crudle/base/api/index/client.coffee +5 -0
- data/boilerplate/crudle/base/api/index/layout.html +5 -0
- data/boilerplate/crudle/base/api/index/server.rb +3 -0
- data/lib/appril-cli/version.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61b2c49ff11c5fedcc25016cc70eed0b218d2211
|
4
|
+
data.tar.gz: 46a6420c5cf7d573f0e4110719523823c7681238
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d72448e5413aa4b19450adbf1caaec339a94539b2e90d0a55baaa08eaa9a4e82b8db4cf8266d762c0c5783b6410452d5726409ca9817a00c977927a15b7f7ccc
|
7
|
+
data.tar.gz: 1a4eb3f49d4fd871e254850ed1ba51a00baa322dfacca01c0e965b9e4f85e812572a65990c8619c2056777aba631c58c91f0364aa3354c254c1dee0b758f25df
|
@@ -1,2 +1,2 @@
|
|
1
1
|
# first file to be loaded when app starts.
|
2
|
-
# it is loaded on bare metal, e.g. before any gems, configs
|
2
|
+
# it is loaded on bare metal, e.g. before any gems, configs etc.
|
@@ -1,9 +1,14 @@
|
|
1
1
|
|
2
|
-
# loading .yml configs from current directory.
|
2
|
+
# loading .yml configs from current directory.
|
3
|
+
# config.yml will be loaded first.
|
3
4
|
Cfg = Appril.load_config(File.expand_path('..', __FILE__))
|
4
5
|
|
5
6
|
# it is highly recommended to freeze configs so they stay unaltered on runtime.
|
6
7
|
Cfg.freeze
|
7
8
|
|
8
|
-
# loading any .rb files in current dir.
|
9
|
-
|
9
|
+
# loading any .rb files in current dir.
|
10
|
+
# this one will be skipped automatically.
|
11
|
+
%w[
|
12
|
+
../*.rb
|
13
|
+
../**/*.rb
|
14
|
+
].each {|p| Dir[File.expand_path(p, __FILE__)].each {|f| require(f)} }
|
@@ -6,34 +6,47 @@ require 'appril'
|
|
6
6
|
module Appril
|
7
7
|
extend self
|
8
8
|
|
9
|
-
def load_config
|
10
|
-
|
11
|
-
config =
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
key_config
|
9
|
+
def load_config *dirs, env: RocketIO.environment
|
10
|
+
|
11
|
+
config = RocketIO.indifferent_params({environment: env.to_s.freeze})
|
12
|
+
|
13
|
+
dirs.each do |dir|
|
14
|
+
config.update(load_config_file("#{dir}/config.yml"))
|
15
|
+
config.update(load_config_file("#{dir}/env/#{env}.yml"))
|
16
|
+
|
17
|
+
loaded = [
|
18
|
+
File.expand_path("config.yml", dir),
|
19
|
+
File.expand_path("env/#{env}.yml", dir)
|
20
|
+
]
|
21
|
+
|
22
|
+
%w[
|
23
|
+
*.yml
|
24
|
+
**/*.yml
|
25
|
+
].each do |pattern|
|
26
|
+
Dir[File.join(dir, pattern)].each do |file|
|
27
|
+
|
28
|
+
path = File.expand_path(file, dir)
|
29
|
+
next if loaded.include?(path)
|
30
|
+
loaded << path
|
31
|
+
|
32
|
+
key = File.basename(file, '.yml')
|
33
|
+
key_config = load_config_file(file)
|
34
|
+
key_config_keys = key_config.keys.map(&:to_s)
|
35
|
+
|
36
|
+
config[key] = if key_config_keys.include?(config[:environment])
|
37
|
+
# current environment found, use it
|
38
|
+
key_config[config[:environment]]
|
39
|
+
else
|
40
|
+
if RocketIO::ENVIRONMENTS.keys.find {|k| key_config_keys.include?(k)}
|
41
|
+
# there are some environment(s), but no current one so set current environment to nil
|
42
|
+
nil
|
43
|
+
else
|
44
|
+
# there are no environments, so this config is available on any environment
|
45
|
+
key_config
|
46
|
+
end
|
47
|
+
end
|
34
48
|
end
|
35
49
|
end
|
36
|
-
|
37
50
|
end
|
38
51
|
|
39
52
|
def config.method_missing key
|
@@ -56,13 +69,4 @@ Dir.chdir File.expand_path('../..', __FILE__) do
|
|
56
69
|
Bundler.require(RocketIO.environment)
|
57
70
|
|
58
71
|
require './config/config'
|
59
|
-
|
60
|
-
require './base/helpers/application_helpers'
|
61
|
-
Dir['./base/helpers/**/*.rb'].each {|f| require(f)}
|
62
|
-
|
63
|
-
%w[
|
64
|
-
base_model.rb
|
65
|
-
*.rb
|
66
|
-
**/*.rb
|
67
|
-
].each {|p| Dir[File.expand_path("../../base/models/#{p}", __FILE__)].each {|f| require(f)}}
|
68
72
|
end
|
@@ -8,7 +8,7 @@ module Appril
|
|
8
8
|
extend self
|
9
9
|
|
10
10
|
def generate_configs dir
|
11
|
-
config = load_config("#{dir}/config", :development)
|
11
|
+
config = load_config("#{dir}/config", env: :development)
|
12
12
|
|
13
13
|
controllers = controllers_map(dir)
|
14
14
|
webpack_entries = webpack_entries(dir, controllers)
|
@@ -1,13 +1,9 @@
|
|
1
1
|
# do NOT edit this file, edit ../base/load.rb instead
|
2
2
|
|
3
3
|
Dir.chdir File.expand_path('../..', __FILE__) do
|
4
|
-
|
5
4
|
require './core/boot'
|
6
5
|
require './base/load'
|
7
|
-
require './
|
8
|
-
require './
|
9
|
-
|
10
|
-
Dir['./base/api/**/server.rb'].sort {|a,b|
|
11
|
-
a.split(/\/+/).size <=> b.split(/\/+/).size
|
12
|
-
}.each {|f| require(f)}
|
6
|
+
require './core/load_helpers'
|
7
|
+
require './core/load_models'
|
8
|
+
require './core/load_api'
|
13
9
|
end
|
data/lib/appril-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appril-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Slee Woo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Appril CLI
|
14
14
|
email:
|
@@ -53,6 +53,9 @@ files:
|
|
53
53
|
- boilerplate/app/core/boot.rb
|
54
54
|
- boilerplate/app/core/generate_configs.rb
|
55
55
|
- boilerplate/app/core/load.rb
|
56
|
+
- boilerplate/app/core/load_api.rb
|
57
|
+
- boilerplate/app/core/load_helpers.rb
|
58
|
+
- boilerplate/app/core/load_models.rb
|
56
59
|
- boilerplate/app/generators/api/client.coffee
|
57
60
|
- boilerplate/app/generators/api/layout.html
|
58
61
|
- boilerplate/app/generators/api/server.rb
|
@@ -62,6 +65,9 @@ files:
|
|
62
65
|
- boilerplate/app/var/.ignore
|
63
66
|
- boilerplate/app/webpack.config.js
|
64
67
|
- boilerplate/crudle/Gemfile
|
68
|
+
- boilerplate/crudle/base/api/index/client.coffee
|
69
|
+
- boilerplate/crudle/base/api/index/layout.html
|
70
|
+
- boilerplate/crudle/base/api/index/server.rb
|
65
71
|
- boilerplate/crudle/base/core.coffee
|
66
72
|
- boilerplate/crudle/base/templates/menu.html
|
67
73
|
- boilerplate/crudle/generators/api/client.coffee
|
@@ -152,5 +158,5 @@ rubyforge_project:
|
|
152
158
|
rubygems_version: 2.5.1
|
153
159
|
signing_key:
|
154
160
|
specification_version: 4
|
155
|
-
summary: '["appril-cli-0.0.
|
161
|
+
summary: '["appril-cli-0.0.7", "Appril CLI"]'
|
156
162
|
test_files: []
|