Skip to content

Instantly share code, notes, and snippets.

@pacoguzman
pacoguzman / snippet_backend.rb
Created July 10, 2009 07:51
I18n that include pluralization rules for spanish within Rails - http://www.viget.com/extend/rails-internationalization-and-tu/
module I18n
module Backend
class SnippetBackend < Simple
protected
def init_translations
load_translations(*I18n.load_path.flatten)
load_translations_from_database
@initialized = true
end
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
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'
# 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" }