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.
Files changed (113) hide show
  1. data/Gemfile.lock +43 -0
  2. data/README.md +49 -38
  3. data/doc/coverage/.last_run.json +1 -0
  4. data/doc/coverage/.resultset.json +1 -0
  5. data/doc/coverage/assets/0.7.1/application.css +1110 -0
  6. data/doc/coverage/assets/0.7.1/application.js +626 -0
  7. data/doc/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
  8. data/doc/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
  9. data/doc/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
  10. data/doc/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
  11. data/doc/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
  12. data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
  13. data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
  14. data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
  15. data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
  16. data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
  17. data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
  18. data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
  19. data/doc/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
  20. data/doc/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
  21. data/doc/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
  22. data/doc/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
  23. data/doc/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
  24. data/doc/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
  25. data/doc/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
  26. data/doc/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
  27. data/doc/coverage/assets/0.7.1/favicon_green.png +0 -0
  28. data/doc/coverage/assets/0.7.1/favicon_red.png +0 -0
  29. data/doc/coverage/assets/0.7.1/favicon_yellow.png +0 -0
  30. data/doc/coverage/assets/0.7.1/loading.gif +0 -0
  31. data/doc/coverage/assets/0.7.1/magnify.png +0 -0
  32. data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  33. data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  34. data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  35. data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  36. data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  37. data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  38. data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  39. data/doc/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  40. data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
  41. data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  42. data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
  43. data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
  44. data/doc/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  45. data/doc/coverage/index.html +2420 -0
  46. data/lib/app_stack/config.rb +132 -0
  47. data/lib/app_stack/merger.rb +127 -0
  48. data/lib/app_stack/version.rb +1 -1
  49. data/lib/app_stack.rb +15 -246
  50. data/spec/config_spec.rb +82 -0
  51. data/spec/fixtures/config_sample/sample.yml +19 -0
  52. data/spec/fixtures/config_sample/wrong_key.yml +2 -0
  53. data/spec/fixtures/config_sample/wrong_type.yml +1 -0
  54. data/spec/fixtures/sample_files/module_1/Gemfile.erb +1 -0
  55. data/spec/fixtures/sample_files/module_1/app_stack.yml +10 -0
  56. data/spec/fixtures/sample_files/module_1/doc/excluding.txt +1 -0
  57. data/spec/fixtures/sample_files/module_1/lib/mixins/b_lib.rb +0 -0
  58. data/spec/fixtures/sample_files/module_1/lib/mixins/s_lib.rb +0 -0
  59. data/spec/fixtures/sample_files/module_1/lib/samples/a_lib.rb +0 -0
  60. data/spec/fixtures/sample_files/module_1/spec/config_spec.rb +0 -0
  61. data/spec/fixtures/sample_files/module_2/Gemfile +0 -0
  62. data/spec/fixtures/sample_files/module_2/Gemfile.liquid +1 -0
  63. data/spec/fixtures/sample_files/module_2/app/lib/sequence.rb +0 -0
  64. data/spec/fixtures/sample_files/module_2/app_stack.yml +3 -0
  65. data/spec/fixtures/sample_files/module_3/app_stack.yml +3 -0
  66. data/spec/fixtures/sample_files/module_3/bin/del +0 -0
  67. data/spec/fixtures/sample_files/module_3/bin/rm +0 -0
  68. data/spec/fixtures/sample_files/module_3/config/application.yml +0 -0
  69. data/spec/fixtures/sample_files/module_3/config/database_development.yml +0 -0
  70. data/spec/fixtures/sample_files/module_3/config/database_production.yml +0 -0
  71. data/spec/fixtures/sample_files/module_3/lib/libfile_1.rb +0 -0
  72. data/spec/fixtures/sample_files/module_3/lib/libfile_2.rb +0 -0
  73. data/spec/fixtures/sample_files/my_app/app_stack.yml +15 -0
  74. data/spec/fixtures/sample_files/my_app/doc/excluding.txt +1 -0
  75. data/spec/fixtures/sample_files/my_app/spec/config_spec.rb +0 -0
  76. data/spec/fixtures/sample_files/my_app_back/app_stack.yml +15 -0
  77. data/spec/fixtures/sample_files/my_app_back/doc/excluding.txt +1 -0
  78. data/spec/fixtures/sample_files/my_app_back/spec/config_spec.rb +0 -0
  79. data/spec/merger_spec.rb +43 -0
  80. data/spec/spec_helper.rb +6 -8
  81. data/spec/stackup_spec.rb +11 -50
  82. metadata +94 -47
  83. data/spec/app_as_hash_spec.rb +0 -15
  84. data/spec/export_list_spec.rb +0 -66
  85. data/spec/fixtures/.app_stack.yml +0 -21
  86. data/spec/fixtures/app-sample.yml +0 -25
  87. data/spec/fixtures/incexc/.gitignore +0 -27
  88. data/spec/fixtures/incexc/incexc-config.yml +0 -24
  89. data/spec/fixtures/incexc/lib/anyway.rb +0 -1
  90. data/spec/fixtures/incexc/lib/extra/excludes.rb +0 -1
  91. data/spec/fixtures/incexc/lib/mixin/otherlib.rb +0 -1
  92. data/spec/fixtures/incexc/spec/spec_helper.rb +0 -1
  93. data/spec/fixtures/incexc/spec/support/api_test.rb +0 -1
  94. data/spec/fixtures/incexc-config.yml +0 -23
  95. data/spec/fixtures/my_app/.app_stack.yml +0 -31
  96. data/spec/fixtures/my_app/.gitignore +0 -27
  97. data/spec/fixtures/my_app/config/self_render.conf.erb +0 -1
  98. data/spec/fixtures/sample_config.yml +0 -21
  99. data/spec/fixtures/stack_apps/module-1/.app_stack.yml +0 -17
  100. data/spec/fixtures/stack_apps/module-1/Gemfile +0 -3
  101. data/spec/fixtures/stack_apps/module-1/lib/auth_util.rb +0 -5
  102. data/spec/fixtures/stack_apps/module-1/lib/libonly1.rb +0 -6
  103. data/spec/fixtures/stack_apps/module-2/.app_stack.yml +0 -22
  104. data/spec/fixtures/stack_apps/module-2/Gemfile.erb +0 -11
  105. data/spec/fixtures/stack_apps/module-2/lib/auth_util.rb +0 -6
  106. data/spec/fixtures/stack_apps/module-2/lib/libonly2.rb +0 -6
  107. data/spec/gitignore_list_spec.rb +0 -21
  108. data/spec/load_configuration_spec.rb +0 -16
  109. data/spec/register_self_spec.rb +0 -13
  110. /data/spec/fixtures/{stack_apps/module-2 → sample_files/module_1}/Gemfile +0 -0
  111. /data/spec/fixtures/{incexc → sample_files/module_1}/Rakefile +0 -0
  112. /data/spec/fixtures/{incexc/.rspec → sample_files/module_1/config/boot_sample.rb} +0 -0
  113. /data/spec/fixtures/{incexc/Rakefile.erb → sample_files/module_1/doc/including.txt} +0 -0
