Skip to content
Browse files

Script to dump the clipboard and its encoding

  • Loading branch information...
1 parent 26999bc commit 1b69375eccc2c43b5b9cc3073e70e5956881fa83 @drbrain committed Mar 25, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 sample/dump.rb
View
16 sample/dump.rb
@@ -0,0 +1,16 @@
+require 'pasteboard'
+require 'pp'
+
+pb = Pasteboard.new
+
+pb.each.with_index do |item, index|
+ puts "item #{index}"
+ item.map do |flavor, data|
+ puts "flavor: #{flavor}"
+ puts "encoding: #{flavor.encoding} valid: #{flavor.valid_encoding?}" if
+ defined?(Encoding)
+ puts data.inspect[0, 75]
+ puts
+ end
+ puts
+end

0 comments on commit 1b69375

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