File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 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
108108 task "compiled" do
109109 jar . compile ( config )
110110 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' ) }
112114 end
113115 end
114116 end
Original file line number Diff line number Diff line change 1818 config . gems = [ "rake" ]
1919 config . webserver = "test"
2020 config . webxml . jruby . max . runtimes = 5
21+
22+ config . compiled_ruby_files = FileList [ '**/*.rb' , '**/.rake' ]
2123 end
2224 end
2325
@@ -150,6 +152,12 @@ def run_task(t)
150152 File . exist? ( 'app/helpers/application_helper.class' ) . should be false
151153 end
152154
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+
153161 context "where symlinks are available" do
154162 begin
155163 FileUtils . ln_s "README.txt" , "r.txt.symlink" , :verbose => false
You can’t perform that action at this time.
0 commit comments