diff --git a/lib/haste.rb b/lib/haste.rb index 2a4bfee..a5293b3 100644 --- a/lib/haste.rb +++ b/lib/haste.rb @@ -23,7 +23,8 @@ module Haste response = http.post '/documents', input if response.is_a?(Net::HTTPOK) data = JSON.parse(response.body) - STDOUT.puts "#{server}/#{data['key']}" + method = STDOUT.tty? ? :puts : :print + STDOUT.send method, "#{server}/#{data['key']}" else STDERR.puts "failure uploading: #{response.code}" end diff --git a/lib/haste/version.rb b/lib/haste/version.rb index da06729..3b454f3 100644 --- a/lib/haste/version.rb +++ b/lib/haste/version.rb @@ -1,5 +1,5 @@ module Haste - VERSION = '0.0.4' + VERSION = '0.0.5' end