yaml-translator 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4a2bedcfad980cb1ab2ad7d978ef33b70f374dc
4
- data.tar.gz: eaab328e29e901828161d2c2795e2d012b71e307
3
+ metadata.gz: ba16684fa000a47e86f4e74877d2852c36c1526b
4
+ data.tar.gz: ce7e0325cc35e11aadfddae1e85a6f7f1bb41734
5
5
  SHA512:
6
- metadata.gz: 2dbcdfb27b69d1edc807d4fca2bf24cf0b472551a9db09900c7e4f7a3416ee66882ef8278b63ea7852529dd039b5b91f492d831df9ed113677ecf3fc53b4760d
7
- data.tar.gz: 13035e4281a00fd05826585cee9780e753181cd140422fe4ff3aa0d796c1fc4feb8bdc250dd5a9ab9aa2bb4447290d3b90f72f0970cb41fb39ad3d5cc3f25d04
6
+ metadata.gz: 9b10fdffa997b6c0707d41e027963f02ec636197ecb2d21001fd792f707d819f59af6a20f4cccdb06b1f4f94f1dad21bc38063392ca0f7f540fc404cc5841daf
7
+ data.tar.gz: b102408618e93b9a56592b733ef90bf2aec962241b9873934e660258d3efb3de0afbafe0a4d3104d84a6ca53fd4a4e3cdc6bcd0df1c46f0b3d1e55cd18e399f5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yaml-translator (0.9.1)
4
+ yaml-translator (0.9.2)
5
5
  diff-lcs
6
6
  easy_translate
7
7
 
@@ -39,7 +39,9 @@ module YamlTranslator
39
39
  key, text = *element.split(':')
40
40
  [key, text.strip]
41
41
  end
42
- Locale.new(tree_of(Hash[diffs.compact]))
42
+ tree_hash = tree_of(Hash[diffs.compact])
43
+ tree_hash[lang] = {} if tree_hash.empty?
44
+ Locale.new(tree_hash)
43
45
  end
44
46
 
45
47
  def merge(other_locale)
@@ -1,3 +1,3 @@
1
1
  module YamlTranslator
2
- VERSION = '0.9.1'
2
+ VERSION = '0.9.2'
3
3
  end
@@ -41,4 +41,15 @@ describe YamlTranslator::Translator do
41
41
  end
42
42
  end
43
43
  end
44
+ describe '#diff' do
45
+ let(:yaml_source) { yaml_contents(:en) }
46
+ context 'when diff nothing' do
47
+ context 'when ja' do
48
+ subject { translator.string(yaml_source).diff(yaml_source).to(:ja) }
49
+ it 'translate yaml string' do
50
+ expect(subject.lang).to eq(:ja)
51
+ end
52
+ end
53
+ end
54
+ end
44
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml-translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noritaka Horio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-14 00:00:00.000000000 Z
11
+ date: 2017-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: easy_translate