console_tweet 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/console_tweet/cli.rb +11 -2
- data/lib/console_tweet/version.rb +1 -1
- metadata +4 -5
- data/lib/console_tweet/console-tweet.rb +0 -5
data/lib/console_tweet/cli.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
75
|
+
# actually post it
|
76
|
+
@client.update(tweet_text)
|
68
77
|
puts "Tweet Posted!"
|
69
78
|
end
|
70
79
|
|
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:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
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:
|
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
|