Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Including compiled .class files when using a gemspec

  • Loading branch information...
commit d53b69e93da5ad5d2796b950e85c84507ca97c1c 1 parent e509d3a
Nick Sieger authored November 11, 2010
5  lib/warbler/traits/gemspec.rb
@@ -38,6 +38,11 @@ def update_archive(jar)
38 38
           end
39 39
           jar.files[jar.apply_pathmaps(config, f, :application)] = f
40 40
         end
  41
+        config.compiled_ruby_files.each do |f|
  42
+          f = f.sub(/\.rb$/, '.class')
  43
+          next unless File.exist?(f)
  44
+          jar.files[jar.apply_pathmaps(config, f, :application)] = f
  45
+        end
41 46
         bin_path = jar.apply_pathmaps(config, default_executable, :application)
42 47
         add_main_rb(jar, bin_path)
43 48
       end
2  spec/spec_helper.rb
@@ -68,7 +68,7 @@ def cleanup_temp_files
68 68
     after(:each) do
69 69
       rm_rf FileList["log", ".bundle", "tmp/war"]
70 70
       rm_f FileList["*.war", "*.foobar", "**/config.ru", "*web.xml*", "config/web.xml*", "config/warble.rb",
71  
-                    "file.txt", 'manifest', 'Gemfile*', 'MANIFEST.MF*', 'init.rb*']
  71
+                    "file.txt", 'manifest', 'Gemfile*', 'MANIFEST.MF*', 'init.rb*', '**/*.class']
72 72
     end
73 73
   end
74 74
 end
6  spec/warbler/jar_spec.rb
@@ -111,6 +111,12 @@ def apply_extra_config(config)
111 111
         contents.split("\n").grep(/load.*sample_jar\/bin\/sample_jar/).should_not be_empty
112 112
       end
113 113
 
  114
+      it "includes compiled .rb and .class files" do
  115
+        touch "lib/sample_jar.class"
  116
+        jar.apply(config)
  117
+        file_list(%r{^sample_jar/lib/sample_jar\.class$}).should_not be_empty
  118
+      end
  119
+
114 120
       context "and a missing file" do
115 121
         before :each do
116 122
           mv "Rakefile", "Rakefile.tmp"

0 notes on commit d53b69e

Please sign in to comment.
Something went wrong with that request. Please try again.