console_tweet 0.0.5 → 0.0.6

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.
@@ -60,11 +60,20 @@ module ConsoleTweet
60
60
  # Send a tweet for the user
61
61
  def tweet(*args)
62
62
  load_default_token
63
- tweet_text = args.join(' ')
63
+ # get it from them directly
64
+ tweet_text = args.join(' ').strip
65
+ # or let them append / or pipe
66
+ tweet_text += (tweet_text.empty? ? '' : ' ') + STDIN.read unless STDIN.tty?
67
+ # or let them get prompted for it
68
+ if tweet_text.empty?
69
+ print 'Tweet (Press return to finish): '
70
+ tweet_text = STDIN.gets.strip
71
+ end
64
72
  return failtown("Empty Tweet") if tweet_text.empty?
65
73
  return failtown("Tweet is too long!") if tweet_text.size > 140
66
74
  return failtown("Unauthorized, re-run setup!") unless @client.authorized?
67
- @client.update(args.join(' '))
75
+ # actually post it
76
+ @client.update(tweet_text)
68
77
  puts "Tweet Posted!"
69
78
  end
70
79
 
@@ -1,5 +1,5 @@
1
1
  module ConsoleTweet
2
2
 
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console_tweet
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Crepezzi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-30 00:00:00 -04:00
18
+ date: 2011-01-22 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -56,7 +56,6 @@ extra_rdoc_files: []
56
56
 
57
57
  files:
58
58
  - lib/console_tweet/cli.rb
59
- - lib/console_tweet/console-tweet.rb
60
59
  - lib/console_tweet/version.rb
61
60
  - lib/console_tweet.rb
62
61
  - bin/twitter
@@ -1,5 +0,0 @@
1
- require 'console_tweet/cli'
2
-
3
- module ConsoleTweet
4
-
5
- end