Skip to content
Browse files

gist: window's fix for broken clipboard

  • Loading branch information...
1 parent 6fdb393 commit 19aa778526930e64318288b9d40f439e89a16b9a @banister committed Jan 16, 2013
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/pry/commands/gist.rb
View
10 lib/pry/commands/gist.rb
@@ -83,8 +83,14 @@ def gist_content(content, filename)
response = Jist.gist(content, :filename => filename || "pry_gist.rb", :public => !!opts[:p])
if response
url = response['html_url']
- Jist.copy(url)
- output.puts 'Gist created at URL, which is now in the clipboard: ', url
+ message = "Gist created at URL #{url}"
+ begin
+ Jist.copy(url)
+ message << ", which is now in the clipboard."
+ rescue Jist::ClipboardError
+ end
+
+ output.puts message
end
end
end

0 comments on commit 19aa778

Please sign in to comment.
Something went wrong with that request. Please try again.