aloha_analyzer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/aloha_analyzer/follower.rb +2 -2
- data/lib/aloha_analyzer/version.rb +1 -1
- data/spec/aloha_analyzer/follower_spec.rb +10 -10
- metadata +2 -3
- data/lib/aloha_analyzer/analyzer.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d08ceafab57844e91f6ca11c53fc5795fe7df569
|
4
|
+
data.tar.gz: 1a848fb6ef23ea71805e4e614f6be79c2e07b67c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1ef328bcdc4aef0c5f554a7c4746f5c98f16ef12a404896ac43299cb39514f45c96e1db2e0415a0caf4e225379dacf0914672414e51a5b49f4d712f8414eb6b
|
7
|
+
data.tar.gz: 29d5e75a0c55224a2e1e8370b85c3906764d01606fac23c80cc33322adaaef467ff4908dceda78ffaf78245d0a5007516ee7747eec1da2d95f21e55355d652c4
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ module AlohaAnalyzer
|
|
17
17
|
counter
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def analyze!
|
21
21
|
response = client.followers(@screen_name, request_options).to_h
|
22
22
|
response[:users].each do |follower|
|
23
23
|
increment follower[:lang]
|
@@ -41,7 +41,7 @@ module AlohaAnalyzer
|
|
41
41
|
consumer_secret: @credentials[:consumer_secret],
|
42
42
|
access_token: @credentials[:access_token],
|
43
43
|
access_token_secret: @credentials[:access_token_secret]
|
44
|
-
|
44
|
+
)
|
45
45
|
end
|
46
46
|
|
47
47
|
def increment(language)
|
@@ -71,7 +71,7 @@ describe AlohaAnalyzer::Follower do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
describe '#
|
74
|
+
describe '#analyze!' do
|
75
75
|
let(:followers) do
|
76
76
|
{
|
77
77
|
"users" => [
|
@@ -103,13 +103,13 @@ describe AlohaAnalyzer::Follower do
|
|
103
103
|
|
104
104
|
context 'when first call' do
|
105
105
|
it 'sets the next cursor' do
|
106
|
-
subject.
|
106
|
+
subject.analyze!
|
107
107
|
|
108
108
|
subject.cursor.should eq next_cursor
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'calculates the langauges stats' do
|
112
|
-
subject.
|
112
|
+
subject.analyze!
|
113
113
|
|
114
114
|
subject.languages.should eq(
|
115
115
|
'en' => 2,
|
@@ -119,7 +119,7 @@ describe AlohaAnalyzer::Follower do
|
|
119
119
|
end
|
120
120
|
|
121
121
|
it 'updates the count value' do
|
122
|
-
subject.
|
122
|
+
subject.analyze!
|
123
123
|
|
124
124
|
subject.count.should eq 4
|
125
125
|
end
|
@@ -127,7 +127,7 @@ describe AlohaAnalyzer::Follower do
|
|
127
127
|
it 'creates a new twitter client' do
|
128
128
|
Twitter::REST::Client.should_receive(:new).and_call_original
|
129
129
|
|
130
|
-
subject.
|
130
|
+
subject.analyze!
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
@@ -156,7 +156,7 @@ describe AlohaAnalyzer::Follower do
|
|
156
156
|
let(:new_body) { new_followers.to_json }
|
157
157
|
|
158
158
|
before do
|
159
|
-
subject.
|
159
|
+
subject.analyze!
|
160
160
|
|
161
161
|
stub_get('/1.1/followers/list.json')
|
162
162
|
.with(query: new_query_args)
|
@@ -165,13 +165,13 @@ describe AlohaAnalyzer::Follower do
|
|
165
165
|
end
|
166
166
|
|
167
167
|
it 'sets the next cursor' do
|
168
|
-
subject.
|
168
|
+
subject.analyze!
|
169
169
|
|
170
170
|
subject.cursor.should eq new_next_cursor
|
171
171
|
end
|
172
172
|
|
173
173
|
it 'calculates the langauges stats' do
|
174
|
-
subject.
|
174
|
+
subject.analyze!
|
175
175
|
|
176
176
|
subject.languages.should eq(
|
177
177
|
'en' => 2,
|
@@ -182,7 +182,7 @@ describe AlohaAnalyzer::Follower do
|
|
182
182
|
end
|
183
183
|
|
184
184
|
it 'updates the count value' do
|
185
|
-
subject.
|
185
|
+
subject.analyze!
|
186
186
|
|
187
187
|
subject.count.should eq 8
|
188
188
|
end
|
@@ -190,7 +190,7 @@ describe AlohaAnalyzer::Follower do
|
|
190
190
|
it 'does not create another twitter client' do
|
191
191
|
Twitter::REST::Client.should_not_receive(:new)
|
192
192
|
|
193
|
-
subject.
|
193
|
+
subject.analyze!
|
194
194
|
end
|
195
195
|
end
|
196
196
|
end
|
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.0.
|
4
|
+
version: 0.0.3
|
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-02-
|
11
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -96,7 +96,6 @@ files:
|
|
96
96
|
- Rakefile
|
97
97
|
- aloha_analyzer.gemspec
|
98
98
|
- lib/aloha_analyzer.rb
|
99
|
-
- lib/aloha_analyzer/analyzer.rb
|
100
99
|
- lib/aloha_analyzer/follower.rb
|
101
100
|
- lib/aloha_analyzer/version.rb
|
102
101
|
- spec/aloha_analyzer/follower_spec.rb
|
File without changes
|