Created
April 9, 2011 07:53
-
-
Save argent-smith/911225 to your computer and use it in GitHub Desktop.
An example of Rakefile of a Jekyll site which sets LANG before doing site generation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rake' | |
require 'rake/clean' | |
require 'rake/gempackagetask' | |
require 'rake/testtask' | |
LANG = "ru_RU.UTF-8" | |
SET_CMD = case RUBY_PLATFORM | |
when /mingw32/ then "set" | |
else "export" | |
end | |
desc 'just generate the site' | |
task :generate do | |
sh "#{SET_CMD} LANG=#{LANG} && jekyll" | |
end | |
desc 'serve locally on jekyll' | |
task :serve do | |
sh "#{SET_CMD} LANG=#{LANG} && jekyll --server --auto" | |
end | |
desc 'serve locally on rack/sinatra' | |
task :rackup => :generate do | |
sh "#{SET_CMD} LANG=#{LANG} && rackup config.ru" | |
end | |
desc 'serve locally on thin/sinatra' | |
task :thin => :generate do | |
sh "#{SET_CMD} LANG=#{LANG} && thin start" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment