twat 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/TODO CHANGED
@@ -16,3 +16,5 @@ COLORS!
16
16
  =======
17
17
 
18
18
  twat -l should dump colors to terminal (This should be configurable tho)
19
+
20
+ Refactor tweet printing code, unify throughout
data/lib/twat/actions.rb CHANGED
@@ -53,10 +53,22 @@ module Twat
53
53
  end
54
54
  end
55
55
 
56
+ def user_feed
57
+ twitter_auth
58
+ # Fix :default case
59
+ Twitter.user_timeline(opts[:user]).first.tap do |tweet|
60
+ puts "#{tweet.user.screen_name.bold.cyan}: #{tweet.text}"
61
+ end
62
+ end
63
+
56
64
  def version
57
65
  puts "twat: #{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
58
66
  end
59
67
 
68
+ def method_missing
69
+ raise NoSuchCommand
70
+ end
71
+
60
72
  private
61
73
 
62
74
  def twitter_auth
data/lib/twat/argparse.rb CHANGED
@@ -38,6 +38,10 @@ module Twat
38
38
  end #}}}
39
39
  opts.on('-v', '--version', 'Display version info') do #{{{ --version
40
40
  options[:action] = :version
41
+ end
42
+ opts.on('-u', '--user [USER]', 'Display current status for USER (Defaults to your default account)') do |user| #{{{ --user USER
43
+ options[:user] = (user || :default)
44
+ options[:action] = :user_feed
41
45
  end #}}}
42
46
  end
43
47
 
@@ -1,5 +1,6 @@
1
1
  module Twat
2
2
  class NoSuchAccount < Exception; end
3
+ class NoSuchCommand < Exception; end
3
4
  class NoConfigFile < Exception; end
4
5
  class Usage < Exception; end
5
6
  class InvalidCredentials < Exception; end
data/lib/twat.rb CHANGED
@@ -27,7 +27,7 @@ end
27
27
  module Twat
28
28
  VERSION_MAJOR = 0
29
29
  VERSION_MINOR = 3
30
- VERSION_PATCH = 3
30
+ VERSION_PATCH = 4
31
31
 
32
32
  VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
33
33
  class Twat
@@ -43,7 +43,7 @@ module Twat
43
43
  rescue NoSuchAccount
44
44
  puts "No such account"
45
45
  opts.usage
46
- rescue NoMethodError
46
+ rescue NoSuchCommand
47
47
  puts "No such command"
48
48
  opts.usage
49
49
  rescue NoConfigFile
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-28 00:00:00.000000000Z
12
+ date: 2011-09-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: twitter
16
- requirement: &15834040 !ruby/object:Gem::Requirement
16
+ requirement: &81879400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15834040
24
+ version_requirements: *81879400
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: oauth
27
- requirement: &15831700 !ruby/object:Gem::Requirement
27
+ requirement: &81879100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *15831700
35
+ version_requirements: *81879100
36
36
  description: Command line tool for tweeting and whatnot
37
37
  email:
38
38
  - richo@psych0tik.net