Fixing bugs that popped up as soon as I ran rake
This commit is contained in:
parent
1262d50857
commit
cffe49a813
6
Rakefile
6
Rakefile
@ -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'
|
||||||
|
@ -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}/, '' ) }
|
||||||
|
Loading…
Reference in New Issue
Block a user