From cffe49a813bbc083c695997c5d2a7da7f3cf99a1 Mon Sep 17 00:00:00 2001 From: Mike West Date: Mon, 22 Nov 2010 15:00:36 +0100 Subject: [PATCH] Fixing bugs that popped up as soon as I ran `rake` --- Rakefile | 6 +++--- lib/rocco.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index 8cbe0e6..9f3161b 100644 --- a/Rakefile +++ b/Rakefile @@ -30,12 +30,12 @@ directory 'docs/' desc 'Build docs and open in browser for the reading' task :read => :docs do - sh 'open docs/rocco.html' + sh 'open docs/lib/rocco.html' end # Make index.html a copy of rocco.html -file 'docs/index.html' => 'docs/rocco.html' do |f| - cp 'docs/rocco.html', 'docs/index.html', :preserve => true +file 'docs/index.html' => 'docs/lib/rocco.html' do |f| + cp 'docs/lib/rocco.html', 'docs/index.html', :preserve => true end task :docs => 'docs/index.html' CLEAN.include 'docs/index.html' diff --git a/lib/rocco.rb b/lib/rocco.rb index f27e7bc..a480366 100644 --- a/lib/rocco.rb +++ b/lib/rocco.rb @@ -310,7 +310,7 @@ class Rocco # `def func():\n print "omg!"` def normalize_leading_spaces( sections ) sections.map do |section| - if section[ 0 ] + if section.any? && section[0].any? leading_space = section[0][0].match( "^\s+" ) if leading_space section[0] = section[0].map{ |line| line.sub( /^#{leading_space.to_s}/, '' ) }