air18n 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -155,22 +155,36 @@ module Air18n
155
155
  months.each do |month, user_ids|
156
156
  user_ids.each do |user_id, locales|
157
157
  locales.each do |locale, days|
158
+
159
+ # Caalesce into monthly stats.
160
+ monthly_phrase_ids_word_counts_by_type = { false => {}, true => {} }
161
+ days.each do |_, phrase_ids_word_counts_by_type|
162
+ monthly_phrase_ids_word_counts_by_type[false].merge!(phrase_ids_word_counts_by_type[false])
163
+ end
164
+ days.each do |_, phrase_ids_word_counts_by_type|
165
+ phrase_ids_word_counts_by_type[true].each do |phrase_id, word_count|
166
+ if !monthly_phrase_ids_word_counts_by_type[false].include?(phrase_id)
167
+ monthly_phrase_ids_word_counts_by_type[true][phrase_id] = word_count
168
+ end
169
+ end
170
+ end
171
+
172
+ verification_sum_of_days = 0
173
+ translation_sum_of_days = 0
174
+
158
175
  if opts[:daily]
159
176
  days.each do |day, phrase_ids_word_counts_by_type|
160
- activities << {:year => year, :month => month, :day => day, :locale => locale, :user_id => user_id, :activity => construct_activity_new(phrase_ids_word_counts_by_type)}
161
- end
162
- else
163
- monthly_phrase_ids_word_counts_by_type = { false => {}, true => {} }
164
- days.each do |_, phrase_ids_word_counts_by_type|
165
- monthly_phrase_ids_word_counts_by_type[false].merge!(phrase_ids_word_counts_by_type[false])
166
- end
167
- days.each do |_, phrase_ids_word_counts_by_type|
177
+ daily_phrase_ids_word_counts_by_type = { false => phrase_ids_word_counts_by_type[false], true => {} }
168
178
  phrase_ids_word_counts_by_type[true].each do |phrase_id, word_count|
169
179
  if !monthly_phrase_ids_word_counts_by_type[false].include?(phrase_id)
170
- monthly_phrase_ids_word_counts_by_type[true][phrase_id] = word_count
180
+ daily_phrase_ids_word_counts_by_type[true][phrase_id] = word_count
171
181
  end
172
182
  end
183
+ activities << {:year => year, :month => month, :day => day, :locale => locale, :user_id => user_id, :activity => construct_activity_new(daily_phrase_ids_word_counts_by_type)}
184
+ translation_sum_of_days += activities.last[:activity][:word_count_translations]
185
+ verification_sum_of_days += activities.last[:activity][:word_count_verifications]
173
186
  end
187
+ else
174
188
  activity = construct_activity_new(monthly_phrase_ids_word_counts_by_type)
175
189
  activities << {:year => year, :month => month, :locale => locale, :user_id => user_id, :activity => activity}
176
190
  end
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
data/make_gem CHANGED
@@ -1,5 +1,5 @@
1
1
  # Run this to push the new version of the gem to rubygems!
2
- v=0.1.10
2
+ v=0.1.11
3
3
  gem build air18n.gemspec
4
4
  gem push air18n-${v}.gem
5
5
 
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.1.10
4
+ version: 0.1.11
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: 2012-09-17 00:00:00.000000000 Z
16
+ date: 2012-09-18 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: i18n