From f1024b791d1df78def68161954a4a676729f36b7 Mon Sep 17 00:00:00 2001 From: Stephen Bannasch Date: Mon, 11 Apr 2011 16:12:48 -0400 Subject: [PATCH 1/2] fix String#to_a and Array#to_s for Ruby 1.9 specs pass in 1.8.7 and 1.9 now. --- lib/jsdoc_helper.rb | 8 ++++++++ lib/jsdoc_helper/rake/task/runner.rb | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) 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 From d54791fe3ad5f66684c44c810bbba20a8c95d2af Mon Sep 17 00:00:00 2001 From: Stephen Bannasch Date: Mon, 11 Apr 2011 16:13:10 -0400 Subject: [PATCH 2/2] remove hard-coded path in file_helper_spec --- spec/jsdoc_helper/support/file_helper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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