app_stack 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +43 -0
- data/README.md +49 -38
- data/doc/coverage/.last_run.json +1 -0
- data/doc/coverage/.resultset.json +1 -0
- data/doc/coverage/assets/0.7.1/application.css +1110 -0
- data/doc/coverage/assets/0.7.1/application.js +626 -0
- data/doc/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
- data/doc/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
- data/doc/coverage/assets/0.7.1/favicon_green.png +0 -0
- data/doc/coverage/assets/0.7.1/favicon_red.png +0 -0
- data/doc/coverage/assets/0.7.1/favicon_yellow.png +0 -0
- data/doc/coverage/assets/0.7.1/loading.gif +0 -0
- data/doc/coverage/assets/0.7.1/magnify.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/doc/coverage/index.html +2420 -0
- data/lib/app_stack/config.rb +132 -0
- data/lib/app_stack/merger.rb +127 -0
- data/lib/app_stack/version.rb +1 -1
- data/lib/app_stack.rb +15 -246
- data/spec/config_spec.rb +82 -0
- data/spec/fixtures/config_sample/sample.yml +19 -0
- data/spec/fixtures/config_sample/wrong_key.yml +2 -0
- data/spec/fixtures/config_sample/wrong_type.yml +1 -0
- data/spec/fixtures/sample_files/module_1/Gemfile.erb +1 -0
- data/spec/fixtures/sample_files/module_1/app_stack.yml +10 -0
- data/spec/fixtures/sample_files/module_1/doc/excluding.txt +1 -0
- data/spec/fixtures/sample_files/module_1/lib/mixins/b_lib.rb +0 -0
- data/spec/fixtures/sample_files/module_1/lib/mixins/s_lib.rb +0 -0
- data/spec/fixtures/sample_files/module_1/lib/samples/a_lib.rb +0 -0
- data/spec/fixtures/sample_files/module_1/spec/config_spec.rb +0 -0
- data/spec/fixtures/sample_files/module_2/Gemfile +0 -0
- data/spec/fixtures/sample_files/module_2/Gemfile.liquid +1 -0
- data/spec/fixtures/sample_files/module_2/app/lib/sequence.rb +0 -0
- data/spec/fixtures/sample_files/module_2/app_stack.yml +3 -0
- data/spec/fixtures/sample_files/module_3/app_stack.yml +3 -0
- data/spec/fixtures/sample_files/module_3/bin/del +0 -0
- data/spec/fixtures/sample_files/module_3/bin/rm +0 -0
- data/spec/fixtures/sample_files/module_3/config/application.yml +0 -0
- data/spec/fixtures/sample_files/module_3/config/database_development.yml +0 -0
- data/spec/fixtures/sample_files/module_3/config/database_production.yml +0 -0
- data/spec/fixtures/sample_files/module_3/lib/libfile_1.rb +0 -0
- data/spec/fixtures/sample_files/module_3/lib/libfile_2.rb +0 -0
- data/spec/fixtures/sample_files/my_app/app_stack.yml +15 -0
- data/spec/fixtures/sample_files/my_app/doc/excluding.txt +1 -0
- data/spec/fixtures/sample_files/my_app/spec/config_spec.rb +0 -0
- data/spec/fixtures/sample_files/my_app_back/app_stack.yml +15 -0
- data/spec/fixtures/sample_files/my_app_back/doc/excluding.txt +1 -0
- data/spec/fixtures/sample_files/my_app_back/spec/config_spec.rb +0 -0
- data/spec/merger_spec.rb +43 -0
- data/spec/spec_helper.rb +6 -8
- data/spec/stackup_spec.rb +11 -50
- metadata +94 -47
- data/spec/app_as_hash_spec.rb +0 -15
- data/spec/export_list_spec.rb +0 -66
- data/spec/fixtures/.app_stack.yml +0 -21
- data/spec/fixtures/app-sample.yml +0 -25
- data/spec/fixtures/incexc/.gitignore +0 -27
- data/spec/fixtures/incexc/incexc-config.yml +0 -24
- data/spec/fixtures/incexc/lib/anyway.rb +0 -1
- data/spec/fixtures/incexc/lib/extra/excludes.rb +0 -1
- data/spec/fixtures/incexc/lib/mixin/otherlib.rb +0 -1
- data/spec/fixtures/incexc/spec/spec_helper.rb +0 -1
- data/spec/fixtures/incexc/spec/support/api_test.rb +0 -1
- data/spec/fixtures/incexc-config.yml +0 -23
- data/spec/fixtures/my_app/.app_stack.yml +0 -31
- data/spec/fixtures/my_app/.gitignore +0 -27
- data/spec/fixtures/my_app/config/self_render.conf.erb +0 -1
- data/spec/fixtures/sample_config.yml +0 -21
- data/spec/fixtures/stack_apps/module-1/.app_stack.yml +0 -17
- data/spec/fixtures/stack_apps/module-1/Gemfile +0 -3
- data/spec/fixtures/stack_apps/module-1/lib/auth_util.rb +0 -5
- data/spec/fixtures/stack_apps/module-1/lib/libonly1.rb +0 -6
- data/spec/fixtures/stack_apps/module-2/.app_stack.yml +0 -22
- data/spec/fixtures/stack_apps/module-2/Gemfile.erb +0 -11
- data/spec/fixtures/stack_apps/module-2/lib/auth_util.rb +0 -6
- data/spec/fixtures/stack_apps/module-2/lib/libonly2.rb +0 -6
- data/spec/gitignore_list_spec.rb +0 -21
- data/spec/load_configuration_spec.rb +0 -16
- data/spec/register_self_spec.rb +0 -13
- /data/spec/fixtures/{stack_apps/module-2 → sample_files/module_1}/Gemfile +0 -0
- /data/spec/fixtures/{incexc → sample_files/module_1}/Rakefile +0 -0
- /data/spec/fixtures/{incexc/.rspec → sample_files/module_1/config/boot_sample.rb} +0 -0
- /data/spec/fixtures/{incexc/Rakefile.erb → sample_files/module_1/doc/including.txt} +0 -0
data/Gemfile.lock
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://ruby.taobao.org/
|
3
|
+
specs:
|
4
|
+
activesupport (4.0.0)
|
5
|
+
i18n (~> 0.6, >= 0.6.4)
|
6
|
+
minitest (~> 4.2)
|
7
|
+
multi_json (~> 1.3)
|
8
|
+
thread_safe (~> 0.1)
|
9
|
+
tzinfo (~> 0.3.37)
|
10
|
+
atomic (1.1.13)
|
11
|
+
diff-lcs (1.2.4)
|
12
|
+
i18n (0.6.5)
|
13
|
+
minitest (4.7.5)
|
14
|
+
multi_json (1.8.0)
|
15
|
+
rspec (2.14.1)
|
16
|
+
rspec-core (~> 2.14.0)
|
17
|
+
rspec-expectations (~> 2.14.0)
|
18
|
+
rspec-mocks (~> 2.14.0)
|
19
|
+
rspec-core (2.14.5)
|
20
|
+
rspec-expectations (2.14.3)
|
21
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
22
|
+
rspec-mocks (2.14.3)
|
23
|
+
simplecov (0.7.1)
|
24
|
+
multi_json (~> 1.0)
|
25
|
+
simplecov-html (~> 0.7.1)
|
26
|
+
simplecov-html (0.7.1)
|
27
|
+
term-ansicolor (1.2.2)
|
28
|
+
tins (~> 0.8)
|
29
|
+
thread_safe (0.1.2)
|
30
|
+
atomic
|
31
|
+
tilt (1.4.1)
|
32
|
+
tins (0.11.0)
|
33
|
+
tzinfo (0.3.37)
|
34
|
+
|
35
|
+
PLATFORMS
|
36
|
+
ruby
|
37
|
+
|
38
|
+
DEPENDENCIES
|
39
|
+
activesupport (>= 3.2.14)
|
40
|
+
rspec (>= 2.14.1)
|
41
|
+
simplecov (>= 0.7.1)
|
42
|
+
term-ansicolor (>= 1.2.2)
|
43
|
+
tilt (>= 1.4.1)
|
data/README.md
CHANGED
@@ -1,28 +1,47 @@
|
|
1
|
-
# Merge Source
|
1
|
+
# Merge Source Files from Directories in Chain
|
2
2
|
|
3
3
|
## Concept
|
4
4
|
|
5
|
-
|
6
|
-
a stack of modules.
|
5
|
+
Import source files from a chain of application modules.
|
7
6
|
|
8
7
|
## Synposis
|
9
8
|
|
10
9
|
Put a configuration file `.app_stack.yml` in your application
|
11
10
|
directory, in format like:
|
12
11
|
|
13
|
-
|
12
|
+
stack_dir: '../'
|
13
|
+
|
14
|
+
The directory contains other modules to import.
|
15
|
+
|
16
|
+
stack:
|
14
17
|
- module-1
|
15
18
|
- module-2: [defaults, tests]
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
+
- module-3:
|
20
|
+
- defaults
|
21
|
+
- file_a.html: file_a.htm
|
22
|
+
- file_b.txt: ''
|
23
|
+
|
24
|
+
Define three modules to import (in directory `../module-1`, ...). Accord to the
|
25
|
+
above setting, stack_app will copy `default` set of files exported by `module-1`,
|
26
|
+
the `default` and `tests` set of files from `module-2` (file sets defined as string
|
27
|
+
in array), and `defaults` set of files from `module-3`, plus `file_a.html` copied
|
28
|
+
as `file_a.htm` and `file_b.txt` copied as it is (single files defined as a hash).
|
29
|
+
|
30
|
+
exclude:
|
31
|
+
- config/*
|
32
|
+
- filename_2
|
33
|
+
|
34
|
+
Do not copy `config/*` and single file `filename_2` from the stack.
|
35
|
+
|
19
36
|
export:
|
20
37
|
- lib/**/*.rb
|
21
38
|
- app/**/*.rb
|
22
39
|
- tests:
|
23
40
|
- spec/**/*.rb
|
24
|
-
|
25
|
-
|
41
|
+
|
42
|
+
When used as a stack module, export the above files where ruby files under `lib/`
|
43
|
+
and `app` are in the `defaults` set, besides with the `tests` set.
|
44
|
+
|
26
45
|
attrs:
|
27
46
|
application_name: App Name
|
28
47
|
application_code: app_code
|
@@ -32,45 +51,37 @@ directory, in format like:
|
|
32
51
|
- rspec: '~> 2.0.0'
|
33
52
|
- ...
|
34
53
|
development:
|
35
|
-
files:
|
36
|
-
README.md: __self
|
37
|
-
|
38
54
|
|
39
|
-
`
|
40
|
-
|
41
|
-
:
|
55
|
+
`attrs` can be inserted into `.erb` files.
|
56
|
+
|
57
|
+
stack_dir: '../'
|
42
58
|
|
43
|
-
|
44
|
-
: 模块程序所在位置。
|
59
|
+
Define directory where the source code of stack modules located. Default is `../`
|
45
60
|
|
46
|
-
|
47
|
-
: 可被拷贝至其他模块的文件pattern(为字符串时),或pattern的组
|
48
|
-
: (像上述示例中的`tests`一样)。
|
61
|
+
tpl_ext: ['.erb', '.haml', '.liquid']
|
49
62
|
|
50
|
-
|
51
|
-
: 导出到其它模块时,从`export`列表中除外的文件pattern。
|
52
|
-
: 注意如果模块中定义了`.gitignore`文件,则其中的内容也会被加载至
|
53
|
-
: `exclude`列表。
|
63
|
+
Default as above (refer to document below).
|
54
64
|
|
55
|
-
|
56
|
-
: 用于assign至`.erb`文件的属性值。在上面的例子中module2会继承
|
57
|
-
: module1中设置的值。
|
65
|
+
## Copy Precedence
|
58
66
|
|
59
|
-
|
67
|
+
For a module chain `a, b, c, ...`, files exported by `b` will over-write
|
68
|
+
the same files exported by `a` and so on.
|
60
69
|
|
61
|
-
|
62
|
-
|
63
|
-
and `exclude` adjust files that imports from other modules.
|
70
|
+
If you want the files defined in `a`, manually copy it to the local directory
|
71
|
+
and set it to `exclude` list.
|
64
72
|
|
65
|
-
|
73
|
+
Note: `exclude` means 'use local file if exists, otherwise copy it', not
|
74
|
+
'do not copy it'.
|
66
75
|
|
67
|
-
|
76
|
+
## Template
|
68
77
|
|
69
|
-
|
78
|
+
If defined to export, for example `Gemfile`, and also defined a `Gemfile.erb`,
|
79
|
+
the later will be used as a template to render `Gemefile`.
|
70
80
|
|
71
|
-
|
72
|
-
|
73
|
-
be assigned into this file.
|
81
|
+
For a module chain `a, b, c, ...`, `attrs` defined in `c` will merged into
|
82
|
+
`attrs` defined in `b` ... and then assigned into the `erb` template.
|
74
83
|
|
75
|
-
|
84
|
+
App_stack use tilt to support `.erb`, `.haml` and `.liquid`, if a file have
|
85
|
+
more than one template defined, the later will silently over-write the former.
|
86
|
+
You can change the order in `tpl_ext` setting.
|
76
87
|
|
@@ -0,0 +1 @@
|
|
1
|
+
{"result":{"covered_percent":94.33}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"RSpec":{"coverage":{"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack.rb":[null,null,1,1,1,1,1,1,1,null,1,null,2,null,1,null,1,null,null,1,1,null,null,null,1,null,1,1,null,null,1,null,null,1,null],"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack/config.rb":[null,1,null,1,1,null,null,1,1,null,1,39,39,null,null,39,null,null,null,null,null,null,null,null,null,39,null,68,null,null,67,66,null,null,null,37,null,null,null,37,315,null,null,null,37,null,null,1,244,null,null,null,1,2,null,null,1,22,null,null,null,1,34,34,34,null,null,1,49,null,null,1,42,14,14,14,null,null,28,null,null,null,1,null,null,1,null,24,24,88,20,20,20,null,null,68,68,null,null,24,null,null,null,1,100,100,null,10,10,10,10,null,null,90,126,null,null,100,null,null,null,null,1,92,92,92,100,null,92,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/lib/app_stack/merger.rb":[null,null,1,null,1,1,null,1,null,7,7,7,null,7,7,7,7,null,7,7,7,null,null,1,3,3,9,48,48,3,null,6,null,null,39,39,117,null,null,39,6,null,33,null,null,null,9,null,null,3,0,0,0,null,null,0,0,0,null,null,null,null,1,1,12,2,null,null,1,null,1,11,11,11,null,null,1,1,1,1,1,1,null,0,0,null,1,null,null,null,1,7,null,7,null,28,null,0,21,null,null,null,null,1,21,21,21,21,21,21,63,21,null,null,null,1,84,45,6,null,null,1,0,0,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/module_1/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/my_app/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/fixtures/sample_files/my_app_back/spec/config_spec.rb":[],"/cygdrive/d/working/gems/app_stack-gem/spec/merger_spec.rb":[null,null,1,null,1,7,1,1,1,null,null,1,1,1,null,null,1,1,1,null,null,1,1,1,null,null,null,1,1,1,1,1,1,null,null,1,1,1,1,1,null,null,null],"/cygdrive/d/working/gems/app_stack-gem/spec/stackup_spec.rb":[null,1,null,1,1,1,1,1,1,1,1,1,1,1,null,null,null]},"timestamp":1380702239}}
|