twitter_anonymous_client 1.0.0.0 → 1.0.1.0
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 +4 -4
- data/.rspec +0 -1
- data/.yardopts +7 -0
- data/CHANGELOG.md +13 -2
- data/lib/twitter/tweet.rb +9 -3
- data/lib/twitter_anonymous_client/version.rb +1 -1
- data/spec/tweet_spec.rb +47 -0
- data/spec/user_timeline_spec.rb +0 -23
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0c615511ec0a929d6e6a4f3864e6f7044c5101b
|
4
|
+
data.tar.gz: 242ad47be6e4cc3da41dca598d986000ee79f3b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc852c50244bec79788af1d27412e1f484d52adfa7fd8126a7a65eb63785c697bdd05684b05c7696224760c83ee49c9106b6efe62fb6566309e48dd9822e06b3
|
7
|
+
data.tar.gz: e6c5bdd3b7fcc61e756e1eb9ae540a3fce5a9231099b73abf27d6c33f8d6b767baf813122a31f5f20ac6f1d6841369a12405265436b76dae315cd8d7d3e7093c
|
data/.rspec
CHANGED
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
## [In git](https://github.com/elgalu/twitter_anonymous_client/compare/v1.0.
|
1
|
+
## [In git](https://github.com/elgalu/twitter_anonymous_client/compare/v1.0.1.0...HEAD)
|
2
2
|
|
3
3
|
### New Features
|
4
4
|
* n/a
|
@@ -9,6 +9,17 @@
|
|
9
9
|
### Chores
|
10
10
|
* n/a
|
11
11
|
|
12
|
+
## [v1.0.1.0](https://github.com/elgalu/twitter_anonymous_client/tree/v1.0.1.0)
|
13
|
+
|
14
|
+
### New Features
|
15
|
+
* Added Tweet#status_url to get the http link built easily. (Leo Gallucci)
|
16
|
+
|
17
|
+
### Bugfixes
|
18
|
+
* n/a
|
19
|
+
|
20
|
+
### Chores
|
21
|
+
* n/a
|
22
|
+
|
12
23
|
## [v1.0.0.0](https://github.com/elgalu/twitter_anonymous_client/tree/v1.0.0.0)
|
13
24
|
|
14
25
|
### New Features
|
@@ -19,7 +30,7 @@
|
|
19
30
|
|
20
31
|
### Chores
|
21
32
|
* Added documentation. (Leo Gallucci)
|
22
|
-
* Changed
|
33
|
+
* Changed conversioning system: 1.0 for twitter API and 0.0 for this gem version. (Leo Gallucci)
|
23
34
|
|
24
35
|
## [v0.0.1](https://github.com/elgalu/twitter_anonymous_client/tree/v0.0.1)
|
25
36
|
|
data/lib/twitter/tweet.rb
CHANGED
@@ -19,9 +19,10 @@ module Twitter
|
|
19
19
|
# #=> [#<Twitter::Tweet:0x07.. @id="3", @text="hello world", @created_at=#<DateTime: 2013-02-27>>]
|
20
20
|
def build_tweets(ary)
|
21
21
|
tweets = ary.map do |tweet|
|
22
|
-
args = { id:
|
23
|
-
text:
|
24
|
-
created_at:
|
22
|
+
args = { id: tweet['id'],
|
23
|
+
text: tweet['text'],
|
24
|
+
created_at: tweet['created_at'],
|
25
|
+
screen_name: tweet['user']['screen_name'] }
|
25
26
|
new(args)
|
26
27
|
end
|
27
28
|
end
|
@@ -33,5 +34,10 @@ module Twitter
|
|
33
34
|
attribute :id, String
|
34
35
|
attribute :text, String
|
35
36
|
attribute :created_at, DateTime
|
37
|
+
attribute :screen_name, String
|
38
|
+
|
39
|
+
def status_url
|
40
|
+
"https://twitter.com/#{screen_name}/status/#{id}"
|
41
|
+
end
|
36
42
|
end
|
37
43
|
end
|
data/spec/tweet_spec.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'support/spec_helper'
|
2
|
+
|
3
|
+
describe Twitter::Tweet do
|
4
|
+
let(:screen_name) { 'elgalu' }
|
5
|
+
let(:latest_tweet_text) { /Console Ruby debug is easy/ }
|
6
|
+
let(:url) { "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=#{screen_name}&count=1" }
|
7
|
+
|
8
|
+
let(:client) { Twitter::Client.new }
|
9
|
+
let(:tweets) { client.user_timeline(screen_name, count: 1) }
|
10
|
+
let(:first_tweet) { tweets.first }
|
11
|
+
|
12
|
+
before do
|
13
|
+
WebMock.reset!
|
14
|
+
stub_request(:get, url).to_return(:body => fixture("#{screen_name}_statuses.json"))
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'first tweet' do
|
18
|
+
it 'should be a Tweet' do
|
19
|
+
first_tweet.should be_a(Twitter::Tweet)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should respond to id' do
|
23
|
+
first_tweet.should respond_to(:id)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should respond to text' do
|
27
|
+
first_tweet.should respond_to(:text)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should respond to created_at' do
|
31
|
+
first_tweet.should respond_to(:created_at)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should respond to status_url' do
|
35
|
+
first_tweet.should respond_to(:status_url)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should contain proper text' do
|
39
|
+
first_tweet.should respond_to(:text)
|
40
|
+
first_tweet.text.should match(latest_tweet_text)
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should produce a status url' do
|
44
|
+
first_tweet.status_url.should == "https://twitter.com/elgalu/status/307606752055148545"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/spec/user_timeline_spec.rb
CHANGED
@@ -48,28 +48,5 @@ describe Twitter::Client do
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
context 'first tweet' do
|
52
|
-
it 'should be a Tweet' do
|
53
|
-
first_tweet.should be_a(Twitter::Tweet)
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'should respond to id' do
|
57
|
-
first_tweet.should respond_to(:id)
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'should respond to text' do
|
61
|
-
first_tweet.should respond_to(:text)
|
62
|
-
end
|
63
|
-
|
64
|
-
it 'should respond to created_at' do
|
65
|
-
first_tweet.should respond_to(:created_at)
|
66
|
-
end
|
67
|
-
|
68
|
-
it 'should contain proper text' do
|
69
|
-
first_tweet.should respond_to(:text)
|
70
|
-
first_tweet.text.should match(latest_tweet_text)
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
51
|
end
|
75
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter_anonymous_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leo Gallucci
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- .gitignore
|
147
147
|
- .rspec
|
148
148
|
- .travis.yml
|
149
|
+
- .yardopts
|
149
150
|
- CHANGELOG.md
|
150
151
|
- Gemfile
|
151
152
|
- LICENSE.md
|
@@ -160,6 +161,7 @@ files:
|
|
160
161
|
- lib/twitter_anonymous_client/version.rb
|
161
162
|
- spec/fixtures/elgalu_statuses.json
|
162
163
|
- spec/support/spec_helper.rb
|
164
|
+
- spec/tweet_spec.rb
|
163
165
|
- spec/twitter_anonymous_client_spec.rb
|
164
166
|
- spec/user_timeline_spec.rb
|
165
167
|
- twitter_anonymous_client.gemspec
|
@@ -190,6 +192,7 @@ summary: Twitter public (anonymous) client for old v1.0 API
|
|
190
192
|
test_files:
|
191
193
|
- spec/fixtures/elgalu_statuses.json
|
192
194
|
- spec/support/spec_helper.rb
|
195
|
+
- spec/tweet_spec.rb
|
193
196
|
- spec/twitter_anonymous_client_spec.rb
|
194
197
|
- spec/user_timeline_spec.rb
|
195
198
|
has_rdoc:
|