Fixing bugs that popped up as soon as I ran rake

This commit is contained in:
Mike West 2010-11-22 15:00:36 +01:00
parent 1262d50857
commit cffe49a813
2 changed files with 4 additions and 4 deletions

View File

@ -30,12 +30,12 @@ directory 'docs/'
desc 'Build docs and open in browser for the reading' desc 'Build docs and open in browser for the reading'
task :read => :docs do task :read => :docs do
sh 'open docs/rocco.html' sh 'open docs/lib/rocco.html'
end end
# Make index.html a copy of rocco.html # Make index.html a copy of rocco.html
file 'docs/index.html' => 'docs/rocco.html' do |f| file 'docs/index.html' => 'docs/lib/rocco.html' do |f|
cp 'docs/rocco.html', 'docs/index.html', :preserve => true cp 'docs/lib/rocco.html', 'docs/index.html', :preserve => true
end end
task :docs => 'docs/index.html' task :docs => 'docs/index.html'
CLEAN.include 'docs/index.html' CLEAN.include 'docs/index.html'

View File

@ -310,7 +310,7 @@ class Rocco
# `def func():\n print "omg!"` # `def func():\n print "omg!"`
def normalize_leading_spaces( sections ) def normalize_leading_spaces( sections )
sections.map do |section| sections.map do |section|
if section[ 0 ] if section.any? && section[0].any?
leading_space = section[0][0].match( "^\s+" ) leading_space = section[0][0].match( "^\s+" )
if leading_space if leading_space
section[0] = section[0].map{ |line| line.sub( /^#{leading_space.to_s}/, '' ) } section[0] = section[0].map{ |line| line.sub( /^#{leading_space.to_s}/, '' ) }