twitter_anonymous_client 1.0.0.0 → 1.0.1.0

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: 8390855368ce290ddf4167692a24b1c6f9e58cd6
4
- data.tar.gz: 2f8e8b9bccb76a0635c01a153c95b860715465bf
3
+ metadata.gz: d0c615511ec0a929d6e6a4f3864e6f7044c5101b
4
+ data.tar.gz: 242ad47be6e4cc3da41dca598d986000ee79f3b7
5
5
  SHA512:
6
- metadata.gz: 0039269bf31e0a8f8a80f61fb64b0a0460dbc33fed135f199645e3dfc8808516db25562d5fdf43433a31bc258a2f7350428e690267b473164011a6c55af8f40b
7
- data.tar.gz: 305cbb70b6d413f8b21c76b52ce5f8f2dcccaca2397c6f4861c0ca30b63081c51d6e9637a76467e15ded31afe69430b7c3af59fa3d41b0446d29ac36978e50ea
6
+ metadata.gz: fc852c50244bec79788af1d27412e1f484d52adfa7fd8126a7a65eb63785c697bdd05684b05c7696224760c83ee49c9106b6efe62fb6566309e48dd9822e06b3
7
+ data.tar.gz: e6c5bdd3b7fcc61e756e1eb9ae540a3fce5a9231099b73abf27d6c33f8d6b767baf813122a31f5f20ac6f1d6841369a12405265436b76dae315cd8d7d3e7093c
data/.rspec CHANGED
@@ -1,4 +1,3 @@
1
1
  --format documentation
2
2
  --color
3
- --fail-fast
4
3
  --order random
data/.yardopts ADDED
@@ -0,0 +1,7 @@
1
+ --readme README.md
2
+ --title 'TwitterAnonymousClient API Documentation'
3
+ --charset utf-8
4
+ -
5
+ LICENSE.md
6
+ CHANGELOG.md
7
+
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## [In git](https://github.com/elgalu/twitter_anonymous_client/compare/v1.0.0.0...HEAD)
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 versioning system: 1.0 for twitter api and 0.0 for this gem version. (Leo Gallucci)
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: tweet['id'],
23
- text: tweet['text'],
24
- created_at: tweet['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
@@ -5,5 +5,5 @@ module TwitterAnonymousClient
5
5
  # The last 2 digits (c,d) are this gem version.
6
6
  # c is a major update or any update that breaks this gem API.
7
7
  # d is minor or bugfix update.
8
- VERSION = "1.0.0.0"
8
+ VERSION = "1.0.1.0"
9
9
  end
@@ -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
@@ -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.0.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: