t 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d38506231ac0e5396f49bdcdc9362c1da7bfbe44
4
+ data.tar.gz: 8b3f17f4da2ad040d1742e5b58111ac0cc1592ed
5
+ SHA512:
6
+ metadata.gz: 2871a66a71f8cf6e383dc3abb1503d8436aa9356cef66190f526f9593c1c654f75f7c3a33c2f6a5037df835359bd4ecf90b14bcc840cce28384a345506e6f422
7
+ data.tar.gz: 00dc2f7960b5c679b6d501955717c2b31c2a5e21a2a41b1c5996b15e9d1029217f5afafb00c0a6ed374a3aefd5d7177bf6ce45d75ec87e48dcde71380c17f6fc
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ �B�����8�.A�;�6� V�o�^H(4��yXr$��^��[J
2
+ �_���u���TQr�*Z�]2�y �V6��i'�&�l~+���l��x����fA�hˡⷖ�^=Za/E2óS�*�@�W���d�[�:=Ej��0Q�m�.˥<\��侵�jL5����:^.D\!��u����Jjt�����Ik�Ubp�=��g�ý��V>��_��)~%*fW���+B)uKv-A��؁��ގh����E{�
data/lib/t/cli.rb CHANGED
@@ -125,6 +125,7 @@ module T
125
125
  desc 'direct_messages', "Returns the #{DEFAULT_NUM_RESULTS} most recent Direct Messages sent to you."
126
126
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
127
127
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
128
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
128
129
  method_option 'number', :aliases => '-n', :type => :numeric, :default => DEFAULT_NUM_RESULTS, :desc => 'Limit the number of results.'
129
130
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
130
131
  def direct_messages
@@ -157,6 +158,7 @@ module T
157
158
  desc 'direct_messages_sent', "Returns the #{DEFAULT_NUM_RESULTS} most recent Direct Messages you've sent."
158
159
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
159
160
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
161
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
160
162
  method_option 'number', :aliases => '-n', :type => :numeric, :default => DEFAULT_NUM_RESULTS, :desc => 'Limit the number of results.'
161
163
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
162
164
  def direct_messages_sent
@@ -190,6 +192,7 @@ module T
190
192
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
191
193
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
192
194
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
195
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
193
196
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
194
197
  method_option 'sort', :aliases => '-s', :type => :string, :enum => %w(favorites followers friends listed screen_name since tweets tweeted), :default => 'screen_name', :desc => 'Specify the order of the results.', :banner => 'ORDER'
195
198
  method_option 'unsorted', :aliases => '-u', :type => :boolean, :default => false, :desc => 'Output is not sorted.'
@@ -282,6 +285,7 @@ module T
282
285
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
283
286
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
284
287
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
288
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
285
289
  method_option 'max_id', :aliases => '-m', :type => :numeric, :desc => 'Returns only the results with an ID less than the specified ID.'
286
290
  method_option 'number', :aliases => '-n', :type => :numeric, :default => DEFAULT_NUM_RESULTS, :desc => 'Limit the number of results.'
287
291
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
@@ -319,6 +323,7 @@ module T
319
323
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
320
324
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
321
325
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
326
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
322
327
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
323
328
  method_option 'sort', :aliases => '-s', :type => :string, :enum => %w(favorites followers friends listed screen_name since tweets tweeted), :default => 'screen_name', :desc => 'Specify the order of the results.', :banner => 'ORDER'
324
329
  method_option 'unsorted', :aliases => '-u', :type => :boolean, :default => false, :desc => 'Output is not sorted.'
@@ -339,6 +344,7 @@ module T
339
344
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
340
345
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
341
346
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
347
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
342
348
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
343
349
  method_option 'sort', :aliases => '-s', :type => :string, :enum => %w(favorites followers friends listed screen_name since tweets tweeted), :default => 'screen_name', :desc => 'Specify the order of the results.', :banner => 'ORDER'
344
350
  method_option 'unsorted', :aliases => '-u', :type => :boolean, :default => false, :desc => 'Output is not sorted.'
@@ -359,6 +365,7 @@ module T
359
365
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
360
366
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
361
367
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
368
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
362
369
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
363
370
  method_option 'sort', :aliases => '-s', :type => :string, :enum => %w(favorites followers friends listed screen_name since tweets tweeted), :default => 'screen_name', :desc => 'Specify the order of the results.', :banner => 'ORDER'
364
371
  method_option 'unsorted', :aliases => '-u', :type => :boolean, :default => false, :desc => 'Output is not sorted.'
@@ -387,6 +394,7 @@ module T
387
394
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
388
395
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
389
396
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
397
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
390
398
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
391
399
  method_option 'sort', :aliases => '-s', :type => :string, :enum => %w(favorites followers friends listed screen_name since tweets tweeted), :default => 'screen_name', :desc => 'Specify the order of the results.', :banner => 'ORDER'
392
400
  method_option 'unsorted', :aliases => '-u', :type => :boolean, :default => false, :desc => 'Output is not sorted.'
@@ -415,6 +423,7 @@ module T
415
423
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
416
424
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
417
425
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
426
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
418
427
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
419
428
  method_option 'sort', :aliases => '-s', :type => :string, :enum => %w(members mode since slug subscribers), :default => 'slug', :desc => 'Specify the order of the results.', :banner => 'ORDER'
420
429
  method_option 'unsorted', :aliases => '-u', :type => :boolean, :default => false, :desc => 'Output is not sorted.'
@@ -435,6 +444,7 @@ module T
435
444
  desc 'mentions', "Returns the #{DEFAULT_NUM_RESULTS} most recent Tweets mentioning you."
436
445
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
437
446
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
447
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
438
448
  method_option 'number', :aliases => '-n', :type => :numeric, :default => DEFAULT_NUM_RESULTS, :desc => 'Limit the number of results.'
439
449
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
440
450
  def mentions
@@ -466,7 +476,7 @@ module T
466
476
 
467
477
  desc 'reply TWEET_ID MESSAGE', 'Post your Tweet as a reply directed at another person.'
468
478
  method_option 'all', :aliases => '-a', :type => :boolean, :default => false, :desc => 'Reply to all users mentioned in the Tweet.'
469
- method_option 'location', :aliases => '-l', :type => :string, :default => 'location', :desc => "Add location information. If the optional 'latitude,longitude' parameter is not supplied, looks up location by IP address."
479
+ method_option 'location', :aliases => '-l', :type => :string, :default => nil, :desc => "Add location information. If the optional 'latitude,longitude' parameter is not supplied, looks up location by IP address."
470
480
  def reply(status_id, message)
471
481
  status = client.status(status_id.to_i, :include_my_retweet => false)
472
482
  users = Array(status.user.screen_name)
@@ -513,6 +523,7 @@ module T
513
523
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
514
524
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
515
525
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
526
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
516
527
  method_option 'number', :aliases => '-n', :type => :numeric, :default => DEFAULT_NUM_RESULTS, :desc => 'Limit the number of results.'
517
528
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
518
529
  def retweets(user = nil)
@@ -542,6 +553,7 @@ module T
542
553
  desc 'status TWEET_ID', 'Retrieves detailed information about a Tweet.'
543
554
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
544
555
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
556
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
545
557
  def status(status_id) # rubocop:disable CyclomaticComplexity
546
558
  status = client.status(status_id.to_i, :include_my_retweet => false)
547
559
  location = if status.place?
@@ -575,7 +587,7 @@ module T
575
587
  array << ['ID', status.id.to_s]
576
588
  array << ['Text', decode_full_text(status).gsub(/\n+/, ' ')]
577
589
  array << ['Screen name', "@#{status.user.screen_name}"]
578
- array << ['Posted at', "#{ls_formatted_time(status)} (#{time_ago_in_words(status.created_at)} ago)"]
590
+ array << ['Posted at', "#{ls_formatted_time(status, :created_at, false)} (#{time_ago_in_words(status.created_at)} ago)"]
579
591
  array << ['Retweets', number_with_delimiter(status.retweet_count)]
580
592
  array << ['Favorites', number_with_delimiter(status.favorite_count)]
581
593
  array << ['Source', strip_tags(status.source)]
@@ -589,6 +601,7 @@ module T
589
601
  method_option 'exclude', :aliases => '-e', :type => :string, :enum => %w(replies retweets), :desc => 'Exclude certain types of Tweets from the results.', :banner => 'TYPE'
590
602
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
591
603
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
604
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
592
605
  method_option 'max_id', :aliases => '-m', :type => :numeric, :desc => 'Returns only the results with an ID less than the specified ID.'
593
606
  method_option 'number', :aliases => '-n', :type => :numeric, :default => DEFAULT_NUM_RESULTS, :desc => 'Limit the number of results.'
594
607
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
@@ -627,6 +640,7 @@ module T
627
640
  desc 'trend_locations', 'Returns the locations for which Twitter has trending topic information.'
628
641
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
629
642
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
643
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
630
644
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
631
645
  method_option 'sort', :aliases => '-s', :type => :string, :enum => %w(country name parent type woeid), :default => 'name', :desc => 'Specify the order of the results.', :banner => 'ORDER'
632
646
  method_option 'unsorted', :aliases => '-u', :type => :boolean, :default => false, :desc => 'Output is not sorted.'
@@ -675,12 +689,13 @@ module T
675
689
  end
676
690
 
677
691
  desc 'update [MESSAGE]', 'Post a Tweet.'
678
- method_option 'location', :aliases => '-l', :type => :string, :default => 'location', :desc => "Add location information. If the optional 'latitude,longitude' parameter is not supplied, looks up location by IP address."
692
+ method_option 'location', :aliases => '-l', :type => :string, :default => nil, :desc => "Add location information. If the optional 'latitude,longitude' parameter is not supplied, looks up location by IP address."
679
693
  method_option 'file', :aliases => '-f', :type => :string, :desc => 'The path to an image to attach to your tweet.'
680
694
  def update(message = nil)
681
695
  message = T::Editor.gets if message.nil? || message.empty?
682
696
  opts = {:trim_user => true}
683
697
  add_location!(options, opts)
698
+
684
699
  status = if options['file']
685
700
  client.update_with_media(message, File.new(File.expand_path(options['file'])), opts)
686
701
  else
@@ -696,6 +711,7 @@ module T
696
711
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
697
712
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify input as Twitter user IDs instead of screen names.'
698
713
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
714
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
699
715
  method_option 'reverse', :aliases => '-r', :type => :boolean, :default => false, :desc => 'Reverse the order of the sort.'
700
716
  method_option 'sort', :aliases => '-s', :type => :string, :enum => %w(favorites followers friends listed screen_name since tweets tweeted), :default => 'screen_name', :desc => 'Specify the order of the results.', :banner => 'ORDER'
701
717
  method_option 'unsorted', :aliases => '-u', :type => :boolean, :default => false, :desc => 'Output is not sorted.'
@@ -719,7 +735,8 @@ module T
719
735
  method_option 'csv', :aliases => '-c', :type => :boolean, :default => false, :desc => 'Output in CSV format.'
720
736
  method_option 'id', :aliases => '-i', :type => :boolean, :default => false, :desc => 'Specify user via ID instead of screen name.'
721
737
  method_option 'long', :aliases => '-l', :type => :boolean, :default => false, :desc => 'Output in long format.'
722
- def whois(user)
738
+ method_option 'relative_dates', :aliases => '-a', :type => :boolean, :desc => 'Show relative dates.'
739
+ def whois(user) # rubocop:disable CyclomaticComplexity
723
740
  require 't/core_ext/string'
724
741
  user = options['id'] ? user.to_i : user.strip_ats
725
742
  user = client.user(user)
@@ -729,7 +746,7 @@ module T
729
746
  else
730
747
  array = []
731
748
  array << ['ID', user.id.to_s]
732
- array << ['Since', "#{ls_formatted_time(user)} (#{time_ago_in_words(user.created_at)} ago)"]
749
+ array << ['Since', "#{ls_formatted_time(user, :created_at, false)} (#{time_ago_in_words(user.created_at)} ago)"]
733
750
  array << ['Last update', "#{decode_full_text(user.status).gsub(/\n+/, ' ')} (#{time_ago_in_words(user.status.created_at)} ago)"] unless user.status.nil?
734
751
  array << ['Screen name', "@#{user.screen_name}"]
735
752
  array << [user.verified ? 'Name (Verified)' : 'Name', user.name] unless user.name.nil?
data/lib/t/list.rb CHANGED
@@ -64,7 +64,7 @@ module T
64
64
  array << ['Description', list.description] unless list.description.nil?
65
65
  array << ['Slug', list.slug]
66
66
  array << ['Screen name', "@#{list.user.screen_name}"]
67
- array << ['Created at', "#{ls_formatted_time(list)} (#{time_ago_in_words(list.created_at)} ago)"]
67
+ array << ['Created at', "#{ls_formatted_time(list, :created_at, false)} (#{time_ago_in_words(list.created_at)} ago)"]
68
68
  array << ['Members', number_with_delimiter(list.member_count)]
69
69
  array << ['Subscribers', number_with_delimiter(list.subscriber_count)]
70
70
  array << ['Status', list.following ? 'Following' : 'Not following']
data/lib/t/printable.rb CHANGED
@@ -25,10 +25,12 @@ module T
25
25
  time.utc.strftime('%Y-%m-%d %H:%M:%S %z')
26
26
  end
27
27
 
28
- def ls_formatted_time(object, key = :created_at)
28
+ def ls_formatted_time(object, key = :created_at, allow_relative = true)
29
29
  return '' if object.nil?
30
30
  time = T.local_time(object.send(key.to_sym))
31
- if time > Time.now - MONTH_IN_SECONDS * 6
31
+ if allow_relative && options['relative_dates']
32
+ distance_of_time_in_words(time) + ' ago'
33
+ elsif time > Time.now - MONTH_IN_SECONDS * 6
32
34
  time.strftime('%b %e %H:%M')
33
35
  else
34
36
  time.strftime('%b %e %Y')
data/lib/t/version.rb CHANGED
@@ -8,12 +8,12 @@ module T
8
8
 
9
9
  # @return [Integer]
10
10
  def minor
11
- 0
11
+ 1
12
12
  end
13
13
 
14
14
  # @return [Integer]
15
15
  def patch
16
- 2
16
+ 0
17
17
  end
18
18
 
19
19
  # @return [String, NilClass]
data/spec/cli_spec.rb CHANGED
@@ -29,6 +29,69 @@ describe T::CLI do
29
29
  $stdout = @old_stdout
30
30
  end
31
31
 
32
+ describe '--relative-dates' do
33
+ before do
34
+ stub_get('/1.1/statuses/show/55709764298092545.json').with(:query => {:include_my_retweet => 'false'}).to_return(:body => fixture('status.json'))
35
+ stub_get('/1.1/users/show.json').with(:query => {:screen_name => 'sferik'}).to_return(:body => fixture('sferik.json'))
36
+ @cli.options = @cli.options.merge('relative_dates' => true)
37
+ end
38
+ it 'status has the correct output (absolute and relative date together)' do
39
+ @cli.status('55709764298092545')
40
+ expect($stdout.string).to eq <<-eos
41
+ ID 55709764298092545
42
+ Text The problem with your code is that it's doing exactly what you told it to do.
43
+ Screen name @sferik
44
+ Posted at Apr 6 2011 (8 months ago)
45
+ Retweets 320
46
+ Favorites 50
47
+ Source Twitter for iPhone
48
+ Location Blowfish Sushi To Die For, 2170 Bryant St, San Francisco, California, United States
49
+ eos
50
+ end
51
+ it 'whois has the correct output (absolute and relative date together)' do
52
+ @cli.whois('sferik')
53
+ expect($stdout.string).to eq <<-eos
54
+ ID 7505382
55
+ Since Jul 16 2007 (4 years ago)
56
+ Last update @goldman You're near my home town! Say hi to Woodstock for me. (7 months ago)
57
+ Screen name @sferik
58
+ Name Erik Michaels-Ober
59
+ Tweets 7,890
60
+ Favorites 3,755
61
+ Listed 118
62
+ Following 212
63
+ Followers 2,262
64
+ Bio Vagabond.
65
+ Location San Francisco
66
+ URL https://github.com/sferik
67
+ eos
68
+ end
69
+ context '--csv' do
70
+ before do
71
+ @cli.options = @cli.options.merge('csv' => true)
72
+ end
73
+ it 'has the correct output (absolute date in csv)' do
74
+ @cli.status('55709764298092545')
75
+ expect($stdout.string).to eq <<-eos
76
+ ID,Posted at,Screen name,Text,Retweets,Favorites,Source,Location
77
+ 55709764298092545,2011-04-06 19:13:37 +0000,sferik,The problem with your code is that it's doing exactly what you told it to do.,320,50,Twitter for iPhone,"Blowfish Sushi To Die For, 2170 Bryant St, San Francisco, California, United States"
78
+ eos
79
+ end
80
+ end
81
+ context '--long' do
82
+ before do
83
+ @cli.options = @cli.options.merge('long' => true)
84
+ end
85
+ it 'outputs in long format' do
86
+ @cli.status('55709764298092545')
87
+ expect($stdout.string).to eq <<-eos
88
+ ID Posted at Screen name Text ...
89
+ 55709764298092545 8 months ago @sferik The problem with your code is t...
90
+ eos
91
+ end
92
+ end
93
+ end
94
+
32
95
  describe '#account' do
33
96
  before do
34
97
  @cli.options = @cli.options.merge('profile' => fixture_path + '/.trc')
data/spec/list_spec.rb CHANGED
@@ -101,6 +101,22 @@ Members 2
101
101
  Subscribers 1
102
102
  Status Not following
103
103
  Mode public
104
+ URL https://twitter.com/sferik/presidents
105
+ eos
106
+ end
107
+ it 'has the correct output with --relative-dates turned on' do
108
+ @list.options = @list.options.merge('relative_dates' => true)
109
+ @list.information('presidents')
110
+ expect($stdout.string).to eq <<-eos
111
+ ID 8863586
112
+ Description Presidents of the United States of America
113
+ Slug presidents
114
+ Screen name @sferik
115
+ Created at Mar 15 2010 (a year ago)
116
+ Members 2
117
+ Subscribers 1
118
+ Status Not following
119
+ Mode public
104
120
  URL https://twitter.com/sferik/presidents
105
121
  eos
106
122
  end
data/t.gemspec CHANGED
@@ -4,13 +4,13 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 't/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.add_dependency 'launchy', '~> 2.3'
8
- spec.add_dependency 'geokit', '~> 1.6'
7
+ spec.add_dependency 'launchy', '~> 2.4'
8
+ spec.add_dependency 'geokit', '~> 1.7'
9
9
  spec.add_dependency 'htmlentities', '~> 4.3'
10
- spec.add_dependency 'oauth', '~> 0.4'
11
- spec.add_dependency 'retryable', '~> 1.2'
10
+ spec.add_dependency 'oauth', '~> 0.4.7'
11
+ spec.add_dependency 'retryable', '~> 1.3'
12
12
  spec.add_dependency 'thor', ['>= 0.18.1', '< 2']
13
- spec.add_dependency 'twitter', '~> 5.2'
13
+ spec.add_dependency 'twitter', '~> 5.3'
14
14
  spec.add_development_dependency 'bundler', '~> 1.0'
15
15
  spec.author = "Erik Michaels-Ober"
16
16
  spec.bindir = 'bin'
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,177 +1,154 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: t
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
5
- prerelease:
4
+ version: 2.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Erik Michaels-Ober
9
- autorequire:
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain:
12
- - !binary |-
13
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMakNDQWhhZ0F3SUJB
14
- Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE5TVE4d0RRWURWUVFEREFaelpt
15
- VnkKYVdzeEZUQVRCZ29Ka2lhSmsvSXNaQUVaRmdWbmJXRnBiREVUTUJFR0Nn
16
- bVNKb21UOGl4a0FSa1dBMk52YlRBZQpGdzB4TXpBeU1ETXhNREF5TWpkYUZ3
17
- MHhOREF5TURNeE1EQXlNamRhTUQweER6QU5CZ05WQkFNTUJuTm1aWEpwCmF6
18
- RVZNQk1HQ2dtU0pvbVQ4aXhrQVJrV0JXZHRZV2xzTVJNd0VRWUtDWkltaVpQ
19
- eUxHUUJHUllEWTI5dE1JSUIKSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4
20
- QU1JSUJDZ0tDQVFFQWwweDVkeDh1S3hpN1Rrckl1eUJVVEpWQgp2MW85M25V
21
- QjlqL3k0TTk2Z1Yycll3QWNpMUpQQnNlTmQ2RnliempvM1lHdUhsN0VRSHVT
22
- SE5hZjFwMmx4ZXcvCnk2MEpYSUpCQmdQY0RLL0tDUDROVUhvZm0wamZvWUQr
23
- SDV1TkpmSENOcTcvWnNUeE90RTNSYTkyczBCQ01UcG0Kd0JNTWxXUjVNdGRF
24
- aElZdUJPNFhobmVqWWdIMEwvN0JMMmx5bW50Vm5zci9hZ2RRb29qUUNOMUlR
25
- bXNSSnZyUgpkdVpSTzN0WnZvSW8xcEJjNEpFZWhEdXFDZXlCZ1BMT3FNb0t0
26
- UWxvbGQxVFFzMWtXVUJLN0tXTUZFaEtDL0tnCnp5ektSSFFvOXlEWXdPdllu
27
- Z29CTFkrVC9sd0NUNGR5c3NkaHpSYmZueEFoYUt1NFNBc3NJd2FDMDF5Vm93
28
- SUQKQVFBQm96a3dOekFKQmdOVkhSTUVBakFBTUIwR0ExVWREZ1FXQkJTMHJ1
29
- RGZSYWs1Y2kxT3BETlgvWmRERWtJcwppVEFMQmdOVkhROEVCQU1DQkxBd0RR
30
- WUpLb1pJaHZjTkFRRUZCUUFEZ2dFQkFISFNNcy9NUDBzT2FMa0V2NEpvCnp2
31
- a20zcW41QTZ0MHZhSHg3NzRjbWVqeU1VKzV3eVN4UmV6c3BMN1VMaDlOZXVL
32
- Mk9oVStPZTNUcHFyQWc1VEsKUjhHUUlMblZ1MkZlbUdBNnNBa1BEbGNQdGdB
33
- NmllSTE5UFpPRjZIVkxtYy9JRC9kUC9OZ1pXV3pFZXFRS21jSwoyK0hNK1NF
34
- RURoWmtTY1lla3c0Wk9lMTY0WnRaRzgxNm9BdjV4MHBHaXRTSWt1bVVwN1Y4
35
- aUVaLzZlaHI3WTllClhPZzRlZXVuNUwvSmptakFSb1cya05kdmtSRDNjMkVl
36
- U0xxV3ZRUnNCbHlwSGZoczZKSnVMbHlaUEdoVTNSL3YKU2YzbFZLcEJDV2dS
37
- cEdUdnk0NVhWcEIrNTl5MzNQSm1FdVExUFRFT1l2UXlhbzlVS01BQWFBTi83
38
- cVdRdGpsMApobHc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
39
- date: 2013-12-14 00:00:00.000000000 Z
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ8wDQYDVQQDDAZzZmVy
14
+ aWsxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2NvbTAe
15
+ Fw0xMzAyMDMxMDAyMjdaFw0xNDAyMDMxMDAyMjdaMD0xDzANBgNVBAMMBnNmZXJp
16
+ azEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29tMIIB
17
+ IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl0x5dx8uKxi7TkrIuyBUTJVB
18
+ v1o93nUB9j/y4M96gV2rYwAci1JPBseNd6Fybzjo3YGuHl7EQHuSHNaf1p2lxew/
19
+ y60JXIJBBgPcDK/KCP4NUHofm0jfoYD+H5uNJfHCNq7/ZsTxOtE3Ra92s0BCMTpm
20
+ wBMMlWR5MtdEhIYuBO4XhnejYgH0L/7BL2lymntVnsr/agdQoojQCN1IQmsRJvrR
21
+ duZRO3tZvoIo1pBc4JEehDuqCeyBgPLOqMoKtQlold1TQs1kWUBK7KWMFEhKC/Kg
22
+ zyzKRHQo9yDYwOvYngoBLY+T/lwCT4dyssdhzRbfnxAhaKu4SAssIwaC01yVowID
23
+ AQABozkwNzAJBgNVHRMEAjAAMB0GA1UdDgQWBBS0ruDfRak5ci1OpDNX/ZdDEkIs
24
+ iTALBgNVHQ8EBAMCBLAwDQYJKoZIhvcNAQEFBQADggEBAHHSMs/MP0sOaLkEv4Jo
25
+ zvkm3qn5A6t0vaHx774cmejyMU+5wySxRezspL7ULh9NeuK2OhU+Oe3TpqrAg5TK
26
+ R8GQILnVu2FemGA6sAkPDlcPtgA6ieI19PZOF6HVLmc/ID/dP/NgZWWzEeqQKmcK
27
+ 2+HM+SEEDhZkScYekw4ZOe164ZtZG816oAv5x0pGitSIkumUp7V8iEZ/6ehr7Y9e
28
+ XOg4eeun5L/JjmjARoW2kNdvkRD3c2EeSLqWvQRsBlypHfhs6JJuLlyZPGhU3R/v
29
+ Sf3lVKpBCWgRpGTvy45XVpB+59y33PJmEuQ1PTEOYvQyao9UKMAAaAN/7qWQtjl0
30
+ hlw=
31
+ -----END CERTIFICATE-----
32
+ date: 2013-12-18 00:00:00.000000000 Z
40
33
  dependencies:
41
34
  - !ruby/object:Gem::Dependency
42
35
  name: launchy
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '2.4'
43
41
  requirement: !ruby/object:Gem::Requirement
44
- none: false
45
42
  requirements:
46
43
  - - ~>
47
44
  - !ruby/object:Gem::Version
48
- version: '2.3'
49
- type: :runtime
45
+ version: '2.4'
50
46
  prerelease: false
47
+ type: :runtime
48
+ - !ruby/object:Gem::Dependency
49
+ name: geokit
51
50
  version_requirements: !ruby/object:Gem::Requirement
52
- none: false
53
51
  requirements:
54
52
  - - ~>
55
53
  - !ruby/object:Gem::Version
56
- version: '2.3'
57
- - !ruby/object:Gem::Dependency
58
- name: geokit
54
+ version: '1.7'
59
55
  requirement: !ruby/object:Gem::Requirement
60
- none: false
61
56
  requirements:
62
57
  - - ~>
63
58
  - !ruby/object:Gem::Version
64
- version: '1.6'
65
- type: :runtime
59
+ version: '1.7'
66
60
  prerelease: false
61
+ type: :runtime
62
+ - !ruby/object:Gem::Dependency
63
+ name: htmlentities
67
64
  version_requirements: !ruby/object:Gem::Requirement
68
- none: false
69
65
  requirements:
70
66
  - - ~>
71
67
  - !ruby/object:Gem::Version
72
- version: '1.6'
73
- - !ruby/object:Gem::Dependency
74
- name: htmlentities
68
+ version: '4.3'
75
69
  requirement: !ruby/object:Gem::Requirement
76
- none: false
77
70
  requirements:
78
71
  - - ~>
79
72
  - !ruby/object:Gem::Version
80
73
  version: '4.3'
81
- type: :runtime
82
74
  prerelease: false
75
+ type: :runtime
76
+ - !ruby/object:Gem::Dependency
77
+ name: oauth
83
78
  version_requirements: !ruby/object:Gem::Requirement
84
- none: false
85
79
  requirements:
86
80
  - - ~>
87
81
  - !ruby/object:Gem::Version
88
- version: '4.3'
89
- - !ruby/object:Gem::Dependency
90
- name: oauth
82
+ version: 0.4.7
91
83
  requirement: !ruby/object:Gem::Requirement
92
- none: false
93
84
  requirements:
94
85
  - - ~>
95
86
  - !ruby/object:Gem::Version
96
- version: '0.4'
97
- type: :runtime
87
+ version: 0.4.7
98
88
  prerelease: false
89
+ type: :runtime
90
+ - !ruby/object:Gem::Dependency
91
+ name: retryable
99
92
  version_requirements: !ruby/object:Gem::Requirement
100
- none: false
101
93
  requirements:
102
94
  - - ~>
103
95
  - !ruby/object:Gem::Version
104
- version: '0.4'
105
- - !ruby/object:Gem::Dependency
106
- name: retryable
96
+ version: '1.3'
107
97
  requirement: !ruby/object:Gem::Requirement
108
- none: false
109
98
  requirements:
110
99
  - - ~>
111
100
  - !ruby/object:Gem::Version
112
- version: '1.2'
113
- type: :runtime
101
+ version: '1.3'
114
102
  prerelease: false
115
- version_requirements: !ruby/object:Gem::Requirement
116
- none: false
117
- requirements:
118
- - - ~>
119
- - !ruby/object:Gem::Version
120
- version: '1.2'
103
+ type: :runtime
121
104
  - !ruby/object:Gem::Dependency
122
105
  name: thor
123
- requirement: !ruby/object:Gem::Requirement
124
- none: false
106
+ version_requirements: !ruby/object:Gem::Requirement
125
107
  requirements:
126
- - - ! '>='
108
+ - - '>='
127
109
  - !ruby/object:Gem::Version
128
110
  version: 0.18.1
129
111
  - - <
130
112
  - !ruby/object:Gem::Version
131
113
  version: '2'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- none: false
114
+ requirement: !ruby/object:Gem::Requirement
136
115
  requirements:
137
- - - ! '>='
116
+ - - '>='
138
117
  - !ruby/object:Gem::Version
139
118
  version: 0.18.1
140
119
  - - <
141
120
  - !ruby/object:Gem::Version
142
121
  version: '2'
122
+ prerelease: false
123
+ type: :runtime
143
124
  - !ruby/object:Gem::Dependency
144
125
  name: twitter
145
- requirement: !ruby/object:Gem::Requirement
146
- none: false
126
+ version_requirements: !ruby/object:Gem::Requirement
147
127
  requirements:
148
128
  - - ~>
149
129
  - !ruby/object:Gem::Version
150
- version: '5.2'
151
- type: :runtime
152
- prerelease: false
153
- version_requirements: !ruby/object:Gem::Requirement
154
- none: false
130
+ version: '5.3'
131
+ requirement: !ruby/object:Gem::Requirement
155
132
  requirements:
156
133
  - - ~>
157
134
  - !ruby/object:Gem::Version
158
- version: '5.2'
135
+ version: '5.3'
136
+ prerelease: false
137
+ type: :runtime
159
138
  - !ruby/object:Gem::Dependency
160
139
  name: bundler
161
- requirement: !ruby/object:Gem::Requirement
162
- none: false
140
+ version_requirements: !ruby/object:Gem::Requirement
163
141
  requirements:
164
142
  - - ~>
165
143
  - !ruby/object:Gem::Version
166
144
  version: '1.0'
167
- type: :development
168
- prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- none: false
145
+ requirement: !ruby/object:Gem::Requirement
171
146
  requirements:
172
147
  - - ~>
173
148
  - !ruby/object:Gem::Version
174
149
  version: '1.0'
150
+ prerelease: false
151
+ type: :development
175
152
  description: A command-line power tool for Twitter.
176
153
  email: sferik@gmail.com
177
154
  executables:
@@ -185,10 +162,9 @@ files:
185
162
  - Rakefile
186
163
  - t.gemspec
187
164
  - bin/t
165
+ - lib/t.rb
188
166
  - lib/t/cli.rb
189
167
  - lib/t/collectable.rb
190
- - lib/t/core_ext/kernel.rb
191
- - lib/t/core_ext/string.rb
192
168
  - lib/t/delete.rb
193
169
  - lib/t/editor.rb
194
170
  - lib/t/list.rb
@@ -200,10 +176,18 @@ files:
200
176
  - lib/t/stream.rb
201
177
  - lib/t/utils.rb
202
178
  - lib/t/version.rb
203
- - lib/t.rb
179
+ - lib/t/core_ext/kernel.rb
180
+ - lib/t/core_ext/string.rb
204
181
  - spec/cli_spec.rb
205
182
  - spec/delete_spec.rb
206
183
  - spec/editor_spec.rb
184
+ - spec/helper.rb
185
+ - spec/list_spec.rb
186
+ - spec/rcfile_spec.rb
187
+ - spec/search_spec.rb
188
+ - spec/set_spec.rb
189
+ - spec/stream_spec.rb
190
+ - spec/utils_spec.rb
207
191
  - spec/fixtures/200_direct_messages.json
208
192
  - spec/fixtures/200_statuses.json
209
193
  - spec/fixtures/501_ids.json
@@ -252,42 +236,41 @@ files:
252
236
  - spec/fixtures/users.json
253
237
  - spec/fixtures/users_list.json
254
238
  - spec/fixtures/we_concept_bg2.png
255
- - spec/helper.rb
256
- - spec/list_spec.rb
257
- - spec/rcfile_spec.rb
258
- - spec/search_spec.rb
259
- - spec/set_spec.rb
260
- - spec/stream_spec.rb
261
- - spec/utils_spec.rb
262
239
  homepage: http://sferik.github.com/t/
263
240
  licenses:
264
241
  - MIT
265
- post_install_message:
242
+ metadata: {}
243
+ post_install_message:
266
244
  rdoc_options: []
267
245
  require_paths:
268
246
  - lib
269
247
  required_ruby_version: !ruby/object:Gem::Requirement
270
- none: false
271
248
  requirements:
272
- - - ! '>='
249
+ - - '>='
273
250
  - !ruby/object:Gem::Version
274
251
  version: 1.9.2
275
252
  required_rubygems_version: !ruby/object:Gem::Requirement
276
- none: false
277
253
  requirements:
278
- - - ! '>='
254
+ - - '>='
279
255
  - !ruby/object:Gem::Version
280
256
  version: 1.3.5
281
257
  requirements: []
282
- rubyforge_project:
283
- rubygems_version: 1.8.23
284
- signing_key:
285
- specification_version: 3
258
+ rubyforge_project:
259
+ rubygems_version: 2.1.9
260
+ signing_key:
261
+ specification_version: 4
286
262
  summary: CLI for Twitter
287
263
  test_files:
288
264
  - spec/cli_spec.rb
289
265
  - spec/delete_spec.rb
290
266
  - spec/editor_spec.rb
267
+ - spec/helper.rb
268
+ - spec/list_spec.rb
269
+ - spec/rcfile_spec.rb
270
+ - spec/search_spec.rb
271
+ - spec/set_spec.rb
272
+ - spec/stream_spec.rb
273
+ - spec/utils_spec.rb
291
274
  - spec/fixtures/200_direct_messages.json
292
275
  - spec/fixtures/200_statuses.json
293
276
  - spec/fixtures/501_ids.json
@@ -336,11 +319,3 @@ test_files:
336
319
  - spec/fixtures/users.json
337
320
  - spec/fixtures/users_list.json
338
321
  - spec/fixtures/we_concept_bg2.png
339
- - spec/helper.rb
340
- - spec/list_spec.rb
341
- - spec/rcfile_spec.rb
342
- - spec/search_spec.rb
343
- - spec/set_spec.rb
344
- - spec/stream_spec.rb
345
- - spec/utils_spec.rb
346
- has_rdoc:
metadata.gz.sig CHANGED
Binary file