localeapp 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version 0.6.1
2
+
3
+ * Fix bug where default handler was sending array rather than resolved content
4
+
1
5
  # Version 0.6.0
2
6
 
3
7
  * Support passing -k or --api-key option to commands
@@ -3,7 +3,12 @@ module I18n::Backend::Base
3
3
 
4
4
  def default(locale, object, subject, options = {})
5
5
  result = default_without_handler(locale, object, subject, options)
6
- Localeapp.missing_translations.add(locale, object, subject, options)
6
+ case subject # case is what i18n gem uses here so doing the same
7
+ when Array
8
+ Localeapp.missing_translations.add(locale, object, result, options)
9
+ else
10
+ Localeapp.missing_translations.add(locale, object, subject, options)
11
+ end
7
12
  return result
8
13
  end
9
14
  end
@@ -1,3 +1,3 @@
1
1
  module Localeapp
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -13,4 +13,20 @@ describe I18n::Backend::Base, '#default' do
13
13
  klass.default(:en, 'foo', 'bar', :baz => 'bam')
14
14
  end
15
15
  end
16
+
17
+ describe "when subject is an array" do
18
+ it "uses result of default call instead of array" do
19
+ with_configuration(:sending_environments => ['my_env'], :environment_name => 'my_env' ) do
20
+ Localeapp.missing_translations.should_receive(:add).with(:en, 'foo', 'not missing', :baz => 'bam')
21
+ I18n.stub!(:translate) do |subject, _|
22
+ if subject == :not_missing
23
+ "not missing"
24
+ else
25
+ nil
26
+ end
27
+ end
28
+ klass.default(:en, 'foo', [:missing, :not_missing], :baz => 'bam')
29
+ end
30
+ end
31
+ end
16
32
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localeapp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 0
10
- version: 0.6.0
9
+ - 1
10
+ version: 0.6.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christopher Dell
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-10-08 00:00:00 Z
19
+ date: 2012-10-09 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: i18n