t 1.2.0 → 1.3.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.
data/README.md CHANGED
@@ -181,7 +181,7 @@ example, send a user a direct message only if he already follows you:
181
181
  t search timeline "query"
182
182
 
183
183
  ### Search Tweets in another user's timeline that match a specified query
184
- t search user @sferik "query"
184
+ t search timeline @sferik "query"
185
185
 
186
186
  ## Features
187
187
  * Deep search: Instead of using the Twitter Search API, [which only only goes
@@ -250,54 +250,6 @@ the original code.
250
250
  [removed]: https://github.com/jnunemaker/twitter/commit/dd2445e3e2c97f38b28a3f32ea902536b3897adf
251
251
  ![History](https://github.com/sferik/t/raw/master/screenshots/history.png)
252
252
 
253
- ## Contributing
254
- In the spirit of [free software][free-sw], **everyone** is encouraged to help
255
- improve this project.
256
-
257
- [free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
258
-
259
- Here are some ways *you* can contribute:
260
-
261
- * by using alpha, beta, and prerelease versions
262
- * by reporting bugs
263
- * by suggesting new features
264
- * by writing or editing documentation
265
- * by writing specifications
266
- * by writing code (**no patch is too small**: fix typos, add comments, clean up
267
- inconsistent whitespace)
268
- * by refactoring code
269
- * by fixing [issues][]
270
- * by reviewing patches
271
- * [financially][pledgie]
272
-
273
- [issues]: https://github.com/sferik/t/issues
274
-
275
- ## Submitting an Issue
276
- We use the [GitHub issue tracker][issues] to track bugs and features. Before
277
- submitting a bug report or feature request, check to make sure it hasn't
278
- already been submitted. When submitting a bug report, please include a [Gist][]
279
- that includes a stack trace and any details that may be necessary to reproduce
280
- the bug, including your gem version, Ruby version, and operating system.
281
- Ideally, a bug report should include a pull request with failing specs.
282
-
283
- [gist]: https://gist.github.com/
284
-
285
- ## Submitting a Pull Request
286
- 1. [Fork the repository.][fork]
287
- 2. [Create a topic branch.][branch]
288
- 3. Add specs for your unimplemented feature or bug fix.
289
- 4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
290
- 5. Implement your feature or bug fix.
291
- 6. Run `bundle exec rake spec`. If your specs fail, return to step 5.
292
- 7. Run `open coverage/index.html`. If your changes are not completely covered
293
- by your tests, return to step 3.
294
- 8. Add, commit, and push your changes.
295
- 9. [Submit a pull request.][pr]
296
-
297
- [fork]: http://help.github.com/fork-a-repo/
298
- [branch]: http://learn.github.com/p/branching.html
299
- [pr]: http://help.github.com/send-pull-requests/
300
-
301
253
  ## Supported Ruby Versions
302
254
  This library aims to support and is [tested against][travis] the following Ruby
303
255
  implementations:
data/lib/t/cli.rb CHANGED
@@ -465,16 +465,16 @@ module T
465
465
  method_option "sort", :aliases => "-s", :type => :string, :enum => %w(members mode posted slug subscribers), :default => "slug", :desc => "Specify the order of the results.", :banner => "ORDER"
466
466
  method_option "unsorted", :aliases => "-u", :type => :boolean, :default => false, :desc => "Output is not sorted."
467
467
  def lists(user=nil)
468
- if user
468
+ lists = if user
469
469
  require 't/core_ext/string'
470
470
  user = if options['id']
471
471
  user.to_i
472
472
  else
473
473
  user.strip_ats
474
474
  end
475
- end
476
- lists = collect_with_cursor do |cursor|
477
- client.lists(user, :cursor => cursor)
475
+ client.lists(user)
476
+ else
477
+ client.lists
478
478
  end
479
479
  print_lists(lists)
480
480
  end
data/lib/t/version.rb CHANGED
@@ -8,7 +8,7 @@ module T
8
8
 
9
9
  # @return [Integer]
10
10
  def self.minor
11
- 2
11
+ 3
12
12
  end
13
13
 
14
14
  # @return [Integer]
data/spec/cli_spec.rb CHANGED
@@ -1942,18 +1942,16 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
1942
1942
  describe "#lists" do
1943
1943
  before do
1944
1944
  stub_get("/1.1/lists/list.json").
1945
- with(:query => {:cursor => "-1"}).
1946
1945
  to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
1947
1946
  end
1948
1947
  it "should request the correct resource" do
1949
1948
  @cli.lists
1950
1949
  a_get("/1.1/lists/list.json").
1951
- with(:query => {:cursor => "-1"}).
1952
1950
  should have_been_made
1953
1951
  end
1954
1952
  it "should have the correct output" do
1955
1953
  @cli.lists
1956
- $stdout.string.chomp.should == "@sferik/code-for-america @sferik/presidents"
1954
+ $stdout.string.chomp.should == "@pengwynn/rubyists @twitter/team @sferik/test"
1957
1955
  end
1958
1956
  context "--csv" do
1959
1957
  before do
@@ -1963,8 +1961,9 @@ ID Since Last tweeted at Tweets Favorites Listed Following...
1963
1961
  @cli.lists
1964
1962
  $stdout.string.should == <<-eos
1965
1963
  ID,Created at,Screen name,Slug,Members,Subscribers,Mode,Description
1966
- 21718825,2010-09-14 21:46:56 +0000,sferik,code-for-america,26,5,public,Code for America
1967
- 8863586,2010-03-15 12:10:13 +0000,sferik,presidents,2,1,public,Presidents of the United States of America
1964
+ 1129440,2009-10-30 14:39:25 +0000,pengwynn,rubyists,499,39,public,""
1965
+ 574,2009-09-23 01:18:01 +0000,twitter,team,1199,78078,public,""
1966
+ 73546689,2012-07-08 22:19:05 +0000,sferik,test,2,0,private,""
1968
1967
  eos
1969
1968
  end
1970
1969
  end
@@ -1975,9 +1974,10 @@ ID,Created at,Screen name,Slug,Members,Subscribers,Mode,Description
1975
1974
  it "should output in long format" do
1976
1975
  @cli.lists
1977
1976
  $stdout.string.should == <<-eos
1978
- ID Created at Screen name Slug Members Subscribers ...
1979
- 21718825 Sep 14 2010 @sferik code-for-america 26 5 ...
1980
- 8863586 Mar 15 2010 @sferik presidents 2 1 ...
1977
+ ID Created at Screen name Slug Members Subscribers Mode ...
1978
+ 1129440 Oct 30 2009 @pengwynn rubyists 499 39 public
1979
+ 574 Sep 22 2009 @twitter team 1199 78078 public
1980
+ 73546689 Jul 8 14:19 @sferik test 2 0 private
1981
1981
  eos
1982
1982
  end
1983
1983
  end
@@ -1987,7 +1987,7 @@ ID Created at Screen name Slug Members Subscribers ...
1987
1987
  end
1988
1988
  it "should reverse the order of the sort" do
1989
1989
  @cli.lists
1990
- $stdout.string.chomp.should == "@sferik/presidents @sferik/code-for-america"
1990
+ $stdout.string.chomp.should == "@sferik/test @twitter/team @pengwynn/rubyists"
1991
1991
  end
1992
1992
  end
1993
1993
  context "--sort=members" do
@@ -1996,7 +1996,7 @@ ID Created at Screen name Slug Members Subscribers ...
1996
1996
  end
1997
1997
  it "should sort by the time when Twitter acount was created" do
1998
1998
  @cli.lists
1999
- $stdout.string.chomp.should == "@sferik/presidents @sferik/code-for-america"
1999
+ $stdout.string.chomp.should == "@sferik/test @pengwynn/rubyists @twitter/team"
2000
2000
  end
2001
2001
  end
2002
2002
  context "--sort=mode" do
@@ -2005,7 +2005,7 @@ ID Created at Screen name Slug Members Subscribers ...
2005
2005
  end
2006
2006
  it "should sort by the time when Twitter acount was created" do
2007
2007
  @cli.lists
2008
- $stdout.string.chomp.should == "@sferik/code-for-america @sferik/presidents"
2008
+ $stdout.string.chomp.should == "@sferik/test @twitter/team @pengwynn/rubyists"
2009
2009
  end
2010
2010
  end
2011
2011
  context "--sort=posted" do
@@ -2014,7 +2014,7 @@ ID Created at Screen name Slug Members Subscribers ...
2014
2014
  end
2015
2015
  it "should sort by the time when Twitter acount was created" do
2016
2016
  @cli.lists
2017
- $stdout.string.chomp.should == "@sferik/presidents @sferik/code-for-america"
2017
+ $stdout.string.chomp.should == "@twitter/team @pengwynn/rubyists @sferik/test"
2018
2018
  end
2019
2019
  end
2020
2020
  context "--sort=subscribers" do
@@ -2023,7 +2023,7 @@ ID Created at Screen name Slug Members Subscribers ...
2023
2023
  end
2024
2024
  it "should sort by the time when Twitter acount was created" do
2025
2025
  @cli.lists
2026
- $stdout.string.chomp.should == "@sferik/presidents @sferik/code-for-america"
2026
+ $stdout.string.chomp.should == "@sferik/test @pengwynn/rubyists @twitter/team"
2027
2027
  end
2028
2028
  end
2029
2029
  context "--unsorted" do
@@ -2032,32 +2032,32 @@ ID Created at Screen name Slug Members Subscribers ...
2032
2032
  end
2033
2033
  it "should not be sorted" do
2034
2034
  @cli.lists
2035
- $stdout.string.chomp.should == "@sferik/code-for-america @sferik/presidents"
2035
+ $stdout.string.chomp.should == "@pengwynn/rubyists @twitter/team @sferik/test"
2036
2036
  end
2037
2037
  end
2038
2038
  context "with a user passed" do
2039
2039
  before do
2040
2040
  stub_get("/1.1/lists/list.json").
2041
- with(:query => {:cursor => "-1", :screen_name => "sferik"}).
2041
+ with(:query => {:screen_name => "sferik"}).
2042
2042
  to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
2043
2043
  end
2044
2044
  it "should request the correct resource" do
2045
2045
  @cli.lists("sferik")
2046
2046
  a_get("/1.1/lists/list.json").
2047
- with(:query => {:cursor => "-1", :screen_name => "sferik"}).
2047
+ with(:query => {:screen_name => "sferik"}).
2048
2048
  should have_been_made
2049
2049
  end
2050
2050
  context "--id" do
2051
2051
  before do
2052
2052
  @cli.options = @cli.options.merge("id" => true)
2053
2053
  stub_get("/1.1/lists/list.json").
2054
- with(:query => {:cursor => "-1", :user_id => "7505382"}).
2054
+ with(:query => {:user_id => "7505382"}).
2055
2055
  to_return(:body => fixture("lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
2056
2056
  end
2057
2057
  it "should request the correct resource" do
2058
2058
  @cli.lists("7505382")
2059
2059
  a_get("/1.1/lists/list.json").
2060
- with(:query => {:cursor => "-1", :user_id => "7505382"}).
2060
+ with(:query => {:user_id => "7505382"}).
2061
2061
  should have_been_made
2062
2062
  end
2063
2063
  end
@@ -1,116 +1 @@
1
- {
2
- "lists": [
3
- {
4
- "slug": "code-for-america",
5
- "name": "code for america",
6
- "full_name": "@sferik/code-for-america",
7
- "description": "Code for America",
8
- "mode": "public",
9
- "uri": "/sferik/code-for-america",
10
- "user": {
11
- "id": 7505382,
12
- "profile_image_url": "http://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png",
13
- "url": "https://github.com/sferik",
14
- "created_at": "Mon Jul 16 12:59:01 +0000 2007",
15
- "followers_count": 2126,
16
- "default_profile": false,
17
- "profile_background_color": "000000",
18
- "lang": "en",
19
- "utc_offset": -28800,
20
- "name": "Erik Michaels-Ober",
21
- "profile_background_image_url": "http://a0.twimg.com/profile_background_images/162641967/we_concept_bg2.png",
22
- "location": "San Francisco",
23
- "profile_link_color": "0084B4",
24
- "listed_count": 115,
25
- "verified": false,
26
- "protected": false,
27
- "profile_use_background_image": true,
28
- "is_translator": false,
29
- "following": false,
30
- "description": "My heart is in the work.",
31
- "profile_text_color": "333333",
32
- "statuses_count": 6953,
33
- "screen_name": "sferik",
34
- "profile_image_url_https": "https://si0.twimg.com/profile_images/1759857427/image1326743606_normal.png",
35
- "time_zone": "Pacific Time (US & Canada)",
36
- "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/162641967/we_concept_bg2.png",
37
- "friends_count": 204,
38
- "default_profile_image": false,
39
- "contributors_enabled": false,
40
- "profile_sidebar_border_color": "C0DEED",
41
- "id_str": "7505382",
42
- "geo_enabled": true,
43
- "favourites_count": 3128,
44
- "profile_background_tile": false,
45
- "notifications": false,
46
- "show_all_inline_media": true,
47
- "profile_sidebar_fill_color": "DDEEF6",
48
- "follow_request_sent": false
49
- },
50
- "member_count": 26,
51
- "id_str": "21718825",
52
- "created_at": "Tue Sep 14 21:46:56 +0000 2010",
53
- "subscriber_count": 5,
54
- "following": false,
55
- "id": 21718825
56
- },
57
- {
58
- "slug": "presidents",
59
- "name": "presidents",
60
- "full_name": "@sferik/presidents",
61
- "description": "Presidents of the United States of America",
62
- "mode": "public",
63
- "uri": "/sferik/presidents",
64
- "user": {
65
- "id": 7505382,
66
- "profile_image_url": "http://a0.twimg.com/profile_images/1759857427/image1326743606_normal.png",
67
- "url": "https://github.com/sferik",
68
- "created_at": "Mon Jul 16 12:59:01 +0000 2007",
69
- "followers_count": 2126,
70
- "default_profile": false,
71
- "profile_background_color": "000000",
72
- "lang": "en",
73
- "utc_offset": -28800,
74
- "name": "Erik Michaels-Ober",
75
- "profile_background_image_url": "http://a0.twimg.com/profile_background_images/162641967/we_concept_bg2.png",
76
- "location": "San Francisco",
77
- "profile_link_color": "0084B4",
78
- "listed_count": 115,
79
- "verified": false,
80
- "protected": false,
81
- "profile_use_background_image": true,
82
- "is_translator": false,
83
- "following": false,
84
- "description": "My heart is in the work.",
85
- "profile_text_color": "333333",
86
- "statuses_count": 6953,
87
- "screen_name": "sferik",
88
- "profile_image_url_https": "https://si0.twimg.com/profile_images/1759857427/image1326743606_normal.png",
89
- "time_zone": "Pacific Time (US & Canada)",
90
- "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/162641967/we_concept_bg2.png",
91
- "friends_count": 204,
92
- "default_profile_image": false,
93
- "contributors_enabled": false,
94
- "profile_sidebar_border_color": "C0DEED",
95
- "id_str": "7505382",
96
- "geo_enabled": true,
97
- "favourites_count": 3128,
98
- "profile_background_tile": false,
99
- "notifications": false,
100
- "show_all_inline_media": true,
101
- "profile_sidebar_fill_color": "DDEEF6",
102
- "follow_request_sent": false
103
- },
104
- "member_count": 2,
105
- "id_str": "8863586",
106
- "created_at": "Mon Mar 15 12:10:13 +0000 2010",
107
- "subscriber_count": 1,
108
- "following": false,
109
- "id": 8863586
110
- }
111
- ],
112
- "next_cursor": 0,
113
- "previous_cursor": 0,
114
- "next_cursor_str": "0",
115
- "previous_cursor_str": "0"
116
- }
1
+ [{"uri":"\/pengwynn\/rubyists","name":"Rubyists","full_name":"@pengwynn\/rubyists","description":"","mode":"public","user":{"id":14100886,"profile_background_image_url_https":"https:\/\/si0.twimg.com\/images\/themes\/theme1\/bg.png","time_zone":"Central Time (US & Canada)","location":"Denton, TX","profile_background_image_url":"http:\/\/a0.twimg.com\/images\/themes\/theme1\/bg.png","id_str":"14100886","profile_link_color":"0084B4","geo_enabled":true,"default_profile":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/2221455972\/wynn-mic-bw_normal.jpg","utc_offset":-21600,"profile_use_background_image":false,"statuses_count":7384,"name":"Wynn Netherland","follow_request_sent":false,"profile_text_color":"333333","lang":"en","screen_name":"pengwynn","listed_count":397,"protected":false,"is_translator":false,"followers_count":6182,"profile_sidebar_border_color":"FFFFFF","description":"Christian, husband, father, GitHubber, Co-host of @thechangelog, Co-author of Sass, Compass, #CSS book http:\/\/wynn.fm\/sass-meap","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/2221455972\/wynn-mic-bw_normal.jpg","profile_background_tile":false,"following":true,"profile_sidebar_fill_color":"DDEEF6","default_profile_image":false,"url":"http:\/\/wynnnetherland.com","profile_banner_url":"https:\/\/si0.twimg.com\/profile_banners\/14100886\/1347987369","favourites_count":338,"created_at":"Sat Mar 08 16:34:22 +0000 2008","friends_count":3528,"verified":false,"notifications":false,"profile_background_color":"292929","contributors_enabled":false},"following":true,"created_at":"Fri Oct 30 14:39:25 +0000 2009","member_count":499,"id_str":"1129440","subscriber_count":39,"slug":"rubyists","id":1129440},{"uri":"\/twitter\/team","name":"Team","full_name":"@twitter\/team","description":"","mode":"public","user":{"id":783214,"profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/657090062\/l1uqey5sy82r9ijhke1i.png","time_zone":"Pacific Time (US & Canada)","location":"San Francisco, CA","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/657090062\/l1uqey5sy82r9ijhke1i.png","id_str":"783214","profile_link_color":"038543","geo_enabled":true,"default_profile":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/2284174758\/v65oai7fxn47qv9nectx_normal.png","utc_offset":-28800,"profile_use_background_image":true,"statuses_count":1433,"name":"Twitter","follow_request_sent":false,"profile_text_color":"333333","lang":"en","screen_name":"twitter","listed_count":73287,"protected":false,"followers_count":13711595,"profile_sidebar_border_color":"EEEEEE","is_translator":false,"description":"Always wondering what's happening. ","profile_background_tile":true,"following":true,"profile_sidebar_fill_color":"F6F6F6","default_profile_image":false,"url":"http:\/\/blog.twitter.com\/","profile_banner_url":"https:\/\/si0.twimg.com\/profile_banners\/783214\/1347405327","favourites_count":18,"created_at":"Tue Feb 20 14:35:54 +0000 2007","friends_count":1249,"verified":true,"notifications":false,"profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/2284174758\/v65oai7fxn47qv9nectx_normal.png","profile_background_color":"ACDED6","contributors_enabled":true},"following":true,"created_at":"Wed Sep 23 01:18:01 +0000 2009","member_count":1199,"id_str":"574","subscriber_count":78078,"slug":"team","id":574},{"uri":"\/sferik\/test","name":"test","full_name":"@sferik\/test","description":"","mode":"private","user":{"id":7505382,"profile_background_image_url_https":"https:\/\/si0.twimg.com\/profile_background_images\/665875854\/bb0b3653dcf0644e344823e0a2eb3382.png","time_zone":"Pacific Time (US & Canada)","location":"San Francisco","profile_background_image_url":"http:\/\/a0.twimg.com\/profile_background_images\/665875854\/bb0b3653dcf0644e344823e0a2eb3382.png","id_str":"7505382","profile_link_color":"0084B4","geo_enabled":true,"default_profile":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/1759857427\/image1326743606_normal.png","utc_offset":-28800,"profile_use_background_image":true,"statuses_count":8576,"name":"Erik Michaels-Ober","follow_request_sent":false,"profile_text_color":"333333","lang":"en","screen_name":"sferik","listed_count":129,"protected":false,"followers_count":2449,"profile_sidebar_border_color":"000000","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/1759857427\/image1326743606_normal.png","description":"An ingredient in your recipe.","is_translator":false,"profile_background_tile":false,"following":false,"profile_sidebar_fill_color":"DDEEF6","default_profile_image":false,"url":"https:\/\/github.com\/sferik","favourites_count":4321,"created_at":"Mon Jul 16 12:59:01 +0000 2007","friends_count":203,"verified":false,"notifications":false,"profile_background_color":"000000","contributors_enabled":false},"following":false,"created_at":"Sun Jul 08 22:19:05 +0000 2012","member_count":2,"id_str":"73546689","subscriber_count":0,"slug":"test","id":73546689}]
data/t.gemspec CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |gem|
10
10
  gem.add_dependency 'oauth', '~> 0.4'
11
11
  gem.add_dependency 'retryable', '~> 1.2'
12
12
  gem.add_dependency 'thor', ['>= 0.16', '< 2']
13
- gem.add_dependency 'tweetstream', '~> 2.2'
14
- gem.add_dependency 'twitter', '~> 4.0'
13
+ gem.add_dependency 'tweetstream', '~> 2.3'
14
+ gem.add_dependency 'twitter', '~> 4.1'
15
15
  gem.add_development_dependency 'pry'
16
16
  gem.add_development_dependency 'rake'
17
17
  gem.add_development_dependency 'rspec'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: t
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-26 00:00:00.000000000 Z
12
+ date: 2012-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: launchy
@@ -152,7 +152,7 @@ dependencies:
152
152
  requirements:
153
153
  - - ~>
154
154
  - !ruby/object:Gem::Version
155
- version: '2.2'
155
+ version: '2.3'
156
156
  type: :runtime
157
157
  prerelease: false
158
158
  version_requirements: !ruby/object:Gem::Requirement
@@ -160,7 +160,7 @@ dependencies:
160
160
  requirements:
161
161
  - - ~>
162
162
  - !ruby/object:Gem::Version
163
- version: '2.2'
163
+ version: '2.3'
164
164
  - !ruby/object:Gem::Dependency
165
165
  name: twitter
166
166
  requirement: !ruby/object:Gem::Requirement
@@ -168,7 +168,7 @@ dependencies:
168
168
  requirements:
169
169
  - - ~>
170
170
  - !ruby/object:Gem::Version
171
- version: '4.0'
171
+ version: '4.1'
172
172
  type: :runtime
173
173
  prerelease: false
174
174
  version_requirements: !ruby/object:Gem::Requirement
@@ -176,7 +176,7 @@ dependencies:
176
176
  requirements:
177
177
  - - ~>
178
178
  - !ruby/object:Gem::Version
179
- version: '4.0'
179
+ version: '4.1'
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: pry
182
182
  requirement: !ruby/object:Gem::Requirement