diff --git a/CHANGELOG b/CHANGELOG index 8c03e2928..d9a07aaba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ 0.2.3 - Jan 16, 2008 - * added d to command line interface twitter d jnunemaker 'hola' + * added d to command line interface twitter d jnunemaker 'hola' (Humbucker) + * added progress dots when posting for confirmation when twitter is running slow (Hendy Irawan) 0.2.2 - added leave and follow which are new twitter api methods for turning notifications on and off 0.2.0 - Aug 4, 2007 * added sent_messages diff --git a/lib/twitter/base.rb b/lib/twitter/base.rb index 4ae0f6068..e06b6d6ac 100644 --- a/lib/twitter/base.rb +++ b/lib/twitter/base.rb @@ -9,7 +9,6 @@ class BadResponse < Untwitterable; end class UnknownTimeline < ArgumentError; end class Base - # Twitter's url, duh! @@api_url = 'twitter.com' diff --git a/lib/twitter/command.rb b/lib/twitter/command.rb index 674a4fcbb..ea956f46d 100644 --- a/lib/twitter/command.rb +++ b/lib/twitter/command.rb @@ -44,9 +44,18 @@ def post end post = ARGV.shift - - status = Twitter::Base.new(config['email'], config['password']).post(post) - puts "\nGot it! New twitter created at: #{status.created_at}\n" + print "\nSending twitter update" + finished = false + status = nil + progress_thread = Thread.new { until finished; print "."; $stdout.flush; sleep 0.5; end; } + post_thread = Thread.new(binding()) { |b| + status = Twitter::Base.new(config['email'], config['password']).post(post) + finished = true + } + post_thread.join + progress_thread.join + puts " OK!" + puts "Got it! New twitter created at: #{status.created_at}\n" end # Shows status, time and user for the specified timeline diff --git a/test/unit/base_test.rb b/test/unit/base_test.rb index 3516016dd..e17c22952 100644 --- a/test/unit/base_test.rb +++ b/test/unit/base_test.rb @@ -2,6 +2,7 @@ class BaseTest < Test::Unit::TestCase def setup + # note to self use webgroup @t = Twitter::Base.new(CONFIG['email'], CONFIG['password']) end @@ -66,8 +67,8 @@ def setup end test 'should be able to create and destroy friendships' do - puts "Destroying Friendship with Snitch Test", @t.destroy_friendship('snitch_test'), "*"*50 - puts "Creating Friendship with Snitch Test", @t.create_friendship('snitch_test'), "*"*50 + puts "Destroying Friendship", @t.destroy_friendship('jnunemaker'), "*"*50 + puts "Creating Friendship", @t.create_friendship('jnunemaker'), "*"*50 end test 'should be able to follow a user' do @@ -79,14 +80,13 @@ def setup end - # - # test 'should be able to destroy a status' do - # # this has to be checked individually, create a status, put the id in and make sure it was deleted - # #@t.destroy(185855442) - # end - # - # test 'should be able to destroy a direct message' do - # # must be tested individually - # @t.destroy_direct_message(4687032) - # end + test 'should be able to destroy a status' do + # this has to be checked individually, create a status, put the id in and make sure it was deleted + #@t.destroy(185855442) + end + + test 'should be able to destroy a direct message' do + # must be tested individually + @t.destroy_direct_message(4687032) + end end \ No newline at end of file