Skip to content

Commit

Permalink
upgraded i18n dependency to 0.5 because the options for raising an ex…
Browse files Browse the repository at this point in the history
…ception have changed from :throw to :raise.
  • Loading branch information
Alain Bloch and Thomas Shafer authored and Thomas Shafer committed Nov 22, 2011
1 parent 71c7a4c commit 8b7965b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions faker.gemspec
Expand Up @@ -10,10 +10,10 @@ Gem::Specification.new do |s|
s.homepage = "http://faker.rubyforge.org"
s.summary = %q{Easily generate fake data}
s.description = %q{Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.}

s.rubyforge_project = "faker"

s.add_dependency('i18n', '~> 0.4')
s.add_dependency('i18n', '~> 0.5')

s.files = `git ls-files -- lib/*`.split("\n") + %w(History.txt License.txt README.md)
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Expand Down
4 changes: 2 additions & 2 deletions lib/faker.rb
Expand Up @@ -66,9 +66,9 @@ def parse(key)
def translate(*args)
opts = args.last.is_a?(Hash) ? args.pop : {}
opts[:locale] ||= Faker::Config.locale
opts[:throw] = true
opts[:raise] = true
I18n.translate(*(args.push(opts)))
rescue
rescue I18n::MissingTranslationData => e
# Super-simple fallback -- fallback to en if the
# translation was missing. If the translation isn't
# in en either, then it will raise again.
Expand Down

0 comments on commit 8b7965b

Please sign in to comment.