warbler 1.3.8 → 1.4.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +1 -1
- data/History.txt +14 -0
- data/README.rdoc +13 -0
- data/ext/WarMain.java +34 -17
- data/ext/WarblerJar.java +3 -2
- data/integration/gem-initializer/pom.xml +39 -0
- data/integration/pom.xml +134 -0
- data/integration/rails4_test/pom.xml +57 -0
- data/integration/rails4_test/src/main/ruby/Gemfile +44 -0
- data/integration/rails4_test/src/main/ruby/README.rdoc +28 -0
- data/integration/rails4_test/src/main/ruby/Rakefile +6 -0
- data/integration/rails4_test/src/main/ruby/app/assets/javascripts/application.js +16 -0
- data/integration/rails4_test/src/main/ruby/app/assets/javascripts/posts.js.coffee +3 -0
- data/integration/rails4_test/src/main/ruby/app/assets/stylesheets/application.css +13 -0
- data/integration/rails4_test/src/main/ruby/app/assets/stylesheets/posts.css.scss +3 -0
- data/integration/rails4_test/src/main/ruby/app/assets/stylesheets/scaffolds.css.scss +69 -0
- data/integration/rails4_test/src/main/ruby/app/controllers/application_controller.rb +5 -0
- data/integration/rails4_test/src/main/ruby/app/controllers/concerns/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/app/controllers/posts_controller.rb +74 -0
- data/integration/rails4_test/src/main/ruby/app/helpers/application_helper.rb +2 -0
- data/integration/rails4_test/src/main/ruby/app/helpers/posts_helper.rb +2 -0
- data/integration/rails4_test/src/main/ruby/app/mailers/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/app/models/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/app/models/concerns/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/app/models/post.rb +2 -0
- data/integration/rails4_test/src/main/ruby/app/views/layouts/application.html.erb +14 -0
- data/integration/rails4_test/src/main/ruby/app/views/posts/_form.html.erb +29 -0
- data/integration/rails4_test/src/main/ruby/app/views/posts/edit.html.erb +6 -0
- data/integration/rails4_test/src/main/ruby/app/views/posts/index.html.erb +31 -0
- data/integration/rails4_test/src/main/ruby/app/views/posts/index.json.jbuilder +4 -0
- data/integration/rails4_test/src/main/ruby/app/views/posts/new.html.erb +5 -0
- data/integration/rails4_test/src/main/ruby/app/views/posts/show.html.erb +19 -0
- data/integration/rails4_test/src/main/ruby/app/views/posts/show.json.jbuilder +1 -0
- data/integration/rails4_test/src/main/ruby/config.ru +4 -0
- data/integration/rails4_test/src/main/ruby/config/application.rb +23 -0
- data/integration/rails4_test/src/main/ruby/config/boot.rb +4 -0
- data/integration/rails4_test/src/main/ruby/config/database.yml +20 -0
- data/integration/rails4_test/src/main/ruby/config/environment.rb +5 -0
- data/integration/rails4_test/src/main/ruby/config/environments/development.rb +29 -0
- data/integration/rails4_test/src/main/ruby/config/environments/production.rb +80 -0
- data/integration/rails4_test/src/main/ruby/config/environments/test.rb +36 -0
- data/integration/rails4_test/src/main/ruby/config/initializers/backtrace_silencers.rb +7 -0
- data/integration/rails4_test/src/main/ruby/config/initializers/filter_parameter_logging.rb +4 -0
- data/integration/rails4_test/src/main/ruby/config/initializers/inflections.rb +16 -0
- data/integration/rails4_test/src/main/ruby/config/initializers/mime_types.rb +5 -0
- data/integration/rails4_test/src/main/ruby/config/initializers/secret_token.rb +12 -0
- data/integration/rails4_test/src/main/ruby/config/initializers/session_store.rb +3 -0
- data/integration/rails4_test/src/main/ruby/config/initializers/wrap_parameters.rb +14 -0
- data/integration/rails4_test/src/main/ruby/config/locales/en.yml +23 -0
- data/integration/rails4_test/src/main/ruby/config/routes.rb +51 -0
- data/integration/rails4_test/src/main/ruby/config/warble.rb +4 -0
- data/integration/rails4_test/src/main/ruby/db/development.sqlite3 +0 -0
- data/integration/rails4_test/src/main/ruby/db/migrate/20130502003552_create_posts.rb +11 -0
- data/integration/rails4_test/src/main/ruby/db/production.sqlite3 +0 -0
- data/integration/rails4_test/src/main/ruby/db/schema.rb +24 -0
- data/integration/rails4_test/src/main/ruby/db/seeds.rb +7 -0
- data/integration/rails4_test/src/main/ruby/lib/assets/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/lib/tasks/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/public/404.html +58 -0
- data/integration/rails4_test/src/main/ruby/public/422.html +58 -0
- data/integration/rails4_test/src/main/ruby/public/500.html +57 -0
- data/integration/rails4_test/src/main/ruby/public/favicon.ico +0 -0
- data/integration/rails4_test/src/main/ruby/public/robots.txt +5 -0
- data/integration/rails4_test/src/main/ruby/test/controllers/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/test/controllers/posts_controller_test.rb +49 -0
- data/integration/rails4_test/src/main/ruby/test/fixtures/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/test/fixtures/posts.yml +11 -0
- data/integration/rails4_test/src/main/ruby/test/helpers/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/test/helpers/posts_helper_test.rb +4 -0
- data/integration/rails4_test/src/main/ruby/test/integration/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/test/mailers/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/test/models/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/test/models/post_test.rb +7 -0
- data/integration/rails4_test/src/main/ruby/test/test_helper.rb +15 -0
- data/integration/rails4_test/src/main/ruby/vendor/assets/javascripts/.keep +0 -0
- data/integration/rails4_test/src/main/ruby/vendor/assets/stylesheets/.keep +0 -0
- data/integration/rails4_test/src/test/java/org/jruby/warbler/Rails4AppTestIT.java +37 -0
- data/integration/runnable_test/pom.xml +105 -0
- data/integration/runnable_test/src/main/ruby/Rakefile +4 -0
- data/integration/runnable_test/src/main/ruby/config.ru +1 -0
- data/integration/runnable_test/src/main/ruby/config/warble.rb +9 -0
- data/integration/runnable_test/src/test/java/org/jruby/warbler/RunnableWarTestIT.java +22 -0
- data/integration/simple_rack_test/pom.xml +56 -0
- data/integration/simple_rack_test/src/main/ruby/config.ru +1 -0
- data/integration/simple_rack_test/src/main/ruby/config/warble.rb +4 -0
- data/integration/simple_rack_test/src/test/java/org/jruby/warbler/AppTestIT.java +36 -0
- data/lib/warbler.rb +2 -1
- data/lib/warbler/application.rb +5 -1
- data/lib/warbler/config.rb +15 -2
- data/lib/warbler/executable_helper.rb +25 -0
- data/lib/warbler/gems.rb +39 -0
- data/lib/warbler/jar.rb +11 -25
- data/lib/warbler/scripts/rails.rb +11 -0
- data/lib/warbler/templates/war.erb +10 -2
- data/lib/warbler/traits.rb +5 -2
- data/lib/warbler/traits/gemspec.rb +13 -4
- data/lib/warbler/traits/nogemspec.rb +2 -1
- data/lib/warbler/traits/rails.rb +25 -7
- data/lib/warbler/version.rb +1 -1
- data/lib/warbler_jar.jar +0 -0
- data/spec/sample_jar/bin/another_jar +5 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/warbler/bundler_spec.rb +18 -33
- data/spec/warbler/config_spec.rb +2 -2
- data/spec/warbler/jar_spec.rb +176 -40
- data/warble.rb +9 -2
- data/warbler.gemspec +2 -2
- metadata +175 -9
data/spec/warbler/config_spec.rb
CHANGED
@@ -19,7 +19,7 @@ describe Warbler::Config do
|
|
19
19
|
config = Warbler::Config.new
|
20
20
|
config.includes.should be_empty
|
21
21
|
config.jar_name.size.should > 0
|
22
|
-
config.override_gem_home.should
|
22
|
+
config.override_gem_home.should be_true
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -39,7 +39,7 @@ describe Warbler::Config do
|
|
39
39
|
config.webxml.should be_kind_of(OpenStruct)
|
40
40
|
config.pathmaps.should be_kind_of(OpenStruct)
|
41
41
|
config.pathmaps.public_html.should == ["%{public/,}p"]
|
42
|
-
config.override_gem_home.should
|
42
|
+
config.override_gem_home.should be_true
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should allow configuration through an initializer block" do
|
data/spec/warbler/jar_spec.rb
CHANGED
@@ -52,20 +52,20 @@ describe Warbler::Jar do
|
|
52
52
|
it "requires 'rubygems' in init.rb" do
|
53
53
|
jar.add_init_file(config)
|
54
54
|
contents = jar.contents('META-INF/init.rb')
|
55
|
-
contents.
|
55
|
+
contents.should =~ /require 'rubygems'/
|
56
56
|
end
|
57
57
|
|
58
58
|
it "does not override ENV['GEM_HOME'] by default" do
|
59
59
|
jar.add_init_file(config)
|
60
60
|
contents = jar.contents('META-INF/init.rb')
|
61
|
-
contents.should
|
61
|
+
contents.should include("ENV['GEM_HOME'] =")
|
62
62
|
end
|
63
63
|
|
64
64
|
it "overrides ENV['GEM_HOME'] when override_gem_home is set" do
|
65
|
-
config.override_gem_home =
|
65
|
+
config.override_gem_home = false
|
66
66
|
jar.add_init_file(config)
|
67
67
|
contents = jar.contents('META-INF/init.rb')
|
68
|
-
contents.should
|
68
|
+
contents.should include("ENV['GEM_HOME'] ||=")
|
69
69
|
end
|
70
70
|
|
71
71
|
it "adds a main.rb" do
|
@@ -73,6 +73,12 @@ describe Warbler::Jar do
|
|
73
73
|
file_list(%r{^META-INF/main.rb$}).should_not be_empty
|
74
74
|
end
|
75
75
|
|
76
|
+
it "adds script_files" do
|
77
|
+
config.script_files << __FILE__
|
78
|
+
jar.apply(config)
|
79
|
+
file_list(%r{^META-INF/#{File.basename(__FILE__)}$}).should_not be_empty
|
80
|
+
end
|
81
|
+
|
76
82
|
it "accepts a custom manifest file" do
|
77
83
|
touch 'manifest'
|
78
84
|
use_config do |config|
|
@@ -99,11 +105,11 @@ describe Warbler::Jar do
|
|
99
105
|
touch "foo.txt"
|
100
106
|
mkdir 'bar'
|
101
107
|
touch "bar/bar.txt"
|
102
|
-
|
108
|
+
|
103
109
|
use_config do |config|
|
104
110
|
config.jar_name = 'sample'
|
105
111
|
end
|
106
|
-
|
112
|
+
|
107
113
|
jar.files["foo.txt".freeze] = "foo.txt"
|
108
114
|
jar.files["bar".freeze] = "bar" # @see #76 on MRI
|
109
115
|
jar.files["bar/bar.txt"] = "bar/bar.txt".freeze
|
@@ -115,7 +121,7 @@ describe Warbler::Jar do
|
|
115
121
|
rmdir 'bar'
|
116
122
|
end
|
117
123
|
end
|
118
|
-
|
124
|
+
|
119
125
|
context "with a .gemspec" do
|
120
126
|
it "detects a Gemspec trait" do
|
121
127
|
config.traits.should include(Warbler::Traits::Gemspec)
|
@@ -130,13 +136,13 @@ describe Warbler::Jar do
|
|
130
136
|
it "sets load paths in init.rb" do
|
131
137
|
jar.add_init_file(config)
|
132
138
|
contents = jar.contents('META-INF/init.rb')
|
133
|
-
contents.
|
139
|
+
contents.should =~ /LOAD_PATH\.unshift.*sample_jar\/lib/
|
134
140
|
end
|
135
141
|
|
136
142
|
it "loads the default executable in main.rb" do
|
137
143
|
jar.apply(config)
|
138
144
|
contents = jar.contents('META-INF/main.rb')
|
139
|
-
contents.
|
145
|
+
contents.should =~ /load.*sample_jar\/bin\/sample_jar/
|
140
146
|
end
|
141
147
|
|
142
148
|
it "includes compiled .rb and .class files" do
|
@@ -146,6 +152,14 @@ describe Warbler::Jar do
|
|
146
152
|
file_list(%r{^sample_jar/lib/sample_jar\.class$}).should_not be_empty
|
147
153
|
jar.contents('sample_jar/lib/sample_jar.rb').should =~ /load __FILE__\.sub/
|
148
154
|
end
|
155
|
+
|
156
|
+
it "includes only specified dirs" do
|
157
|
+
config.dirs = %w(bin)
|
158
|
+
jar.compile(config)
|
159
|
+
jar.apply(config)
|
160
|
+
file_list(%r{^sample_jar/lib$}).should be_empty
|
161
|
+
file_list(%r{^sample_jar/bin$}).should_not be_empty
|
162
|
+
end
|
149
163
|
end
|
150
164
|
|
151
165
|
context "with a gemspec without a default executable" do
|
@@ -169,7 +183,16 @@ describe Warbler::Jar do
|
|
169
183
|
it "loads the first bin/executable in main.rb" do
|
170
184
|
silence { jar.apply(config) }
|
171
185
|
contents = jar.contents('META-INF/main.rb')
|
172
|
-
contents.
|
186
|
+
contents.should =~ /load.*sample_jar\/bin\/another_jar/
|
187
|
+
end
|
188
|
+
|
189
|
+
it "loads the specified bin/executable in main.rb" do
|
190
|
+
use_config do |config|
|
191
|
+
config.executable = 'bin/sample_jar'
|
192
|
+
end
|
193
|
+
silence { jar.apply(config) }
|
194
|
+
contents = jar.contents('META-INF/main.rb')
|
195
|
+
contents.should =~ /load.*sample_jar\/bin\/sample_jar/
|
173
196
|
end
|
174
197
|
end
|
175
198
|
|
@@ -207,14 +230,49 @@ describe Warbler::Jar do
|
|
207
230
|
it "sets load paths in init.rb" do
|
208
231
|
jar.add_init_file(config)
|
209
232
|
contents = jar.contents('META-INF/init.rb')
|
210
|
-
contents.
|
233
|
+
contents.should =~ /LOAD_PATH\.unshift.*sample_jar\/lib/
|
211
234
|
end
|
212
235
|
|
213
236
|
it "loads the first bin/executable in main.rb" do
|
214
237
|
jar.apply(config)
|
215
238
|
contents = jar.contents('META-INF/main.rb')
|
216
|
-
contents.
|
239
|
+
contents.should =~ /load.*sample_jar\/bin\/sample_jar/
|
240
|
+
end
|
241
|
+
|
242
|
+
it "loads the specified bin/executable in main.rb" do
|
243
|
+
use_config do |config|
|
244
|
+
config.executable = 'bin/sample_jar_extra'
|
245
|
+
end
|
246
|
+
jar.apply(config)
|
247
|
+
contents = jar.contents('META-INF/main.rb')
|
248
|
+
contents.should =~ /load.*sample_jar\/bin\/sample_jar_extra/
|
249
|
+
end
|
250
|
+
|
251
|
+
it "loads the bin/executable from other gem in main.rb" do
|
252
|
+
use_config do |config|
|
253
|
+
config.gems = [ "rake" ]
|
254
|
+
config.executable = ['rake', 'bin/rake']
|
255
|
+
end
|
256
|
+
jar.apply(config)
|
257
|
+
contents = jar.contents('META-INF/main.rb')
|
258
|
+
contents.should =~ /load.*gems\/rake.*\/bin\/rake/
|
259
|
+
end
|
260
|
+
|
261
|
+
it "does not set parameters in main.rb" do
|
262
|
+
jar.apply(config)
|
263
|
+
contents = jar.contents('META-INF/main.rb')
|
264
|
+
contents.should_not =~ /ARGV.*/m
|
265
|
+
end
|
266
|
+
|
267
|
+
it "does set parameters in main.rb" do
|
268
|
+
use_config do |config|
|
269
|
+
config.executable_params = 'do_something'
|
270
|
+
end
|
271
|
+
jar.apply(config)
|
272
|
+
contents = jar.contents('META-INF/main.rb')
|
273
|
+
contents.should =~ /ARGV\.unshift.*do_something/m
|
217
274
|
end
|
275
|
+
|
218
276
|
end
|
219
277
|
end
|
220
278
|
|
@@ -245,13 +303,40 @@ describe Warbler::Jar do
|
|
245
303
|
file_list(%r{WEB-INF/gems/specifications/rake.*\.gemspec}).should_not be_empty
|
246
304
|
end
|
247
305
|
|
306
|
+
it "collects gem files with dependencies" do
|
307
|
+
use_config do |config|
|
308
|
+
config.gems << "rdoc"
|
309
|
+
config.gem_dependencies = true
|
310
|
+
end
|
311
|
+
jar.apply(config)
|
312
|
+
file_list(%r{WEB-INF/gems/gems/json.*/lib/json.rb}).should_not be_empty
|
313
|
+
file_list(%r{WEB-INF/gems/specifications/json.*\.gemspec}).should_not be_empty
|
314
|
+
end
|
315
|
+
|
316
|
+
it "collects gem files without dependencies" do
|
317
|
+
use_config do |config|
|
318
|
+
config.gems << "rdoc"
|
319
|
+
config.gem_dependencies = false
|
320
|
+
end
|
321
|
+
jar.apply(config)
|
322
|
+
file_list(%r{WEB-INF/gems/gems/json.*/lib/json.rb}).should be_empty
|
323
|
+
file_list(%r{WEB-INF/gems/specifications/json.*\.gemspec}).should be_empty
|
324
|
+
end
|
325
|
+
|
248
326
|
it "adds ENV['GEM_HOME'] to init.rb" do
|
249
327
|
jar.add_init_file(config)
|
250
328
|
contents = jar.contents('META-INF/init.rb')
|
251
|
-
contents.should
|
329
|
+
contents.should include("ENV['GEM_HOME'] =")
|
252
330
|
contents.should =~ /WEB-INF\/gems/
|
253
331
|
end
|
254
332
|
|
333
|
+
it "overrides ENV['GEM_HOME'] when override_gem_home is set" do
|
334
|
+
config.override_gem_home = true
|
335
|
+
jar.add_init_file(config)
|
336
|
+
contents = jar.contents('META-INF/init.rb')
|
337
|
+
contents.should include("ENV['GEM_HOME'] =")
|
338
|
+
end
|
339
|
+
|
255
340
|
it "does not include log files by default" do
|
256
341
|
jar.apply(config)
|
257
342
|
file_list(%r{WEB-INF/log}).should_not be_empty
|
@@ -422,13 +507,13 @@ describe Warbler::Jar do
|
|
422
507
|
end
|
423
508
|
|
424
509
|
it "allows specification of dependency by Gem::Dependency" do
|
425
|
-
spec =
|
426
|
-
spec.stub
|
427
|
-
spec.stub
|
428
|
-
spec.stub
|
429
|
-
spec.stub
|
430
|
-
spec.stub
|
431
|
-
spec.stub
|
510
|
+
spec = double "gem spec"
|
511
|
+
spec.stub(:name).and_return "hpricot"
|
512
|
+
spec.stub(:full_name).and_return "hpricot-0.6.157"
|
513
|
+
spec.stub(:full_gem_path).and_return "hpricot-0.6.157"
|
514
|
+
spec.stub(:loaded_from).and_return "hpricot.gemspec"
|
515
|
+
spec.stub(:files).and_return ["Rakefile"]
|
516
|
+
spec.stub(:dependencies).and_return []
|
432
517
|
dep = Gem::Dependency.new("hpricot", "> 0.6")
|
433
518
|
dep.should_receive(:to_spec).and_return spec
|
434
519
|
use_config do |config|
|
@@ -494,7 +579,7 @@ describe Warbler::Jar do
|
|
494
579
|
end
|
495
580
|
|
496
581
|
context "with the runnable feature" do
|
497
|
-
|
582
|
+
|
498
583
|
it "adds WarMain (and JarMain) class" do
|
499
584
|
use_config do |config|
|
500
585
|
config.features << "runnable"
|
@@ -503,9 +588,9 @@ describe Warbler::Jar do
|
|
503
588
|
file_list(%r{^WarMain\.class$}).should_not be_empty
|
504
589
|
file_list(%r{^JarMain\.class$}).should_not be_empty
|
505
590
|
end
|
506
|
-
|
591
|
+
|
507
592
|
end
|
508
|
-
|
593
|
+
|
509
594
|
context "in a Rails application" do
|
510
595
|
before :each do
|
511
596
|
@rails = nil
|
@@ -532,6 +617,10 @@ describe Warbler::Jar do
|
|
532
617
|
config.gems["rails"].should == "2.1.0"
|
533
618
|
end
|
534
619
|
|
620
|
+
it "adds the rails.rb to the script files" do
|
621
|
+
config.script_files.first.should =~ %r{lib/warbler/scripts/rails.rb$}
|
622
|
+
end
|
623
|
+
|
535
624
|
it "provides Rails gems by default, unless vendor/rails is present" do
|
536
625
|
config.gems.should have_key("rails")
|
537
626
|
|
@@ -540,35 +629,26 @@ describe Warbler::Jar do
|
|
540
629
|
config.gems.should be_empty
|
541
630
|
|
542
631
|
rm_rf "vendor/rails"
|
543
|
-
@rails.stub
|
632
|
+
@rails.stub(:vendor_rails?).and_return true
|
544
633
|
config = Warbler::Config.new
|
545
634
|
config.gems.should be_empty
|
546
635
|
end
|
547
636
|
|
548
637
|
it "automatically adds Rails.configuration.gems to the list of gems" do
|
549
638
|
task :environment do
|
550
|
-
config =
|
551
|
-
@rails.stub
|
552
|
-
gem =
|
553
|
-
gem.stub
|
554
|
-
gem.stub
|
555
|
-
config.stub
|
639
|
+
config = double "config"
|
640
|
+
@rails.stub(:configuration).and_return(config)
|
641
|
+
gem = double "gem"
|
642
|
+
gem.stub(:name).and_return "hpricot"
|
643
|
+
gem.stub(:requirement).and_return Gem::Requirement.new("=0.6")
|
644
|
+
config.stub(:gems).and_return [gem]
|
556
645
|
end
|
557
646
|
|
558
647
|
config.webxml.booter.should == :rails
|
559
648
|
config.gems.keys.should include(Gem::Dependency.new("hpricot", Gem::Requirement.new("=0.6")))
|
560
649
|
end
|
561
650
|
|
562
|
-
|
563
|
-
before :each do
|
564
|
-
cp "config/environments/production.rb", "config/environments/production.rb.orig"
|
565
|
-
File.open("config/environments/production.rb", "a") {|f| f.puts "", "config.threadsafe!" }
|
566
|
-
end
|
567
|
-
|
568
|
-
after :each do
|
569
|
-
mv "config/environments/production.rb.orig", "config/environments/production.rb"
|
570
|
-
end
|
571
|
-
|
651
|
+
shared_examples_for "threaded environment" do
|
572
652
|
it "sets the jruby min and max runtimes to 1" do
|
573
653
|
ENV["RAILS_ENV"] = nil
|
574
654
|
config.webxml.booter.should == :rails
|
@@ -586,6 +666,62 @@ describe Warbler::Jar do
|
|
586
666
|
end
|
587
667
|
end
|
588
668
|
|
669
|
+
context "with threadsafe! enabled in production.rb" do
|
670
|
+
before :each do
|
671
|
+
cp "config/environments/production.rb", "config/environments/production.rb.orig"
|
672
|
+
File.open("config/environments/production.rb", "a") { |f| f.puts "", "config.threadsafe!" }
|
673
|
+
end
|
674
|
+
|
675
|
+
after :each do
|
676
|
+
mv "config/environments/production.rb.orig", "config/environments/production.rb"
|
677
|
+
end
|
678
|
+
|
679
|
+
it_should_behave_like "threaded environment"
|
680
|
+
end
|
681
|
+
|
682
|
+
context "with threadsafe! enabled in environment.rb" do
|
683
|
+
before :each do
|
684
|
+
cp "config/environment.rb", "config/environment.rb.orig"
|
685
|
+
File.open("config/environment.rb", "a") { |f| f.puts "", "config.threadsafe!" }
|
686
|
+
end
|
687
|
+
|
688
|
+
after :each do
|
689
|
+
mv "config/environment.rb.orig", "config/environment.rb"
|
690
|
+
end
|
691
|
+
|
692
|
+
it_should_behave_like "threaded environment"
|
693
|
+
end
|
694
|
+
|
695
|
+
context "with rails version 4" do
|
696
|
+
|
697
|
+
context "When rails version is specified in Gemfile" do
|
698
|
+
before :each do
|
699
|
+
File.open("Gemfile", "a") { |f| f.puts "gem 'rails', '4.0.0'" }
|
700
|
+
end
|
701
|
+
|
702
|
+
after :each do
|
703
|
+
rm "Gemfile"
|
704
|
+
end
|
705
|
+
|
706
|
+
it_should_behave_like "threaded environment"
|
707
|
+
end
|
708
|
+
|
709
|
+
context "when rails version is not specified in Gemfile" do
|
710
|
+
before :each do
|
711
|
+
File.open("Gemfile", "a") { |f| f.puts "gem 'rails'" }
|
712
|
+
File.open("Gemfile.lock", "a") { |f| f.puts " rails (4.0.0)" }
|
713
|
+
end
|
714
|
+
|
715
|
+
after :each do
|
716
|
+
rm "Gemfile"
|
717
|
+
rm "Gemfile.lock"
|
718
|
+
end
|
719
|
+
|
720
|
+
it_should_behave_like "threaded environment"
|
721
|
+
end
|
722
|
+
end
|
723
|
+
|
724
|
+
|
589
725
|
it "adds RAILS_ENV to init.rb" do
|
590
726
|
ENV["RAILS_ENV"] = nil
|
591
727
|
use_config do |config|
|
data/warble.rb
CHANGED
@@ -90,8 +90,15 @@ Warbler::Config.new do |config|
|
|
90
90
|
# config.compiled_ruby_files = FileList['app/**/*.rb']
|
91
91
|
|
92
92
|
# When set to true, Warbler will override the value of ENV['GEM_HOME'] even it
|
93
|
-
# has already been set.
|
94
|
-
#
|
93
|
+
# has already been set. When set to false it will use any existing value of
|
94
|
+
# GEM_HOME if it is set.
|
95
|
+
# config.override_gem_home = true
|
96
|
+
|
97
|
+
# Allows for specifing custom executables
|
98
|
+
# config.executable = ["rake", "bin/rake"]
|
99
|
+
|
100
|
+
# Sets default (prefixed) parameters for the executables
|
101
|
+
# config.executable_params = "do:something"
|
95
102
|
|
96
103
|
# === War files only below here ===
|
97
104
|
|
data/warbler.gemspec
CHANGED
@@ -16,7 +16,7 @@ flexible, Ruby-like way to bundle up all of your application files for
|
|
16
16
|
deployment to a Java environment.}
|
17
17
|
|
18
18
|
gem.files = `git ls-files`.split("\n")
|
19
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
gem.test_files = `git ls-files -- {test,spec,features,integration}/*`.split("\n")
|
20
20
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
21
|
gem.require_paths = ["lib"]
|
22
22
|
|
@@ -26,6 +26,6 @@ deployment to a Java environment.}
|
|
26
26
|
gem.add_runtime_dependency 'rake', [">= 0.9.6"]
|
27
27
|
gem.add_runtime_dependency 'jruby-jars', [">= 1.5.6"]
|
28
28
|
gem.add_runtime_dependency 'jruby-rack', [">= 1.0.0"]
|
29
|
-
gem.add_runtime_dependency 'rubyzip', ["
|
29
|
+
gem.add_runtime_dependency 'rubyzip', ["~> 0.9"]
|
30
30
|
gem.add_development_dependency 'rspec', "~> 2.10"
|
31
31
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.4.0.beta1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nick Sieger
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05
|
12
|
+
date: 2013-09-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -63,15 +63,15 @@ dependencies:
|
|
63
63
|
name: rubyzip
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.9
|
68
|
+
version: '0.9'
|
69
69
|
none: false
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ~>
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0.9
|
74
|
+
version: '0.9'
|
75
75
|
none: false
|
76
76
|
prerelease: false
|
77
77
|
type: :runtime
|
@@ -117,13 +117,96 @@ files:
|
|
117
117
|
- ext/jetty/pom.xml
|
118
118
|
- ext/jetty/src/main/java/JettyWarMain.java
|
119
119
|
- ext/jetty/src/main/resources/webdefault.xml
|
120
|
+
- integration/gem-initializer/pom.xml
|
121
|
+
- integration/pom.xml
|
122
|
+
- integration/rails4_test/pom.xml
|
123
|
+
- integration/rails4_test/src/main/ruby/Gemfile
|
124
|
+
- integration/rails4_test/src/main/ruby/README.rdoc
|
125
|
+
- integration/rails4_test/src/main/ruby/Rakefile
|
126
|
+
- integration/rails4_test/src/main/ruby/app/assets/javascripts/application.js
|
127
|
+
- integration/rails4_test/src/main/ruby/app/assets/javascripts/posts.js.coffee
|
128
|
+
- integration/rails4_test/src/main/ruby/app/assets/stylesheets/application.css
|
129
|
+
- integration/rails4_test/src/main/ruby/app/assets/stylesheets/posts.css.scss
|
130
|
+
- integration/rails4_test/src/main/ruby/app/assets/stylesheets/scaffolds.css.scss
|
131
|
+
- integration/rails4_test/src/main/ruby/app/controllers/application_controller.rb
|
132
|
+
- integration/rails4_test/src/main/ruby/app/controllers/concerns/.keep
|
133
|
+
- integration/rails4_test/src/main/ruby/app/controllers/posts_controller.rb
|
134
|
+
- integration/rails4_test/src/main/ruby/app/helpers/application_helper.rb
|
135
|
+
- integration/rails4_test/src/main/ruby/app/helpers/posts_helper.rb
|
136
|
+
- integration/rails4_test/src/main/ruby/app/mailers/.keep
|
137
|
+
- integration/rails4_test/src/main/ruby/app/models/.keep
|
138
|
+
- integration/rails4_test/src/main/ruby/app/models/concerns/.keep
|
139
|
+
- integration/rails4_test/src/main/ruby/app/models/post.rb
|
140
|
+
- integration/rails4_test/src/main/ruby/app/views/layouts/application.html.erb
|
141
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/_form.html.erb
|
142
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/edit.html.erb
|
143
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/index.html.erb
|
144
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/index.json.jbuilder
|
145
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/new.html.erb
|
146
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/show.html.erb
|
147
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/show.json.jbuilder
|
148
|
+
- integration/rails4_test/src/main/ruby/config.ru
|
149
|
+
- integration/rails4_test/src/main/ruby/config/application.rb
|
150
|
+
- integration/rails4_test/src/main/ruby/config/boot.rb
|
151
|
+
- integration/rails4_test/src/main/ruby/config/database.yml
|
152
|
+
- integration/rails4_test/src/main/ruby/config/environment.rb
|
153
|
+
- integration/rails4_test/src/main/ruby/config/environments/development.rb
|
154
|
+
- integration/rails4_test/src/main/ruby/config/environments/production.rb
|
155
|
+
- integration/rails4_test/src/main/ruby/config/environments/test.rb
|
156
|
+
- integration/rails4_test/src/main/ruby/config/initializers/backtrace_silencers.rb
|
157
|
+
- integration/rails4_test/src/main/ruby/config/initializers/filter_parameter_logging.rb
|
158
|
+
- integration/rails4_test/src/main/ruby/config/initializers/inflections.rb
|
159
|
+
- integration/rails4_test/src/main/ruby/config/initializers/mime_types.rb
|
160
|
+
- integration/rails4_test/src/main/ruby/config/initializers/secret_token.rb
|
161
|
+
- integration/rails4_test/src/main/ruby/config/initializers/session_store.rb
|
162
|
+
- integration/rails4_test/src/main/ruby/config/initializers/wrap_parameters.rb
|
163
|
+
- integration/rails4_test/src/main/ruby/config/locales/en.yml
|
164
|
+
- integration/rails4_test/src/main/ruby/config/routes.rb
|
165
|
+
- integration/rails4_test/src/main/ruby/config/warble.rb
|
166
|
+
- integration/rails4_test/src/main/ruby/db/development.sqlite3
|
167
|
+
- integration/rails4_test/src/main/ruby/db/migrate/20130502003552_create_posts.rb
|
168
|
+
- integration/rails4_test/src/main/ruby/db/production.sqlite3
|
169
|
+
- integration/rails4_test/src/main/ruby/db/schema.rb
|
170
|
+
- integration/rails4_test/src/main/ruby/db/seeds.rb
|
171
|
+
- integration/rails4_test/src/main/ruby/lib/assets/.keep
|
172
|
+
- integration/rails4_test/src/main/ruby/lib/tasks/.keep
|
173
|
+
- integration/rails4_test/src/main/ruby/public/404.html
|
174
|
+
- integration/rails4_test/src/main/ruby/public/422.html
|
175
|
+
- integration/rails4_test/src/main/ruby/public/500.html
|
176
|
+
- integration/rails4_test/src/main/ruby/public/favicon.ico
|
177
|
+
- integration/rails4_test/src/main/ruby/public/robots.txt
|
178
|
+
- integration/rails4_test/src/main/ruby/test/controllers/.keep
|
179
|
+
- integration/rails4_test/src/main/ruby/test/controllers/posts_controller_test.rb
|
180
|
+
- integration/rails4_test/src/main/ruby/test/fixtures/.keep
|
181
|
+
- integration/rails4_test/src/main/ruby/test/fixtures/posts.yml
|
182
|
+
- integration/rails4_test/src/main/ruby/test/helpers/.keep
|
183
|
+
- integration/rails4_test/src/main/ruby/test/helpers/posts_helper_test.rb
|
184
|
+
- integration/rails4_test/src/main/ruby/test/integration/.keep
|
185
|
+
- integration/rails4_test/src/main/ruby/test/mailers/.keep
|
186
|
+
- integration/rails4_test/src/main/ruby/test/models/.keep
|
187
|
+
- integration/rails4_test/src/main/ruby/test/models/post_test.rb
|
188
|
+
- integration/rails4_test/src/main/ruby/test/test_helper.rb
|
189
|
+
- integration/rails4_test/src/main/ruby/vendor/assets/javascripts/.keep
|
190
|
+
- integration/rails4_test/src/main/ruby/vendor/assets/stylesheets/.keep
|
191
|
+
- integration/rails4_test/src/test/java/org/jruby/warbler/Rails4AppTestIT.java
|
192
|
+
- integration/runnable_test/pom.xml
|
193
|
+
- integration/runnable_test/src/main/ruby/Rakefile
|
194
|
+
- integration/runnable_test/src/main/ruby/config.ru
|
195
|
+
- integration/runnable_test/src/main/ruby/config/warble.rb
|
196
|
+
- integration/runnable_test/src/test/java/org/jruby/warbler/RunnableWarTestIT.java
|
197
|
+
- integration/simple_rack_test/pom.xml
|
198
|
+
- integration/simple_rack_test/src/main/ruby/config.ru
|
199
|
+
- integration/simple_rack_test/src/main/ruby/config/warble.rb
|
200
|
+
- integration/simple_rack_test/src/test/java/org/jruby/warbler/AppTestIT.java
|
120
201
|
- lib/warbler.rb
|
121
202
|
- lib/warbler/application.rb
|
122
203
|
- lib/warbler/config.rb
|
204
|
+
- lib/warbler/executable_helper.rb
|
123
205
|
- lib/warbler/gems.rb
|
124
206
|
- lib/warbler/jar.rb
|
125
207
|
- lib/warbler/pathmap_helper.rb
|
126
208
|
- lib/warbler/rake_helper.rb
|
209
|
+
- lib/warbler/scripts/rails.rb
|
127
210
|
- lib/warbler/task.rb
|
128
211
|
- lib/warbler/templates/bundler.erb
|
129
212
|
- lib/warbler/templates/config.erb
|
@@ -173,6 +256,7 @@ files:
|
|
173
256
|
- spec/sample_jar/History.txt
|
174
257
|
- spec/sample_jar/README.txt
|
175
258
|
- spec/sample_jar/Rakefile
|
259
|
+
- spec/sample_jar/bin/another_jar
|
176
260
|
- spec/sample_jar/bin/sample_jar
|
177
261
|
- spec/sample_jar/lib/sample_jar.rb
|
178
262
|
- spec/sample_jar/sample_jar.gemspec
|
@@ -230,9 +314,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
230
314
|
none: false
|
231
315
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
232
316
|
requirements:
|
233
|
-
- - '
|
317
|
+
- - '>'
|
234
318
|
- !ruby/object:Gem::Version
|
235
|
-
version:
|
319
|
+
version: 1.3.1
|
236
320
|
none: false
|
237
321
|
requirements: []
|
238
322
|
rubyforge_project: caldersphere
|
@@ -241,6 +325,87 @@ signing_key:
|
|
241
325
|
specification_version: 3
|
242
326
|
summary: Warbler chirpily constructs .war files of your Rails applications.
|
243
327
|
test_files:
|
328
|
+
- integration/gem-initializer/pom.xml
|
329
|
+
- integration/pom.xml
|
330
|
+
- integration/rails4_test/pom.xml
|
331
|
+
- integration/rails4_test/src/main/ruby/Gemfile
|
332
|
+
- integration/rails4_test/src/main/ruby/README.rdoc
|
333
|
+
- integration/rails4_test/src/main/ruby/Rakefile
|
334
|
+
- integration/rails4_test/src/main/ruby/app/assets/javascripts/application.js
|
335
|
+
- integration/rails4_test/src/main/ruby/app/assets/javascripts/posts.js.coffee
|
336
|
+
- integration/rails4_test/src/main/ruby/app/assets/stylesheets/application.css
|
337
|
+
- integration/rails4_test/src/main/ruby/app/assets/stylesheets/posts.css.scss
|
338
|
+
- integration/rails4_test/src/main/ruby/app/assets/stylesheets/scaffolds.css.scss
|
339
|
+
- integration/rails4_test/src/main/ruby/app/controllers/application_controller.rb
|
340
|
+
- integration/rails4_test/src/main/ruby/app/controllers/concerns/.keep
|
341
|
+
- integration/rails4_test/src/main/ruby/app/controllers/posts_controller.rb
|
342
|
+
- integration/rails4_test/src/main/ruby/app/helpers/application_helper.rb
|
343
|
+
- integration/rails4_test/src/main/ruby/app/helpers/posts_helper.rb
|
344
|
+
- integration/rails4_test/src/main/ruby/app/mailers/.keep
|
345
|
+
- integration/rails4_test/src/main/ruby/app/models/.keep
|
346
|
+
- integration/rails4_test/src/main/ruby/app/models/concerns/.keep
|
347
|
+
- integration/rails4_test/src/main/ruby/app/models/post.rb
|
348
|
+
- integration/rails4_test/src/main/ruby/app/views/layouts/application.html.erb
|
349
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/_form.html.erb
|
350
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/edit.html.erb
|
351
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/index.html.erb
|
352
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/index.json.jbuilder
|
353
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/new.html.erb
|
354
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/show.html.erb
|
355
|
+
- integration/rails4_test/src/main/ruby/app/views/posts/show.json.jbuilder
|
356
|
+
- integration/rails4_test/src/main/ruby/config.ru
|
357
|
+
- integration/rails4_test/src/main/ruby/config/application.rb
|
358
|
+
- integration/rails4_test/src/main/ruby/config/boot.rb
|
359
|
+
- integration/rails4_test/src/main/ruby/config/database.yml
|
360
|
+
- integration/rails4_test/src/main/ruby/config/environment.rb
|
361
|
+
- integration/rails4_test/src/main/ruby/config/environments/development.rb
|
362
|
+
- integration/rails4_test/src/main/ruby/config/environments/production.rb
|
363
|
+
- integration/rails4_test/src/main/ruby/config/environments/test.rb
|
364
|
+
- integration/rails4_test/src/main/ruby/config/initializers/backtrace_silencers.rb
|
365
|
+
- integration/rails4_test/src/main/ruby/config/initializers/filter_parameter_logging.rb
|
366
|
+
- integration/rails4_test/src/main/ruby/config/initializers/inflections.rb
|
367
|
+
- integration/rails4_test/src/main/ruby/config/initializers/mime_types.rb
|
368
|
+
- integration/rails4_test/src/main/ruby/config/initializers/secret_token.rb
|
369
|
+
- integration/rails4_test/src/main/ruby/config/initializers/session_store.rb
|
370
|
+
- integration/rails4_test/src/main/ruby/config/initializers/wrap_parameters.rb
|
371
|
+
- integration/rails4_test/src/main/ruby/config/locales/en.yml
|
372
|
+
- integration/rails4_test/src/main/ruby/config/routes.rb
|
373
|
+
- integration/rails4_test/src/main/ruby/config/warble.rb
|
374
|
+
- integration/rails4_test/src/main/ruby/db/development.sqlite3
|
375
|
+
- integration/rails4_test/src/main/ruby/db/migrate/20130502003552_create_posts.rb
|
376
|
+
- integration/rails4_test/src/main/ruby/db/production.sqlite3
|
377
|
+
- integration/rails4_test/src/main/ruby/db/schema.rb
|
378
|
+
- integration/rails4_test/src/main/ruby/db/seeds.rb
|
379
|
+
- integration/rails4_test/src/main/ruby/lib/assets/.keep
|
380
|
+
- integration/rails4_test/src/main/ruby/lib/tasks/.keep
|
381
|
+
- integration/rails4_test/src/main/ruby/public/404.html
|
382
|
+
- integration/rails4_test/src/main/ruby/public/422.html
|
383
|
+
- integration/rails4_test/src/main/ruby/public/500.html
|
384
|
+
- integration/rails4_test/src/main/ruby/public/favicon.ico
|
385
|
+
- integration/rails4_test/src/main/ruby/public/robots.txt
|
386
|
+
- integration/rails4_test/src/main/ruby/test/controllers/.keep
|
387
|
+
- integration/rails4_test/src/main/ruby/test/controllers/posts_controller_test.rb
|
388
|
+
- integration/rails4_test/src/main/ruby/test/fixtures/.keep
|
389
|
+
- integration/rails4_test/src/main/ruby/test/fixtures/posts.yml
|
390
|
+
- integration/rails4_test/src/main/ruby/test/helpers/.keep
|
391
|
+
- integration/rails4_test/src/main/ruby/test/helpers/posts_helper_test.rb
|
392
|
+
- integration/rails4_test/src/main/ruby/test/integration/.keep
|
393
|
+
- integration/rails4_test/src/main/ruby/test/mailers/.keep
|
394
|
+
- integration/rails4_test/src/main/ruby/test/models/.keep
|
395
|
+
- integration/rails4_test/src/main/ruby/test/models/post_test.rb
|
396
|
+
- integration/rails4_test/src/main/ruby/test/test_helper.rb
|
397
|
+
- integration/rails4_test/src/main/ruby/vendor/assets/javascripts/.keep
|
398
|
+
- integration/rails4_test/src/main/ruby/vendor/assets/stylesheets/.keep
|
399
|
+
- integration/rails4_test/src/test/java/org/jruby/warbler/Rails4AppTestIT.java
|
400
|
+
- integration/runnable_test/pom.xml
|
401
|
+
- integration/runnable_test/src/main/ruby/Rakefile
|
402
|
+
- integration/runnable_test/src/main/ruby/config.ru
|
403
|
+
- integration/runnable_test/src/main/ruby/config/warble.rb
|
404
|
+
- integration/runnable_test/src/test/java/org/jruby/warbler/RunnableWarTestIT.java
|
405
|
+
- integration/simple_rack_test/pom.xml
|
406
|
+
- integration/simple_rack_test/src/main/ruby/config.ru
|
407
|
+
- integration/simple_rack_test/src/main/ruby/config/warble.rb
|
408
|
+
- integration/simple_rack_test/src/test/java/org/jruby/warbler/AppTestIT.java
|
244
409
|
- spec/drb_default_id_conv.rb
|
245
410
|
- spec/drb_helper.rb
|
246
411
|
- spec/sample_bundler/.bundle/config
|
@@ -270,6 +435,7 @@ test_files:
|
|
270
435
|
- spec/sample_jar/History.txt
|
271
436
|
- spec/sample_jar/README.txt
|
272
437
|
- spec/sample_jar/Rakefile
|
438
|
+
- spec/sample_jar/bin/another_jar
|
273
439
|
- spec/sample_jar/bin/sample_jar
|
274
440
|
- spec/sample_jar/lib/sample_jar.rb
|
275
441
|
- spec/sample_jar/sample_jar.gemspec
|