File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,9 @@ def define_compiled_task
108
108
task "compiled" do
109
109
jar . compile ( config )
110
110
task @name do
111
- rm_f config . compiled_ruby_files . map { |f | f . sub ( /\. rb$/ , '.class' ) }
111
+ extensions = config . compiled_ruby_files &.map { |f | File . extname ( f ) } &.uniq || [ '.rb' ]
112
+ regex_extensions = extensions . map { |extension | extension . sub ( '.' , '\.' ) } . join ( '|' )
113
+ rm_f config . compiled_ruby_files . map { |f | f . sub ( /#{ regex_extensions } $/ , '.class' ) }
112
114
end
113
115
end
114
116
end
Original file line number Diff line number Diff line change 18
18
config . gems = [ "rake" ]
19
19
config . webserver = "test"
20
20
config . webxml . jruby . max . runtimes = 5
21
+
22
+ config . compiled_ruby_files = FileList [ '**/*.rb' , '**/.rake' ]
21
23
end
22
24
end
23
25
@@ -150,6 +152,12 @@ def run_task(t)
150
152
File . exist? ( 'app/helpers/application_helper.class' ) . should be false
151
153
end
152
154
155
+ it "should not delete another extensions but .class files after finishing the jar" do
156
+ config . features << "compiled"
157
+ silence { run_task "warble" }
158
+ File . exist? ( 'lib/tasks/utils.rake' ) . should be true
159
+ end
160
+
153
161
context "where symlinks are available" do
154
162
begin
155
163
FileUtils . ln_s "README.txt" , "r.txt.symlink" , :verbose => false
You can’t perform that action at this time.
0 commit comments