t 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -2
- data/lib/t/cli.rb +43 -36
- data/lib/t/collectable.rb +3 -15
- data/lib/t/delete.rb +9 -4
- data/lib/t/list.rb +11 -6
- data/lib/t/printable.rb +7 -7
- data/lib/t/search.rb +40 -14
- data/lib/t/set.rb +5 -0
- data/lib/t/stream.rb +21 -13
- data/lib/t/utils.rb +16 -0
- data/lib/t/version.rb +1 -1
- data/spec/cli_spec.rb +538 -440
- data/spec/delete_spec.rb +24 -24
- data/spec/fixtures/200_direct_messages.json +27054 -0
- data/spec/fixtures/200_statuses.json +1 -0
- data/spec/fixtures/geo.kml +64 -0
- data/spec/fixtures/geo_no_city.kml +24 -0
- data/spec/fixtures/geo_no_state.kml +16 -0
- data/spec/fixtures/search.json +1 -1
- data/spec/fixtures/search_with_entities.json +1 -0
- data/spec/fixtures/status_no_place.json +72 -0
- data/spec/fixtures/status_with_mention.json +1 -0
- data/spec/fixtures/statuses.json +1 -1
- data/spec/list_spec.rb +94 -100
- data/spec/rcfile_spec.rb +21 -21
- data/spec/search_spec.rb +788 -189
- data/spec/set_spec.rb +19 -19
- data/spec/utils_spec.rb +1 -1
- data/t.gemspec +34 -33
- metadata +22 -5
data/spec/set_spec.rb
CHANGED
@@ -22,24 +22,24 @@ describe T::Set do
|
|
22
22
|
before do
|
23
23
|
@set.options = @set.options.merge("profile" => fixture_path + "/.trc_set")
|
24
24
|
end
|
25
|
-
it "
|
25
|
+
it "has the correct output" do
|
26
26
|
@set.active("testcli", "abc123")
|
27
27
|
expect($stdout.string.chomp).to eq "Active account has been updated to testcli."
|
28
28
|
end
|
29
|
-
it "
|
29
|
+
it "accepts an account name without a consumer key" do
|
30
30
|
@set.active("testcli")
|
31
31
|
expect($stdout.string.chomp).to eq "Active account has been updated to testcli."
|
32
32
|
end
|
33
|
-
it "
|
33
|
+
it "is case insensitive" do
|
34
34
|
@set.active("TestCLI", "abc123")
|
35
35
|
expect($stdout.string.chomp).to eq "Active account has been updated to testcli."
|
36
36
|
end
|
37
|
-
it "
|
37
|
+
it "raises an error if username is ambiguous" do
|
38
38
|
expect do
|
39
39
|
@set.active("test", "abc123")
|
40
40
|
end.to raise_error(ArgumentError, /Username test is ambiguous/)
|
41
41
|
end
|
42
|
-
it "
|
42
|
+
it "raises an error if the username is not found" do
|
43
43
|
expect do
|
44
44
|
@set.active("clitest")
|
45
45
|
end.to raise_error(ArgumentError, /Username clitest is not found/)
|
@@ -51,11 +51,11 @@ describe T::Set do
|
|
51
51
|
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
|
52
52
|
stub_post("/1.1/account/update_profile.json").with(:body => {:description => "Vagabond."}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
53
53
|
end
|
54
|
-
it "
|
54
|
+
it "requests the correct resource" do
|
55
55
|
@set.bio("Vagabond.")
|
56
56
|
expect(a_post("/1.1/account/update_profile.json").with(:body => {:description => "Vagabond."})).to have_been_made
|
57
57
|
end
|
58
|
-
it "
|
58
|
+
it "has the correct output" do
|
59
59
|
@set.bio("Vagabond.")
|
60
60
|
expect($stdout.string.chomp).to eq "@testcli's bio has been updated."
|
61
61
|
end
|
@@ -66,11 +66,11 @@ describe T::Set do
|
|
66
66
|
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
|
67
67
|
stub_post("/1.1/account/settings.json").with(:body => {:lang => "en"}).to_return(:body => fixture("settings.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
68
68
|
end
|
69
|
-
it "
|
69
|
+
it "requests the correct resource" do
|
70
70
|
@set.language("en")
|
71
71
|
expect(a_post("/1.1/account/settings.json").with(:body => {:lang => "en"})).to have_been_made
|
72
72
|
end
|
73
|
-
it "
|
73
|
+
it "has the correct output" do
|
74
74
|
@set.language("en")
|
75
75
|
expect($stdout.string.chomp).to eq "@testcli's language has been updated."
|
76
76
|
end
|
@@ -81,11 +81,11 @@ describe T::Set do
|
|
81
81
|
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
|
82
82
|
stub_post("/1.1/account/update_profile.json").with(:body => {:location => "San Francisco"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
83
83
|
end
|
84
|
-
it "
|
84
|
+
it "requests the correct resource" do
|
85
85
|
@set.location("San Francisco")
|
86
86
|
expect(a_post("/1.1/account/update_profile.json").with(:body => {:location => "San Francisco"})).to have_been_made
|
87
87
|
end
|
88
|
-
it "
|
88
|
+
it "has the correct output" do
|
89
89
|
@set.location("San Francisco")
|
90
90
|
expect($stdout.string.chomp).to eq "@testcli's location has been updated."
|
91
91
|
end
|
@@ -96,11 +96,11 @@ describe T::Set do
|
|
96
96
|
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
|
97
97
|
stub_post("/1.1/account/update_profile.json").with(:body => {:name => "Erik Michaels-Ober"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
98
98
|
end
|
99
|
-
it "
|
99
|
+
it "requests the correct resource" do
|
100
100
|
@set.name("Erik Michaels-Ober")
|
101
101
|
expect(a_post("/1.1/account/update_profile.json").with(:body => {:name => "Erik Michaels-Ober"})).to have_been_made
|
102
102
|
end
|
103
|
-
it "
|
103
|
+
it "has the correct output" do
|
104
104
|
@set.name("Erik Michaels-Ober")
|
105
105
|
expect($stdout.string.chomp).to eq "@testcli's name has been updated."
|
106
106
|
end
|
@@ -111,11 +111,11 @@ describe T::Set do
|
|
111
111
|
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
|
112
112
|
stub_post("/1.1/account/update_profile_background_image.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
113
113
|
end
|
114
|
-
it "
|
114
|
+
it "requests the correct resource" do
|
115
115
|
@set.profile_background_image(fixture_path + "/we_concept_bg2.png")
|
116
116
|
expect(a_post("/1.1/account/update_profile_background_image.json")).to have_been_made
|
117
117
|
end
|
118
|
-
it "
|
118
|
+
it "has the correct output" do
|
119
119
|
@set.profile_background_image(fixture_path + "/we_concept_bg2.png")
|
120
120
|
expect($stdout.string.chomp).to eq "@testcli's background image has been updated."
|
121
121
|
end
|
@@ -126,11 +126,11 @@ describe T::Set do
|
|
126
126
|
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
|
127
127
|
stub_post("/1.1/account/update_profile_image.json").to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
128
128
|
end
|
129
|
-
it "
|
129
|
+
it "requests the correct resource" do
|
130
130
|
@set.profile_image(fixture_path + "/me.jpg")
|
131
131
|
expect(a_post("/1.1/account/update_profile_image.json")).to have_been_made
|
132
132
|
end
|
133
|
-
it "
|
133
|
+
it "has the correct output" do
|
134
134
|
@set.profile_image(fixture_path + "/me.jpg")
|
135
135
|
expect($stdout.string.chomp).to eq "@testcli's image has been updated."
|
136
136
|
end
|
@@ -141,11 +141,11 @@ describe T::Set do
|
|
141
141
|
@set.options = @set.options.merge("profile" => fixture_path + "/.trc")
|
142
142
|
stub_post("/1.1/account/update_profile.json").with(:body => {:url => "https://github.com/sferik"}).to_return(:body => fixture("sferik.json"), :headers => {:content_type => "application/json; charset=utf-8"})
|
143
143
|
end
|
144
|
-
it "
|
144
|
+
it "requests the correct resource" do
|
145
145
|
@set.url("https://github.com/sferik")
|
146
146
|
expect(a_post("/1.1/account/update_profile.json").with(:body => {:url => "https://github.com/sferik"})).to have_been_made
|
147
147
|
end
|
148
|
-
it "
|
148
|
+
it "has the correct output" do
|
149
149
|
@set.url("https://github.com/sferik")
|
150
150
|
expect($stdout.string.chomp).to eq "@testcli's URL has been updated."
|
151
151
|
end
|
data/spec/utils_spec.rb
CHANGED
data/t.gemspec
CHANGED
@@ -1,37 +1,38 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require File.expand_path("../lib/t/version", __FILE__)
|
3
3
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.add_dependency 'launchy', '~> 2.0'
|
6
|
+
spec.add_dependency 'fastercsv', '~> 1.5'
|
7
|
+
spec.add_dependency 'geokit', '~> 1.6'
|
8
|
+
spec.add_dependency 'htmlentities', '~> 4.3'
|
9
|
+
spec.add_dependency 'oauth', '~> 0.4'
|
10
|
+
spec.add_dependency 'oj', '~> 1.4'
|
11
|
+
spec.add_dependency 'retryable', '~> 1.2'
|
12
|
+
spec.add_dependency 'thor', ['>= 0.16', '< 2']
|
13
|
+
spec.add_dependency 'tweetstream', '~> 2.3'
|
14
|
+
spec.add_dependency 'twitter', '~> 4.2'
|
15
|
+
spec.add_development_dependency 'pry'
|
16
|
+
spec.add_development_dependency 'rake'
|
17
|
+
spec.add_development_dependency 'rspec'
|
18
|
+
spec.add_development_dependency 'simplecov'
|
19
|
+
spec.add_development_dependency 'timecop'
|
20
|
+
spec.add_development_dependency 'webmock'
|
21
|
+
spec.author = "Erik Michaels-Ober"
|
22
|
+
spec.bindir = 'bin'
|
23
|
+
spec.description = %q{A command-line power tool for Twitter.}
|
24
|
+
spec.email = 'sferik@gmail.com'
|
25
|
+
spec.executables = %w(t)
|
26
|
+
spec.files = %w(LICENSE.md README.md Rakefile t.gemspec)
|
27
|
+
spec.files += Dir.glob("lib/**/*.rb")
|
28
|
+
spec.files += Dir.glob("bin/**/*")
|
29
|
+
spec.files += Dir.glob("spec/**/*")
|
30
|
+
spec.homepage = 'http://sferik.github.com/t/'
|
31
|
+
spec.licenses = ['MIT']
|
32
|
+
spec.name = 't'
|
33
|
+
spec.require_paths = ['lib']
|
34
|
+
spec.required_rubygems_version = Gem::Requirement.new(">= 1.3.6")
|
35
|
+
spec.summary = %q{CLI for Twitter}
|
36
|
+
spec.test_files = Dir.glob("spec/**/*")
|
37
|
+
spec.version = T::Version.to_s
|
37
38
|
end
|
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.
|
4
|
+
version: 1.5.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-
|
12
|
+
date: 2012-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: launchy
|
@@ -168,7 +168,7 @@ dependencies:
|
|
168
168
|
requirements:
|
169
169
|
- - ~>
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version: '4.
|
171
|
+
version: '4.2'
|
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.
|
179
|
+
version: '4.2'
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: pry
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
@@ -302,6 +302,8 @@ files:
|
|
302
302
|
- lib/t.rb
|
303
303
|
- spec/cli_spec.rb
|
304
304
|
- spec/delete_spec.rb
|
305
|
+
- spec/fixtures/200_direct_messages.json
|
306
|
+
- spec/fixtures/200_statuses.json
|
305
307
|
- spec/fixtures/501_ids.json
|
306
308
|
- spec/fixtures/501_users_list.json
|
307
309
|
- spec/fixtures/access_token
|
@@ -317,6 +319,9 @@ files:
|
|
317
319
|
- spec/fixtures/following.json
|
318
320
|
- spec/fixtures/friends_ids.json
|
319
321
|
- spec/fixtures/gem.json
|
322
|
+
- spec/fixtures/geo.kml
|
323
|
+
- spec/fixtures/geo_no_city.kml
|
324
|
+
- spec/fixtures/geo_no_state.kml
|
320
325
|
- spec/fixtures/geoplugin.xml
|
321
326
|
- spec/fixtures/list.json
|
322
327
|
- spec/fixtures/lists.json
|
@@ -330,6 +335,7 @@ files:
|
|
330
335
|
- spec/fixtures/request_token
|
331
336
|
- spec/fixtures/retweet.json
|
332
337
|
- spec/fixtures/search.json
|
338
|
+
- spec/fixtures/search_with_entities.json
|
333
339
|
- spec/fixtures/settings.json
|
334
340
|
- spec/fixtures/sferik.json
|
335
341
|
- spec/fixtures/status.json
|
@@ -337,7 +343,9 @@ files:
|
|
337
343
|
- spec/fixtures/status_no_country.json
|
338
344
|
- spec/fixtures/status_no_full_name.json
|
339
345
|
- spec/fixtures/status_no_locality.json
|
346
|
+
- spec/fixtures/status_no_place.json
|
340
347
|
- spec/fixtures/status_no_street_address.json
|
348
|
+
- spec/fixtures/status_with_mention.json
|
341
349
|
- spec/fixtures/statuses.json
|
342
350
|
- spec/fixtures/trends.json
|
343
351
|
- spec/fixtures/true.json
|
@@ -352,7 +360,8 @@ files:
|
|
352
360
|
- spec/stream_spec.rb
|
353
361
|
- spec/utils_spec.rb
|
354
362
|
homepage: http://sferik.github.com/t/
|
355
|
-
licenses:
|
363
|
+
licenses:
|
364
|
+
- MIT
|
356
365
|
post_install_message:
|
357
366
|
rdoc_options: []
|
358
367
|
require_paths:
|
@@ -378,6 +387,8 @@ summary: CLI for Twitter
|
|
378
387
|
test_files:
|
379
388
|
- spec/cli_spec.rb
|
380
389
|
- spec/delete_spec.rb
|
390
|
+
- spec/fixtures/200_direct_messages.json
|
391
|
+
- spec/fixtures/200_statuses.json
|
381
392
|
- spec/fixtures/501_ids.json
|
382
393
|
- spec/fixtures/501_users_list.json
|
383
394
|
- spec/fixtures/access_token
|
@@ -393,6 +404,9 @@ test_files:
|
|
393
404
|
- spec/fixtures/following.json
|
394
405
|
- spec/fixtures/friends_ids.json
|
395
406
|
- spec/fixtures/gem.json
|
407
|
+
- spec/fixtures/geo.kml
|
408
|
+
- spec/fixtures/geo_no_city.kml
|
409
|
+
- spec/fixtures/geo_no_state.kml
|
396
410
|
- spec/fixtures/geoplugin.xml
|
397
411
|
- spec/fixtures/list.json
|
398
412
|
- spec/fixtures/lists.json
|
@@ -406,6 +420,7 @@ test_files:
|
|
406
420
|
- spec/fixtures/request_token
|
407
421
|
- spec/fixtures/retweet.json
|
408
422
|
- spec/fixtures/search.json
|
423
|
+
- spec/fixtures/search_with_entities.json
|
409
424
|
- spec/fixtures/settings.json
|
410
425
|
- spec/fixtures/sferik.json
|
411
426
|
- spec/fixtures/status.json
|
@@ -413,7 +428,9 @@ test_files:
|
|
413
428
|
- spec/fixtures/status_no_country.json
|
414
429
|
- spec/fixtures/status_no_full_name.json
|
415
430
|
- spec/fixtures/status_no_locality.json
|
431
|
+
- spec/fixtures/status_no_place.json
|
416
432
|
- spec/fixtures/status_no_street_address.json
|
433
|
+
- spec/fixtures/status_with_mention.json
|
417
434
|
- spec/fixtures/statuses.json
|
418
435
|
- spec/fixtures/trends.json
|
419
436
|
- spec/fixtures/true.json
|