translation 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f220780138083246a7e89af3a5be22755bffed3f
4
- data.tar.gz: 813d658f8cd40f6baf0891da1942917db95ccdf0
3
+ metadata.gz: db4d6b962cc2aa655a324995d02eb1e99e9065d6
4
+ data.tar.gz: a635e68461163cea70010e1063a83da07cb22b1a
5
5
  SHA512:
6
- metadata.gz: 129e6253e5f5f1a8032e618c9b6cf5e5469449230a5e05779c5ee1835b471080e98cff1b411f1c8064debd431f5e6f49fbd85a7dd3fcd61bac091ef60d70e78e
7
- data.tar.gz: 6b3604af2e1fb9288adbc134e9d117b659490620e895566a14b051097722788af36a74ba1cb273805c7b8c38e318d133c26c2c2cc9d621d382f308b91792e5b9
6
+ metadata.gz: e4a0a5df938a4a7c88bd46f664bbdaad49508c1b57075107d43fe753441c1b56ecf1e9eb151f2de01e0180dd1a50dd5c53bc0bb7aa528dda4b485e3038c69f41
7
+ data.tar.gz: 2d4da898973d17b88c8cfd39560d470e421f2dbf8200d9882e09e40023779ddd1cd6bf744de8b2dd9c48c4b4916453218dfd526dfa0cbd00d5864f4258f5fd18
@@ -14,7 +14,12 @@ module TranslationIO
14
14
  if locale_file_removable?(locale_file_path)
15
15
  if File.exist?(locale_file_path)
16
16
  content_hash = YAML::load(File.read(locale_file_path))
17
- new_content_hash = content_hash.keep_if { |k| k.to_s == @source_locale.to_s }
17
+
18
+ if content_hash
19
+ new_content_hash = content_hash.keep_if { |k| k.to_s == @source_locale.to_s }
20
+ else # loading an empty file returns false
21
+ new_content_hash = {}
22
+ end
18
23
 
19
24
  if new_content_hash.keys.any?
20
25
  TranslationIO.info "Rewriting #{locale_file_path}", 2, 2
@@ -27,7 +27,12 @@ module TranslationIO
27
27
 
28
28
  def get_flat_translations_for_yaml_data(yaml_data)
29
29
  translations = YAML::load(yaml_data)
30
- return FlatHash.to_flat_hash(translations)
30
+
31
+ if translations
32
+ return FlatHash.to_flat_hash(translations)
33
+ else # loading an empty file returns false
34
+ return {}
35
+ end
31
36
  end
32
37
 
33
38
  def get_yaml_data_from_flat_translations(flat_translations)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: translation
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
  - Aurelien Malisart
@@ -9,62 +9,62 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-05 00:00:00.000000000 Z
12
+ date: 2014-09-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gettext
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: 3.1.2
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: 3.1.2
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - '>='
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - '>='
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rails
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ">="
60
+ - - '>='
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ">="
67
+ - - '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  description: Rails translation made _("simple") with YAML and GetText.
@@ -73,24 +73,23 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - README.md
77
76
  - lib/translation.rb
78
- - lib/translation_io/client.rb
79
- - lib/translation_io/client/base_operation.rb
80
77
  - lib/translation_io/client/base_operation/create_new_mo_files_step.rb
81
78
  - lib/translation_io/client/base_operation/dump_haml_gettext_keys_step.rb
82
79
  - lib/translation_io/client/base_operation/dump_slim_gettext_keys_step.rb
83
80
  - lib/translation_io/client/base_operation/save_new_po_files_step.rb
84
81
  - lib/translation_io/client/base_operation/save_new_yaml_files_step.rb
85
82
  - lib/translation_io/client/base_operation/save_special_yaml_files_step.rb
86
- - lib/translation_io/client/init_operation.rb
83
+ - lib/translation_io/client/base_operation.rb
87
84
  - lib/translation_io/client/init_operation/cleanup_yaml_files_step.rb
88
85
  - lib/translation_io/client/init_operation/create_yaml_po_files_step.rb
89
86
  - lib/translation_io/client/init_operation/update_and_collect_po_files_step.rb
90
87
  - lib/translation_io/client/init_operation/update_pot_file_step.rb
91
- - lib/translation_io/client/sync_operation.rb
88
+ - lib/translation_io/client/init_operation.rb
92
89
  - lib/translation_io/client/sync_operation/create_yaml_pot_file_step.rb
93
90
  - lib/translation_io/client/sync_operation/update_and_collect_pot_file_step.rb
91
+ - lib/translation_io/client/sync_operation.rb
92
+ - lib/translation_io/client.rb
94
93
  - lib/translation_io/config.rb
95
94
  - lib/translation_io/controller.rb
96
95
  - lib/translation_io/extractor.rb
@@ -99,6 +98,7 @@ files:
99
98
  - lib/translation_io/tasks.rb
100
99
  - lib/translation_io/yaml_conversion.rb
101
100
  - lib/translation_io/yaml_entry.rb
101
+ - README.md
102
102
  homepage: http://rails.translation.io
103
103
  licenses:
104
104
  - MIT
@@ -109,18 +109,19 @@ require_paths:
109
109
  - lib
110
110
  required_ruby_version: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - ">="
112
+ - - '>='
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ">="
117
+ - - '>='
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 2.2.0
122
+ rubygems_version: 2.0.0
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Rails translation made _("simple") with YAML and GetText.
126
126
  test_files: []
127
+ has_rdoc: false