Permalink
Browse files

Including compiled .class files when using a gemspec

  • Loading branch information...
1 parent e509d3a commit d53b69e93da5ad5d2796b950e85c84507ca97c1c @nicksieger nicksieger committed Nov 11, 2010
Showing with 12 additions and 1 deletion.
  1. +5 −0 lib/warbler/traits/gemspec.rb
  2. +1 −1 spec/spec_helper.rb
  3. +6 −0 spec/warbler/jar_spec.rb
@@ -38,6 +38,11 @@ def update_archive(jar)
end
jar.files[jar.apply_pathmaps(config, f, :application)] = f
end
+ config.compiled_ruby_files.each do |f|
+ f = f.sub(/\.rb$/, '.class')
+ next unless File.exist?(f)
+ jar.files[jar.apply_pathmaps(config, f, :application)] = f
+ end
bin_path = jar.apply_pathmaps(config, default_executable, :application)
add_main_rb(jar, bin_path)
end
View
@@ -68,7 +68,7 @@ def cleanup_temp_files
after(:each) do
rm_rf FileList["log", ".bundle", "tmp/war"]
rm_f FileList["*.war", "*.foobar", "**/config.ru", "*web.xml*", "config/web.xml*", "config/warble.rb",
- "file.txt", 'manifest', 'Gemfile*', 'MANIFEST.MF*', 'init.rb*']
+ "file.txt", 'manifest', 'Gemfile*', 'MANIFEST.MF*', 'init.rb*', '**/*.class']
end
end
end
View
@@ -111,6 +111,12 @@ def apply_extra_config(config)
contents.split("\n").grep(/load.*sample_jar\/bin\/sample_jar/).should_not be_empty
end
+ it "includes compiled .rb and .class files" do
+ touch "lib/sample_jar.class"
+ jar.apply(config)
+ file_list(%r{^sample_jar/lib/sample_jar\.class$}).should_not be_empty
+ end
+
context "and a missing file" do
before :each do
mv "Rakefile", "Rakefile.tmp"

0 comments on commit d53b69e

Please sign in to comment.