public
Fork of jnunemaker/twitter
Description: command line twits and an api wrapper for twitter
Homepage: http://twitter.rubyforge.org/
Clone URL: git://github.com/drnic/twitter.git
Search Repo:
found a better way to do stdin, no longer requiring extra gem dependency


git-svn-id: http://svn.addictedtonew.com/public/gems/twitter@189 
fe7eae16-9a24-0410-a59d-9e59979e88be
jnunemaker (author)
Wed Apr 02 20:32:00 -0700 2008
commit  74e979a4a187b731f41226713da66741867512fe
tree    5d8eed9a5213712b9168bff5c452948d44c3cd2f
parent  00a857342ebf34e1ce858cfbc51c1f62175fd718
...
 
 
1
2
3
...
1
2
3
4
5
0
@@ -1,3 +1,5 @@
0
+0.2.6 - April 2, 2008
0
+ * found a more simple way of doing stdin without any extra gem dependencies
0
 0.2.5 - April 2, 2008
0
       * Command line interface can now use stdin for posting (ideas and example code from Jeremy Friesen)
0
           $ twitter post 'test without stdin' # => twitters: test without stdin
...
31
32
33
34
35
36
37
38
39
40
41
42
 
 
 
43
44
45
46
...
31
32
33
 
34
 
 
 
 
 
 
 
35
36
37
38
39
40
41
0
@@ -31,15 +31,10 @@
0
 require 'rubygems'
0
 require 'twitter'
0
 require 'twitter/command'
0
-require 'timeout'
0
 
0
-begin
0
- timeout(1) do
0
- if ARGV[0] && ARGV[0] == 'post'
0
- ARGV[1] = "#{STDIN.read}#{ARGV[1]}"
0
- end
0
- end
0
-rescue Timeout::Error
0
+# if we have stdin, let's prepend it to the message
0
+if ARGV[0] && ARGV[0] == 'post' && !STDIN.tty?
0
+ ARGV[1] = "#{STDIN.read}#{ARGV[1]}"
0
 end
0
 
0
 Twitter::Command.process!
0
\ No newline at end of file
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ module Twitter #:nodoc:
0
   module VERSION #:nodoc:
0
     MAJOR = 0
0
     MINOR = 2
0
- TINY = 5
0
+ TINY = 6
0
 
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
   end

Comments

    No one has commented yet.