aloha_analyzer 0.1.7 → 0.1.8

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: 407dc91bb62ef288b0953321564d81cf29de4af6
4
- data.tar.gz: 5acd3d9de60973db79022d7748ac31e920f2f19e
3
+ metadata.gz: 0acae8c2641f6d9abb0c3eff036d9863851b6e47
4
+ data.tar.gz: cc9494f19bb86b46feb22ce5aa2412ead5e1851e
5
5
  SHA512:
6
- metadata.gz: 194d513ba723ff46c88af6838f1e17e5e8486d9e0e39382375a9ca92fd654867193919613b874bbad70a7c7044f275b46b1a313d08fc5e6204d71269df28f780
7
- data.tar.gz: bb930a6597f41b582f8105122bd0b4681c69c46ed9bee8914dda1de0523980a282c2c799f5e584c8b8cb04589a0857fd003ec720d5ec287966d158897cc3723e
6
+ metadata.gz: 050ee0fd56f108a7acfec808ccc0dbf2bf7262410e59e7c4c3c2222df7dcda6e9ba67ce24e3d600ff36706db12e07eb13acbb348b768eec8313759bf4dba027d
7
+ data.tar.gz: 790123f96c672f8327c78f646989cb1c1d710e8be2ae805669a38cf56e3f8e31c892095c08c35925f553ed10bbe1fc49357d71a9e7707b2d9c3b5054cacd3e19
@@ -16,20 +16,20 @@ module AlohaAnalyzer
16
16
  @users.each do |user|
17
17
  abbreviation = user['lang']
18
18
  if abbreviation == @language
19
- analysys[:user_language][:count] += 1
20
- analysys[:user_language][:users].push user
19
+ analysys[:account_language][:count] += 1
20
+ analysys[:account_language][:users].push user
21
21
  else
22
- if analysys[:foreign_languages][abbreviation]
23
- analysys[:foreign_languages][abbreviation][:count] += 1
24
- analysys[:foreign_languages][abbreviation][:users].push user
22
+ if analysys[:non_account_languages][abbreviation]
23
+ analysys[:non_account_languages][abbreviation][:count] += 1
24
+ analysys[:non_account_languages][abbreviation][:users].push user
25
25
  else
