Skip to content

Instantly share code, notes, and snippets.

@argent-smith
Created April 9, 2011 07:53
Show Gist options
  • Save argent-smith/911225 to your computer and use it in GitHub Desktop.
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.
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