air18n 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -46,10 +46,15 @@ module Air18n
46
46
  #
47
47
  # Returns what the block returns.
48
48
  #
49
+ # If locale is blank, leaves I18n.full_locale unaffected.
50
+ #
49
51
  # Useful for tests or where you want to render something in a
50
52
  # certain language without the side-effect of changing
51
53
  # I18n.full_locale.
52
54
  def run_in_locale(locale)
55
+ # Be robust to people passing in nil locale.
56
+ locale ||= I18n.default_locale
57
+
53
58
  old_locale = I18n.full_locale
54
59
  I18n.full_locale = locale
55
60
  ret = yield
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.4.9"
2
+ VERSION = "0.4.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: air18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-05-17 00:00:00.000000000 Z
16
+ date: 2013-05-22 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: i18n