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
module I18n | |
module Backend | |
class SnippetBackend < Simple | |
protected | |
def init_translations | |
load_translations(*I18n.load_path.flatten) | |
load_translations_from_database | |
@initialized = true | |
end |
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
module SimpleCachingTTL | |
CACHETIME = 24 * 3600 # Once per day | |
def cache(text, path) | |
FileUtils.mkdir_p(File.dirname(path)) | |
File.open(path, 'w') { |f| f.write( text ) } | |
text | |
end | |
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 'cucumber/rake/task' | |
namespace :cucumber do | |
Cucumber::Rake::Task.new(:webrat) do |t| | |
t.fork = true # Explicitly fork for cucumber 0.3.4 and rails | |
t.cucumber_opts = "--format progress" | |
t.step_list = %w{features/support/env.rb features/support/webrat.rb features/step_definitions} | |
t.feature_list = %w{features/webrat} | |
end | |
task :webrat => 'db:test:prepare' |
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
# RAILSLOVE.com template | |
# | |
# with help and ideas from: | |
# http://gist.github.com/33337 By Peter Cooper | |
# http://github.com/jeremymcanally/rails-templates/tree/master/suspenders.rb Suspenders by Thoughtbot Nathan Esquenazi | |
if yes?("symlink local rails copy to vendor?") | |
path = ask("what's the directory of your local rails copy?") | |
inside('vendor') { run "ln -s #{path} rails" } |
NewerOlder