@@ -0,0 +1,3 @@
1
+ export:
2
+ - lib/**/*.rb
3
+ - bin/**/*
File without changes
File without changes
@@ -0,0 +1,15 @@
1
+ stack:
2
+ - module_1:
3
+ - default
4
+ - tests
5
+ - module_2
6
+ - module_3:
7
+ - default
8
+ - config/application.yml: ''
9
+ - config/database_production.yml: config/database.yml
10
+ exclude:
11
+ - doc/excluding.txt
12
+ - Rakefile
13
+ - bin/*
14
+ attrs:
15
+ application_code: my_app
@@ -0,0 +1 @@
1
+ from my_app
@@ -0,0 +1,15 @@
1
+ stack:
2
+ - module_1:
3
+ - default
4
+ - tests
5
+ - module_2
6
+ - module_3:
7
+ - default
8
+ - config/application.yml: ''
9
+ - config/database_production.yml: config/database.yml
10
+ exclude:
11
+ - doc/excluding.txt
12
+ - Rakefile
13
+ - bin/*
14
+ attrs:
15
+ application_code: my_app
@@ -0,0 +1,43 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe AppStack::Merger do
6
+ subject (:mg) { AppStack::Merger.new('spec/fixtures/sample_files/my_app/app_stack.yml') }
7
+ describe '#parse_stacks' do
8
+ it 'get a stacked app list' do
9
+ mg.stacks[0].app_name.should eq('module_1')
10
+ end
11
+
12
+ it 'get a group of files' do
13
+ file = File.expand_path('spec/fixtures/sample_files/module_1/spec/config_spec.rb')
14
+ mg.stacks[0].copy_list[file].should eq('/spec/config_spec.rb')
15
+ end
16
+
17
+ it 'get the default files' do
18
+ file = File.expand_path('spec/fixtures/sample_files/module_2/app/lib/sequence.rb')
19
+ mg.stacks[1].copy_list[file].should eq('/app/lib/sequence.rb')
20
+ end
21
+
22
+ it 'get file with specified target name' do
23
+ file = File.expand_path('spec/fixtures/sample_files/module_3/config/database_production.yml')
24
+ mg.stacks[2].copy_list[file].should eq('config/database.yml')
25
+ end
26
+ end
27
+
28
+ describe '#prepare' do
29
+ it 'get copy list' do
30
+ mg.prepare
31
+ file = File.expand_path('spec/fixtures/sample_files/module_3/config/database_production.yml')
32
+ target = File.expand_path('spec/fixtures/sample_files/my_app/config/database.yml')
33
+ mg.copy_list[target].should eq(file)
34
+ end
35
+
36
+ it 'get render list' do
37
+ mg.prepare
38
+ file = File.expand_path('spec/fixtures/sample_files/module_2/Gemfile.liquid')
39
+ target = File.expand_path('spec/fixtures/sample_files/my_app/Gemfile')
40
+ mg.render_list[target].should eq(file)
41
+ end
42
+ end
43
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,16 +1,14 @@
1
1
  # encoding: utf-8
2
2
  require 'simplecov'
3
3
  SimpleCov.start do
4
- coverage_dir 'docs/coverage'
4
+ coverage_dir 'doc/coverage'
5
5
  end
6
6
 
7
7
  require 'rspec'
8
- require 'app_stack'
8
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
9
9
 
10
- # mixin-up, add stub-reader for testing
11
- module AppStack
12
- attr_reader :config, :app_root, :stack_dir, :files
13
- attr_accessor :verbose
14
- end
10
+ require 'app_stack'
15
11
 
16
- # file test
12
+ # reset files tructure of the my_app folder
13
+ FileUtils.rm_rf 'spec/fixtures/sample_files/my_app'
14
+ FileUtils.cp_r 'spec/fixtures/sample_files/my_app_back', 'spec/fixtures/sample_files/my_app'
data/spec/stackup_spec.rb CHANGED
@@ -1,56 +1,17 @@
1
1
  # encoding: utf-8
2
+ require 'spec_helper'
2
3
 
3
4
  describe AppStack do
4
- describe '#stackup' do
5
- before(:all) do
6
- FileUtils.cp 'spec/fixtures/.app_stack.yml', 'spec/fixtures/my_app'
7
-
8
- %w[config/self_render.conf].each do |f|
9
- FileUtils.touch('spec/fixtures/my_app/' + f)
10
- end
11
-
12
- # sleep 1
13
-
14
- FileUtils.touch('spec/fixtures/my_app/config/self_render.conf.erb')
15
- FileUtils.touch('spec/fixtures/stack_apps/module-1/Gemfile')
16
- FileUtils.touch('spec/fixtures/stack_apps/module-2/Gemfile.erb')
17
-
18
- # run the stackup script
19
- AppStack.stackup!('spec/fixtures/my_app/.app_stack.yml')
20
- AppStack.verbose = 2
21
- end
22
-
23
- it 'cp files from the chain of stacks' do
24
- c1 = File.read('spec/fixtures/my_app/lib/libonly1.rb')
25
- c2 = File.read('spec/fixtures/my_app/lib/libonly2.rb')
26
- c1.should match(/'libonlyl from module 1'/)
27
- c2.should match(/'libonly2 from module 2'/)
28
- end
29
-
30
- it 'copy the file found first' do
31
- cts = File.read('spec/fixtures/my_app/lib/auth_util.rb')
32
- cts.should match(/'auth_util from module 1'/)
33
- end
34
-
35
- it 'renders erb file from stack' do
36
- cts = File.read('spec/fixtures/my_app/Gemfile')
37
- cts.should match(/ruby\.taobao\.com/)
38
- cts.should match(/gem: 'rspec', '~> 2.0.0'/)
39
- cts.should match(/gem: 'mongoid'/)
40
- cts.should match(/gem: 'grape'/)
41
- end
42
-
43
- it 'renders erb file in app-root' do
44
- cts = File.read('spec/fixtures/my_app/config/self_render.conf')
45
- cts.should match(/self config for my_app_code/)
46
- end
47
-
48
- after(:all) do
49
- %w[config/self_render.conf Gemfile lib/auth_util.rb
50
- lib/libonly1.rb lib/libonly2.rb].each do |f|
51
- file = 'spec/fixtures/my_app/' + f
52
- FileUtils.rm(file) if File.exists?(file)
53
- end
5
+ describe '.stackup!' do
6
+ it 'copy proper files' do
7
+ AppStack.stackup!('spec/fixtures/sample_files/my_app/app_stack.yml')
8
+ File.exists?('spec/fixtures/sample_files/my_app/config/boot_sample.rb').should be_false
9
+ File.exists?('spec/fixtures/sample_files/my_app/doc/including.txt').should be_true
10
+ File.exists?('spec/fixtures/sample_files/my_app/app/lib/sequence.rb').should be_true
11
+ File.read('spec/fixtures/sample_files/my_app/Gemfile').should eq("Mod2: my_app\n")
12
+ File.read('spec/fixtures/sample_files/my_app/doc/excluding.txt').should eq("from my_app\n")
13
+ FileUtils.rm_rf 'spec/fixtures/sample_files/my_app'
14
+ FileUtils.cp_r 'spec/fixtures/sample_files/my_app_back', 'spec/fixtures/sample_files/my_app'
54
15
  end
55
16
  end
56
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-28 00:00:00.000000000 Z
12
+ date: 2013-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: tilt
@@ -98,41 +98,90 @@ extensions: []
98
98
  extra_rdoc_files: []
99
99
  files:
100
100
  - Gemfile
101
+ - Gemfile.lock
101
102
  - README.md
102
103
  - app_stack.gemspec
104
+ - doc/coverage/.last_run.json
105
+ - doc/coverage/.resultset.json
106
+ - doc/coverage/assets/0.7.1/application.css
107
+ - doc/coverage/assets/0.7.1/application.js
108
+ - doc/coverage/assets/0.7.1/fancybox/blank.gif
109
+ - doc/coverage/assets/0.7.1/fancybox/fancy_close.png
110
+ - doc/coverage/assets/0.7.1/fancybox/fancy_loading.png
111
+ - doc/coverage/assets/0.7.1/fancybox/fancy_nav_left.png
112
+ - doc/coverage/assets/0.7.1/fancybox/fancy_nav_right.png
113
+ - doc/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png
114
+ - doc/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png
115
+ - doc/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png
116
+ - doc/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png
117
+ - doc/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png
118
+ - doc/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png
119
+ - doc/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png
120
+ - doc/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png
121
+ - doc/coverage/assets/0.7.1/fancybox/fancy_title_left.png
122
+ - doc/coverage/assets/0.7.1/fancybox/fancy_title_main.png
123
+ - doc/coverage/assets/0.7.1/fancybox/fancy_title_over.png
124
+ - doc/coverage/assets/0.7.1/fancybox/fancy_title_right.png
125
+ - doc/coverage/assets/0.7.1/fancybox/fancybox-x.png
126
+ - doc/coverage/assets/0.7.1/fancybox/fancybox-y.png
127
+ - doc/coverage/assets/0.7.1/fancybox/fancybox.png
128
+ - doc/coverage/assets/0.7.1/favicon_green.png
129
+ - doc/coverage/assets/0.7.1/favicon_red.png
130
+ - doc/coverage/assets/0.7.1/favicon_yellow.png
131
+ - doc/coverage/assets/0.7.1/loading.gif
132
+ - doc/coverage/assets/0.7.1/magnify.png
133
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
134
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
135
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
136
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
137
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png
138
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
139
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
140
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
141
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png
142
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png
143
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png
144
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png
145
+ - doc/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png
146
+ - doc/coverage/index.html
103
147
  - lib/app_stack.rb
148
+ - lib/app_stack/config.rb
149
+ - lib/app_stack/merger.rb
104
150
  - lib/app_stack/version.rb
105
- - spec/app_as_hash_spec.rb
106
- - spec/export_list_spec.rb
107
- - spec/fixtures/.app_stack.yml
108
- - spec/fixtures/app-sample.yml
109
- - spec/fixtures/incexc-config.yml
110
- - spec/fixtures/incexc/.gitignore
111
- - spec/fixtures/incexc/.rspec
112
- - spec/fixtures/incexc/Rakefile
113
- - spec/fixtures/incexc/Rakefile.erb
114
- - spec/fixtures/incexc/incexc-config.yml
115
- - spec/fixtures/incexc/lib/anyway.rb
116
- - spec/fixtures/incexc/lib/extra/excludes.rb
117
- - spec/fixtures/incexc/lib/mixin/otherlib.rb
118
- - spec/fixtures/incexc/spec/spec_helper.rb
119
- - spec/fixtures/incexc/spec/support/api_test.rb
120
- - spec/fixtures/my_app/.app_stack.yml
121
- - spec/fixtures/my_app/.gitignore
122
- - spec/fixtures/my_app/config/self_render.conf.erb
123
- - spec/fixtures/sample_config.yml
124
- - spec/fixtures/stack_apps/module-1/.app_stack.yml
125
- - spec/fixtures/stack_apps/module-1/Gemfile
126
- - spec/fixtures/stack_apps/module-1/lib/auth_util.rb
127
- - spec/fixtures/stack_apps/module-1/lib/libonly1.rb
128
- - spec/fixtures/stack_apps/module-2/.app_stack.yml
129
- - spec/fixtures/stack_apps/module-2/Gemfile
130
- - spec/fixtures/stack_apps/module-2/Gemfile.erb
131
- - spec/fixtures/stack_apps/module-2/lib/auth_util.rb
132
- - spec/fixtures/stack_apps/module-2/lib/libonly2.rb
133
- - spec/gitignore_list_spec.rb
134
- - spec/load_configuration_spec.rb
135
- - spec/register_self_spec.rb
151
+ - spec/config_spec.rb
152
+ - spec/fixtures/config_sample/sample.yml
153
+ - spec/fixtures/config_sample/wrong_key.yml
154
+ - spec/fixtures/config_sample/wrong_type.yml
155
+ - spec/fixtures/sample_files/module_1/Gemfile
156
+ - spec/fixtures/sample_files/module_1/Gemfile.erb
157
+ - spec/fixtures/sample_files/module_1/Rakefile
158
+ - spec/fixtures/sample_files/module_1/app_stack.yml
159
+ - spec/fixtures/sample_files/module_1/config/boot_sample.rb
160
+ - spec/fixtures/sample_files/module_1/doc/excluding.txt
161
+ - spec/fixtures/sample_files/module_1/doc/including.txt
162
+ - spec/fixtures/sample_files/module_1/lib/mixins/b_lib.rb
163
+ - spec/fixtures/sample_files/module_1/lib/mixins/s_lib.rb
164
+ - spec/fixtures/sample_files/module_1/lib/samples/a_lib.rb
165
+ - spec/fixtures/sample_files/module_1/spec/config_spec.rb
166
+ - spec/fixtures/sample_files/module_2/Gemfile
167
+ - spec/fixtures/sample_files/module_2/Gemfile.liquid
168
+ - spec/fixtures/sample_files/module_2/app/lib/sequence.rb
169
+ - spec/fixtures/sample_files/module_2/app_stack.yml
170
+ - spec/fixtures/sample_files/module_3/app_stack.yml
171
+ - spec/fixtures/sample_files/module_3/bin/del
172
+ - spec/fixtures/sample_files/module_3/bin/rm
173
+ - spec/fixtures/sample_files/module_3/config/application.yml
174
+ - spec/fixtures/sample_files/module_3/config/database_development.yml
175
+ - spec/fixtures/sample_files/module_3/config/database_production.yml
176
+ - spec/fixtures/sample_files/module_3/lib/libfile_1.rb
177
+ - spec/fixtures/sample_files/module_3/lib/libfile_2.rb
178
+ - spec/fixtures/sample_files/my_app/app_stack.yml
179
+ - spec/fixtures/sample_files/my_app/doc/excluding.txt
180
+ - spec/fixtures/sample_files/my_app/spec/config_spec.rb
181
+ - spec/fixtures/sample_files/my_app_back/app_stack.yml
182
+ - spec/fixtures/sample_files/my_app_back/doc/excluding.txt
183
+ - spec/fixtures/sample_files/my_app_back/spec/config_spec.rb
184
+ - spec/merger_spec.rb
136
185
  - spec/spec_helper.rb
137
186
  - spec/stackup_spec.rb
138
187
  homepage: https://github.com/7lime/app_stack-gem
@@ -162,19 +211,17 @@ specification_version: 3
162
211
  summary: Use as a rake task, define a stack of modules and app-stack will merge files
163
212
  from those stack-apps to the local application directory.
164
213
  test_files:
165
- - spec/app_as_hash_spec.rb
166
- - spec/export_list_spec.rb
167
- - spec/fixtures/incexc/lib/anyway.rb
168
- - spec/fixtures/incexc/lib/extra/excludes.rb
169
- - spec/fixtures/incexc/lib/mixin/otherlib.rb
170
- - spec/fixtures/incexc/spec/spec_helper.rb
171
- - spec/fixtures/incexc/spec/support/api_test.rb
172
- - spec/fixtures/stack_apps/module-1/lib/auth_util.rb
173
- - spec/fixtures/stack_apps/module-1/lib/libonly1.rb
174
- - spec/fixtures/stack_apps/module-2/lib/auth_util.rb
175
- - spec/fixtures/stack_apps/module-2/lib/libonly2.rb
176
- - spec/gitignore_list_spec.rb
177
- - spec/load_configuration_spec.rb
178
- - spec/register_self_spec.rb
214
+ - spec/config_spec.rb
215
+ - spec/fixtures/sample_files/module_1/config/boot_sample.rb
216
+ - spec/fixtures/sample_files/module_1/lib/mixins/b_lib.rb
217
+ - spec/fixtures/sample_files/module_1/lib/mixins/s_lib.rb
218
+ - spec/fixtures/sample_files/module_1/lib/samples/a_lib.rb
219
+ - spec/fixtures/sample_files/module_1/spec/config_spec.rb
220
+ - spec/fixtures/sample_files/module_2/app/lib/sequence.rb
221
+ - spec/fixtures/sample_files/module_3/lib/libfile_1.rb
222
+ - spec/fixtures/sample_files/module_3/lib/libfile_2.rb
223
+ - spec/fixtures/sample_files/my_app/spec/config_spec.rb
224
+ - spec/fixtures/sample_files/my_app_back/spec/config_spec.rb
225
+ - spec/merger_spec.rb
179
226
  - spec/spec_helper.rb
180
227
  - spec/stackup_spec.rb
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module AppStack
4
- def config
5
- @config
6
- end
7
- end
8
-
9
- describe AppStack do
10
- it 'load a app as a hash' do
11
- AppStack.load_configuration('spec/fixtures/app-sample.yml')
12
- AppStack.config['stack'][0].is_a?(Hash).should be_true
13
- # AppStack.stackup!('spec/fixtures/app-sample.yml')
14
- end
15
- end
@@ -1,66 +0,0 @@
1
- # encoding: utf-8
2
- require 'spec_helper'
3
- require 'fileutils'
4
-
5
- describe AppStack do
6
- describe '#newer?' do
7
- it 'true for newer file' do
8
- FileUtils.touch('.rspec_new')
9
- AppStack.newer?('.rspec_new', '.rspec').should be_true
10
- FileUtils.rm('.rspec_new')
11
- end
12
-
13
- it 'handles non exits file well' do
14
- AppStack.newer?('.rspec', '.rspec_non').should be_true
15
- AppStack.newer?('.no_rspec', '.rspec').should be_false
16
- end
17
- end
18
-
19
- describe '#export_list' do
20
- subject :el do
21
- AppStack.load_configuration('spec/fixtures/incexc-config.yml')
22
- AppStack.export_list('spec/fixtures/incexc')
23
- end
24
-
25
- it 'contains exported files' do
26
- el.include?('lib/anyway.rb').should be_true
27
- el.include?('lib/mixin/otherlib.rb').should be_true
28
- end
29
-
30
- it 'excludes gitignore files' do
31
- el.include?('lib/mixin/otherlist.rb.bak').should be_false
32
- end
33
-
34
- it 'excludes explicitly excluded files' do
35
- el.include?('lib/extra/excludes.rb').should be_false
36
- end
37
-
38
- # depreciated
39
- # it 'include explicitly included files' do
40
- # el.include?('spec/spec_helper.rb').should be_true
41
- # el.include?('spec/support/api_test.rb').should be_true
42
- # end
43
-
44
- it 'can include grouped files' do
45
- el.include?('spec/support/api_test.rb').should be_false
46
- elist = AppStack.export_list('spec/fixtures/incexc', ['default', 'test'])
47
- elist.include?('spec/support/api_test.rb').should be_true
48
- elist.include?('spec/spec_helper.rb').should be_true
49
- end
50
-
51
- it 'can set to include all files' do
52
- elist = AppStack.export_list('spec/fixtures/incexc', ['all'])
53
- elist.include?('spec/support/api_test.rb').should be_true
54
- elist.include?('spec/spec_helper.rb').should be_true
55
- elist.include?('lib/mixin/otherlib.rb').should be_true
56
- end
57
- end
58
-
59
- describe '#merge_stacks!' do
60
- it 'raise for non existing directory' do
61
- AppStack.load_configuration('spec/fixtures/sample_config.yml')
62
- stacks = AppStack.config['stack']
63
- expect { AppStack.merge_stacks!(stacks) }.to raise_error
64
- end
65
- end
66
- end
@@ -1,21 +0,0 @@
1
- ---
2
- stack:
3
- - module-1
4
- - module-2
5
- export:
6
- - lib/**/*.rb
7
- - config/**/*
8
- - app/**/*.rb
9
- exclude:
10
- - lib/extra/*.rb
11
- attrs:
12
- application_name: My App Name
13
- application_code: my_app_code
14
- database_password: the very secret
15
- gems:
16
- default:
17
- rspec: ~> 2.0.0
18
- mongoid: ''
19
- development:
20
- app_stack: ~> 0.0.8
21
- files:
@@ -1,25 +0,0 @@
1
- stack:
2
- - incexc: [all]
3
- stack_dir: '.'
4
- tpl_ext: '.erb'
5
- verbose: 1
6
- export:
7
- - lib/**/*.rb
8
- - app/**/*.rb
9
- - test:
10
- - spec/**/*
11
- exclude:
12
- - lib/extra/*.rb
13
- attrs:
14
- application_name: App Name
15
- application_code: app_code
16
- database_password: the very secret
17
- gems:
18
- default:
19
- - rspec: '~> 2.0.0'
20
- - mongoid: ''
21
- development:
22
- files:
23
- README.md: '__self'
24
-
25
-
@@ -1,27 +0,0 @@
1
- .DS_Store
2
- .bundle
3
- logs/*.log
4
- logs/**/*.log
5
- log/*.log
6
- log/**/*.log
7
- tmp/**/*
8
- vendor/gems/*
9
- !vendor/gems/cache/
10
- .sass-cache/*
11
- public/assets/*
12
- *.bak
13
- tmp/*
14
- *.swp
15
- *~
16
- ~*
17
- Thumbs.db
18
- */Thumbs.db
19
- .idea/*
20
- db/*.db
21
- db/*.sqlite*
22
- .yardoc/*
23
- .yardoc/**/*
24
- docs/*
25
- docs/**/*
26
- .dev_flow
27
- *.gem
@@ -1,24 +0,0 @@
1
- stack: [incexc]
2
- stack_dir: '.'
3
- tpl_ext: '.erb'
4
- verbose: 1
5
- export:
6
- - lib/**/*.rb
7
- - app/**/*.rb
8
- - test:
9
- - spec/**/*
10
- exclude:
11
- - lib/extra/*.rb
12
- attrs:
13
- application_name: App Name
14
- application_code: app_code
15
- database_password: the very secret
16
- gems:
17
- default:
18
- - rspec: '~> 2.0.0'
19
- - mongoid: ''
20
- development:
21
- files:
22
- README.md: '__self'
23
-
24
-
@@ -1 +0,0 @@
1
- # encoding: utf-8
@@ -1 +0,0 @@
1
- # encoding: utf-8
@@ -1 +0,0 @@
1
- # encoding: utf-8
@@ -1 +0,0 @@
1
- # encoding: utf-8
@@ -1 +0,0 @@
1
- # encoding: utf-8
@@ -1,23 +0,0 @@
1
- stack: [incexc]
2
- stack_dir: '.'
3
- tpl_ext: '.erb'
4
- verbose: 1
5
- export:
6
- - lib/**/*.rb
7
- - Rakefile
8
- - Rakefile.erb
9
- exclude:
10
- - lib/extra/*.rb
11
- attrs:
12
- application_name: App Name
13
- application_code: app_code
14
- database_password: the very secret
15
- gems:
16
- default:
17
- - rspec: '~> 2.0.0'
18
- - mongoid: ''
19
- development:
20
- files:
21
- README.md: '__self'
22
-
23
-
@@ -1,31 +0,0 @@
1
- ---
2
- stack:
3
- - module-1
4
- - module-2
5
- export:
6
- - lib/**/*.rb
7
- - config/**/*
8
- - app/**/*.rb
9
- exclude:
10
- - lib/extra/*.rb
11
- attrs:
12
- application_name: My App Name
13
- application_code: my_app_code
14
- database_password: the very secret
15
- gems:
16
- default:
17
- rspec: ~> 2.0.0
18
- mongoid: ''
19
- development:
20
- app_stack: ~> 0.0.8
21
- files:
22
- .app_stack.yml: __self
23
- .gitignore: __self
24
- config: __self
25
- config/self_render.conf: __self
26
- config/self_render.conf.erb: __self
27
- lib: __self
28
- lib/auth_util.rb: module-2
29
- lib/libonly1.rb: module-1
30
- lib/libonly2.rb: module-2
31
- Gemfile: module-2