Skip to content

Commit

Permalink
Merge pull request infews#6 from dburkes/master
Browse files Browse the repository at this point in the history
Ruby 1.9 compatibility
  • Loading branch information
Davis W. Frank committed Aug 10, 2011
2 parents de3ccb1 + bdcde6c commit a67f1c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/keydown/lib/slide.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def highlight_code!
@codemap.each do |id, code_block|
lang = code_block[:lang]
code = code_block[:code]
if code.all? { |line| line =~ /\A\r?\n\Z/ || line =~ /^( |\t)/ }
if code.lines.all? { |line| line =~ /\A\r?\n\Z/ || line =~ /^( |\t)/ }
code.gsub!(/^( |\t)/m, '')
end

Expand Down
2 changes: 1 addition & 1 deletion spec/tasks/generate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
before :each do
capture_output do
Dir.chdir @tmp_dir do
@thor.invoke Keydown::Tasks, "generate", "sample"
@thor.invoke Keydown::Tasks, ["generate", "sample"]
end
end
end
Expand Down
14 changes: 7 additions & 7 deletions spec/tasks/slides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
before(:each) do
Dir.chdir @tmp_dir do
@std_out = capture_output do
@thor.invoke Keydown::Tasks, "slides", "with_title.md"
@thor.invoke Keydown::Tasks, ["slides", "with_title.md"]
end
end
end
Expand All @@ -63,7 +63,7 @@
before(:each) do
capture_output do
Dir.chdir @tmp_dir do
@thor.invoke Keydown::Tasks, "slides", "with_title.md"
@thor.invoke Keydown::Tasks, ["slides", "with_title.md"]
@file = File.new('with_title.html')
@doc = Nokogiri(@file)
end
Expand Down Expand Up @@ -92,7 +92,7 @@
before(:each) do
capture_output do
Dir.chdir @tmp_dir do
@thor.invoke Keydown::Tasks, "slides", "with_title"
@thor.invoke Keydown::Tasks, ["slides", "with_title"]
@file = File.new('with_title.html')
@doc = Nokogiri(@file)
end
Expand All @@ -109,14 +109,14 @@
capture_output do

Dir.chdir @tmp_dir do
@thor.invoke Keydown::Tasks, "generate", "test"
@thor.invoke Keydown::Tasks, ["generate", "test"]

Dir.chdir "test" do
system "cp #{Keydown::Tasks.source_root}/spec/fixtures/with_title.md #{@tmp_dir}/test/with_title.md"
system "cp #{Keydown::Tasks.source_root}/spec/fixtures/custom.css #{@tmp_dir}/test/css/custom.css"
system "cp #{Keydown::Tasks.source_root}/spec/fixtures/custom.js #{@tmp_dir}/test/js/custom.js"

@thor.invoke Keydown::Tasks, "slides", "with_title.md"
@thor.invoke Keydown::Tasks, ["slides", "with_title.md"]

@file = File.new('with_title.html')
@doc = Nokogiri(@file)
Expand All @@ -143,12 +143,12 @@
capture_output do

Dir.chdir @tmp_dir do
@thor.invoke Keydown::Tasks, "generate", "test"
@thor.invoke Keydown::Tasks, ["generate", "test"]

Dir.chdir "test" do
system "cp #{Keydown::Tasks.source_root}/spec/fixtures/with_backgrounds.md #{@tmp_dir}/test/with_backgrounds.md"

@thor.invoke Keydown::Tasks, "slides", "with_backgrounds.md"
@thor.invoke Keydown::Tasks, ["slides", "with_backgrounds.md"]

@file = File.new('with_backgrounds.html')
@doc = Nokogiri(@file)
Expand Down

0 comments on commit a67f1c8

Please sign in to comment.