diff --git a/lib/jsdoc_helper.rb b/lib/jsdoc_helper.rb index 3834a4f..049e701 100644 --- a/lib/jsdoc_helper.rb +++ b/lib/jsdoc_helper.rb @@ -1,3 +1,11 @@ +unless String.method_defined?(:lines) then + class String + def lines + to_a + end + end +end + module JsdocHelper # :stopdoc: diff --git a/lib/jsdoc_helper/rake/task/runner.rb b/lib/jsdoc_helper/rake/task/runner.rb index 9157343..507065f 100644 --- a/lib/jsdoc_helper/rake/task/runner.rb +++ b/lib/jsdoc_helper/rake/task/runner.rb @@ -59,11 +59,19 @@ def jsdoc end def out - @args[:out].to_a.to_s + if @args[:out].respond_to?(:lines) + @args[:out].lines.to_a.join('') + else + @args[:out].to_a.join('') + end end def files - @args[:files].to_a.join(' ') + if @args[:files].respond_to?(:lines) + @args[:files].lines.to_a.join(' ') + else + @args[:files].to_a.join(' ') + end end def template @@ -75,9 +83,8 @@ def toolkit_path(relative_path) end def options - @args[:options].to_a.join(' ') - end - + @args[:options].lines.to_a.join(' ') + end end end end diff --git a/spec/jsdoc_helper/support/file_helper_spec.rb b/spec/jsdoc_helper/support/file_helper_spec.rb index 90afddd..ccf7878 100644 --- a/spec/jsdoc_helper/support/file_helper_spec.rb +++ b/spec/jsdoc_helper/support/file_helper_spec.rb @@ -78,7 +78,7 @@ end it "should produce a src prefix for documentation" do - doc_src_prefix.should =~ /^_Users_petegadomski_Developer_jsdoc_helper_test_tmp$/ + doc_src_prefix.should =~ /^#{path.gsub('/', '_')}$/ end it "should return a nice file list" do