Made blog_url becalled just once...

...and stored in the `url` variable.
This commit is contained in:
Daniel Escoz 2013-08-25 12:29:21 +02:00
parent a4236cae1b
commit 631069f427

View File

@ -337,8 +337,9 @@ task :setup_github_pages, :repo do |t, args|
end end
end end
end end
url = blog_url(user, project)
jekyll_config = IO.read('_config.yml') jekyll_config = IO.read('_config.yml')
jekyll_config.sub!(/^url:.*$/, "url: #{blog_url(user, project)}") jekyll_config.sub!(/^url:.*$/, "url: #{url}")
File.open('_config.yml', 'w') do |f| File.open('_config.yml', 'w') do |f|
f.write jekyll_config f.write jekyll_config
end end
@ -358,7 +359,7 @@ task :setup_github_pages, :repo do |t, args|
f.write rakefile f.write rakefile
end end
end end
puts "\n---\n## Now you can deploy to #{blog_url(user, project)} with `rake deploy` ##" puts "\n---\n## Now you can deploy to #{url} with `rake deploy` ##"
end end
def ok_failed(condition) def ok_failed(condition)