26
- analysys[:foreign_languages][abbreviation] = {
26
+ analysys[:non_account_languages][abbreviation] = {
27
27
  :count => 1,
28
28
  :language => Language.find_by_abbreviation(abbreviation),
29
29
  :users => [user]
30
30
  }
31
31
  end
32
- analysys[:foreign_languages_count] += 1
32
+ analysys[:non_account_languages_count] += 1
33
33
  end
34
34
  analysys[:count] += 1
35
35
  end
@@ -41,14 +41,14 @@ module AlohaAnalyzer
41
41
 
42
42
  def boilerplate_analysis
43
43
  Hash.new.tap do |analysys|
44
- analysys[:user_language] = {
44
+ analysys[:account_language] = {
45
45
  count: 0,
46
46
  language: Language.find_by_abbreviation(@language),
47
47
  users: []
48
48
  }
49
- analysys[:foreign_languages_count] = 0
49
+ analysys[:non_account_languages_count] = 0
50
50
  analysys[:count] = 0
51
- analysys[:foreign_languages] = Hash.new
51
+ analysys[:non_account_languages] = Hash.new
52
52
  end
53
53
  end
54
54
 
@@ -1,3 +1,3 @@
1
1
  module AlohaAnalyzer
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
@@ -6,7 +6,7 @@
6
6
  - abbreviation: en
7
7
  name: English
8
8
  population: 238_000_000
9
- countries: 'USA, Canada, UK, Ireland, Australia'
9
+ countries: 'USA, UK, Canada, Ireland, Australia'
10
10
  greeting: 'hello!'
11
11
  - abbreviation: ar
12
12
  name: Arabic
@@ -53,17 +53,17 @@ describe AlohaAnalyzer::User do
53
53
  end
54
54
 
55
55
  it 'has no results with the user language' do
56
- subject[:user_language][:count].should eq 0
56
+ subject[:account_language][:count].should eq 0
57
57
  end
58
58
 
59
59
  it 'has no results without the user language' do
60
- subject[:foreign_languages].should eq({})
61
- subject[:foreign_languages_count].should eq 0
60
+ subject[:non_account_languages].should eq({})
61
+ subject[:non_account_languages_count].should eq 0
62
62
  end
63
63
 
64
64
  it 'includes the user lanugage' do
65
- subject[:user_language][:language].should eq(
66
- "abbreviation"=>"en", "name"=>"English", "population"=>238000000, "countries"=>"USA, Canada, UK, Ireland, Australia"
65
+ subject[:account_language][:language].should eq(
66
+ "abbreviation"=>"en", "greeting" => "hello!", "name"=>"English", "population"=>238000000, "countries"=>"USA, UK, Canada, Ireland, Australia"
67
67
  )
68
68
  end
69
69
  end
@@ -88,27 +88,27 @@ describe AlohaAnalyzer::User do
88
88
  end
89
89
 
90
90
  it 'includes the user lanugage' do
91
- subject[:user_language].should eq(
91
+ subject[:account_language].should eq(
92
92
  :count => 2,
93
- :language => {'abbreviation'=>'en', 'name'=>'English', 'population'=>238000000, "countries"=>"USA, Canada, UK, Ireland, Australia"},
93
+ :language => {'abbreviation'=>'en', 'name'=>'English', 'population'=>238000000, "countries"=>"USA, UK, Canada, Ireland, Australia", "greeting"=>"hello!"},
94
94
  :users => [{'id' => '1', 'lang' => 'en'}, {'id' => '3', 'lang' => 'en'}]
95
95
  )
96
96
  end
97
97
 
98
98
  it 'includs the foreign followers count' do
99
- subject[:foreign_languages_count].should eq 2
99
+ subject[:non_account_languages_count].should eq 2
100
100
  end
101
101
 
102
102
  it 'returns results based on the user language' do
103
- subject[:foreign_languages].should == {
103
+ subject[:non_account_languages].should == {
104
104
  'fr' => {
105
105
  count: 1,
106
- language: {'abbreviation'=>'fr', 'name'=>'French', 'population'=>14000000, "countries"=>"France, Canada, Belgium, Switzerland"},
106
+ language: {'abbreviation'=>'fr', 'name'=>'French', "greeting"=>"bonjour!", 'population'=>14000000, "countries"=>"France, Canada, Belgium, Switzerland"},
107
107
  users: [{'id' => '2', 'lang' => 'fr'}]
108
108
  },
109
109
  'de' => {
110
110
  count: 1,
111
- language: {'abbreviation'=>'de', 'name'=>'German', 'population'=>5000000, "countries"=>"Germany, Austria, Switzerland, Belgium"},
111
+ language: {'abbreviation'=>'de', 'name'=>'German', "greeting"=>"hallo!", 'population'=>5000000, "countries"=>"Germany, Austria, Switzerland, Belgium"},
112
112
  users: [{'id' => '4', 'lang' => 'de'}]
113
113
  }
114
114
  }
@@ -132,22 +132,22 @@ describe AlohaAnalyzer::User do
132
132
  end
133
133
 
134
134
  it 'includes the user lanugage' do
135
- subject[:user_language][:language].should eq(
136
- "abbreviation"=>"en", "name"=>"English", "population"=>238000000, "countries"=>"USA, Canada, UK, Ireland, Australia"
135
+ subject[:account_language][:language].should eq(
136
+ "abbreviation"=>"en", "greeting" => "hello!", "name"=>"English", "population"=>238000000, "countries"=>"USA, UK, Canada, Ireland, Australia"
137
137
  )
138
138
  end
139
139
 
140
140
  it 'returns results based on the user language' do
141
- subject[:user_language].should == {
141
+ subject[:account_language].should == {
142
142
  :count => 2,
143
- :language => {'abbreviation'=>'en', 'name'=>'English', 'population'=>238000000, 'countries' => 'USA, Canada, UK, Ireland, Australia'},
143
+ :language => {'abbreviation'=>'en', 'name'=>'English', 'population'=>238000000, 'countries' => 'USA, UK, Canada, Ireland, Australia', "greeting"=>"hello!"},
144
144
  :users => [{'id' => '1', 'lang' => 'en'}, {'id' => '2', 'lang' => 'en'}]
145
145
  }
146
146
  end
147
147
 
148
148
  it 'returns results results based on the non user language' do
149
- subject[:foreign_languages].should == {}
150
- subject[:foreign_languages_count].should eq 0
149
+ subject[:non_account_languages].should == {}
150
+ subject[:non_account_languages_count].should eq 0
151
151
  end
152
152
  end
153
153
 
@@ -169,27 +169,27 @@ describe AlohaAnalyzer::User do
169
169
  end
170
170
 
171
171
  it 'returns results based on the user language' do
172
- subject[:user_language].should == {
172
+ subject[:account_language].should == {
173
173
  :count => 0,
174
- :language => {"abbreviation"=>"en", "name"=>"English", "population"=>238000000, "countries"=>"USA, Canada, UK, Ireland, Australia"},
174
+ :language => {"abbreviation"=>"en", "greeting" => "hello!", "name"=>"English", "population"=>238000000, "countries"=>"USA, UK, Canada, Ireland, Australia"},
175
175
  :users => []
176
176
  }
177
177
  end
178
178
 
179
- it 'includes the correct foreign_languages_count' do
180
- subject[:foreign_languages_count].should eq 3
179
+ it 'includes the correct non_account_languages_count' do
180
+ subject[:non_account_languages_count].should eq 3
181
181
  end
182
182
 
183
183
  it 'returns results results based on the non user language' do
184
- subject[:foreign_languages].should eq(
184
+ subject[:non_account_languages].should eq(
185
185
  'fr' => {
186
186
  :count => 2,
187
- :language => { 'abbreviation'=>'fr', 'name'=>'French', 'population'=>14000000, 'countries' => 'France, Canada, Belgium, Switzerland' },
187
+ :language => { 'abbreviation'=>'fr', 'name'=>'French', "greeting"=>"bonjour!", 'population'=>14000000, 'countries' => 'France, Canada, Belgium, Switzerland' },
188
188
  :users => [{'id' => '2', 'lang' => 'fr'}, {'id' => '3', 'lang' => 'fr'}]
189
189
  },
190
190
  'de' => {
191
191
  :count => 1,
192
- :language => {'abbreviation'=>'de', 'name'=>'German', 'population'=>5000000, 'countries' => 'Germany, Austria, Switzerland, Belgium' },
192
+ :language => {'abbreviation'=>'de', 'name'=>'German', "greeting"=>"hallo!", 'population'=>5000000, 'countries' => 'Germany, Austria, Switzerland, Belgium' },
193
193
  :users => [{'id' => '1', 'lang' => 'de'}]
194
194
  }
195
195
  )
@@ -210,22 +210,22 @@ describe AlohaAnalyzer::User do
210
210
  end
211
211
 
212
212
  it 'includes the user lanugage' do
213
- subject[:user_language].should == {
213
+ subject[:account_language].should == {
214
214
  :count => 2,
215
- :language => { "abbreviation"=>"en", "name"=>"English", "population"=>238000000, "countries"=>"USA, Canada, UK, Ireland, Australia" },
215
+ :language => { "abbreviation"=>"en", "greeting" => "hello!", "name"=>"English", "population"=>238000000, "countries"=>"USA, UK, Canada, Ireland, Australia" },
216
216
  :users => [{'id' => '1', 'lang' => 'en'}, {'id' => '3', 'lang' => 'en'}]
217
217
  }
218
218
  end
219
219
 
220
- it 'includes the correct foreign_languages_count' do
221
- subject[:foreign_languages_count].should eq 1
220
+ it 'includes the correct non_account_languages_count' do
221
+ subject[:non_account_languages_count].should eq 1
222
222
  end
223
223
 
224
224
  it 'merges english and british' do
225
- subject[:foreign_languages].should eq(
225
+ subject[:non_account_languages].should eq(
226
226
  'fr' => {
227
227
  :count => 1,
228
- :language => {'abbreviation'=>'fr', 'name'=>'French', 'population'=>14000000, 'countries' => 'France, Canada, Belgium, Switzerland'},
228
+ :language => {'abbreviation'=>'fr', 'name'=>'French', "greeting"=>"bonjour!", 'population'=>14000000, 'countries' => 'France, Canada, Belgium, Switzerland'},
229
229
  :users => [{'id' => '2', 'lang' => 'fr'}]
230
230
  }
231
231
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aloha_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Aussaguel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-12 00:00:00.000000000 Z
11
+ date: 2014-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler