babelyoda 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ require_relative 'logger'
2
+
1
3
  module Babelyoda
2
4
  class Keyset
3
5
  attr_accessor :name
@@ -1,3 +1,3 @@
1
1
  module Babelyoda
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
3
3
  end
data/lib/babelyoda.rb CHANGED
@@ -201,29 +201,34 @@ namespace :babelyoda do
201
201
  dev_lang_strings = Babelyoda::Strings.new(filename, spec.development_language).read
202
202
  combined_keyset.merge!(dev_lang_strings)
203
203
  spec.localization_languages.each do |language|
204
- lang_strings = Babelyoda::Strings.new(filename, language).read
204
+ lang_strings = Babelyoda::Strings.new(File.localized(filename, language), language).read
205
205
  combined_keyset.merge!(lang_strings)
206
206
  end
207
207
  end
208
- $logger.info "#{spec.development_language}: #{combined_keyset.keys.size} keys"
209
- total_missing_count = combined_keyset.keys.size
210
-
211
- present = {}
212
- spec.localization_languages.each do |language|
213
- present[language] = Babelyoda::Keyset.new("babelyoda.verify.#{language}")
214
- end
215
208
  combined_keyset.drop_empty!
209
+
210
+ count = {}
211
+ spec.all_languages.each { |lang| count[lang.to_sym] = 0}
212
+
216
213
  combined_keyset.keys.each_value do |key|
217
- spec.localization_languages.each do |lang|
218
- present[lang.to_sym].merge_key!(key) if key.values.has_key?(lang.to_sym)
214
+ spec.all_languages.each do |lang|
215
+ count[lang.to_sym] += 1 if key.values.has_key?(lang.to_sym)
219
216
  end
220
217
  end
218
+
219
+ total_count = count[spec.development_language.to_sym]
220
+ $logger.info "#{spec.development_language}: #{total_count} keys"
221
+
222
+ all_found = true
221
223
  spec.localization_languages.each do |language|
222
- count = present[language].keys.size
223
- total_missing_count -= count
224
- $logger.error "#{language}: #{combined_keyset.keys.size - count} keys (#{count} translations missing)" if count > 0
224
+ lang_count = count[language.to_sym]
225
+ missing_count = total_count - lang_count
226
+ if missing_count > 0
227
+ $logger.error "#{language}: #{lang_count} keys (#{missing_count} translations missing)"
228
+ all_found = false
229
+ end
225
230
  end
226
- exit 1 if total_missing_count > 0
231
+ exit 1 unless all_found
227
232
  end
228
233
 
229
234
  namespace :remote do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babelyoda
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70227304242720 !ruby/object:Gem::Requirement
16
+ requirement: &70322929940960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: 2.8.0
25
25
  type: :development
26
26
  prerelease: false
27
- version_requirements: *70227304242720
27
+ version_requirements: *70322929940960
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: awesome_print
30
- requirement: &70227304241120 !ruby/object:Gem::Requirement
30
+ requirement: &70322929938420 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ~>
@@ -38,10 +38,10 @@ dependencies:
38
38
  version: 1.0.2
39
39
  type: :runtime
40
40
  prerelease: false
41
- version_requirements: *70227304241120
41
+ version_requirements: *70322929938420
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
- requirement: &70227304239460 !ruby/object:Gem::Requirement
44
+ requirement: &70322929935740 !ruby/object:Gem::Requirement
45
45
  none: false
46
46
  requirements:
47
47
  - - ~>
@@ -52,10 +52,10 @@ dependencies:
52
52
  version: 0.9.2.2
53
53
  type: :runtime
54
54
  prerelease: false
55
- version_requirements: *70227304239460
55
+ version_requirements: *70322929935740
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: active_support
58
- requirement: &70227304238220 !ruby/object:Gem::Requirement
58
+ requirement: &70322929933140 !ruby/object:Gem::Requirement
59
59
  none: false
60
60
  requirements:
61
61
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 3.0.0
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *70227304238220
69
+ version_requirements: *70322929933140
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rchardet19
72
- requirement: &70227304237000 !ruby/object:Gem::Requirement
72
+ requirement: &70322929929440 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -80,10 +80,10 @@ dependencies:
80
80
  version: 1.3.5
81
81
  type: :runtime
82
82
  prerelease: false
83
- version_requirements: *70227304237000
83
+ version_requirements: *70322929929440
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: builder
86
- requirement: &70227304235840 !ruby/object:Gem::Requirement
86
+ requirement: &70322929920800 !ruby/object:Gem::Requirement
87
87
  none: false
88
88
  requirements:
89
89
  - - ~>
@@ -94,10 +94,10 @@ dependencies:
94
94
  version: 3.0.0
95
95
  type: :runtime
96
96
  prerelease: false
97
- version_requirements: *70227304235840
97
+ version_requirements: *70322929920800
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: nokogiri
100
- requirement: &70227304234560 !ruby/object:Gem::Requirement
100
+ requirement: &70322929916980 !ruby/object:Gem::Requirement
101
101
  none: false
102
102
  requirements:
103
103
  - - ~>
@@ -108,10 +108,10 @@ dependencies:
108
108
  version: 1.5.0
109
109
  type: :runtime
110
110
  prerelease: false
111
- version_requirements: *70227304234560
111
+ version_requirements: *70322929916980
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: term-ansicolor
114
- requirement: &70227304233280 !ruby/object:Gem::Requirement
114
+ requirement: &70322929915060 !ruby/object:Gem::Requirement
115
115
  none: false
116
116
  requirements:
117
117
  - - ~>
@@ -122,10 +122,10 @@ dependencies:
122
122
  version: 1.0.7
123
123
  type: :runtime
124
124
  prerelease: false
125
- version_requirements: *70227304233280
125
+ version_requirements: *70322929915060
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: log4r-color
128
- requirement: &70227304231860 !ruby/object:Gem::Requirement
128
+ requirement: &70322929896260 !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ~>
@@ -133,7 +133,7 @@ dependencies:
133
133
  version: '1.2'
134
134
  type: :runtime
135
135
  prerelease: false
136
- version_requirements: *70227304231860
136
+ version_requirements: *70322929896260
137
137
  description: A simple utility to push/pull l10n resources of an Xcode project to/from
138
138
  the translators
139
139
  email:
@@ -181,12 +181,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
181
  - - ! '>='
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
+ segments:
185
+ - 0
186
+ hash: -3841547272139031711
184
187
  required_rubygems_version: !ruby/object:Gem::Requirement
185
188
  none: false
186
189
  requirements:
187
190
  - - ! '>='
188
191
  - !ruby/object:Gem::Version
189
192
  version: '0'
193
+ segments:
194
+ - 0
195
+ hash: -3841547272139031711
190
196
  requirements: []
191
197
  rubyforge_project: babelyoda
192
198
  rubygems_version: 1.8.10