Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def to_clipboard(text)
- string = text.to_s
- IO.popen('pbcopy', 'w') {|t| t << text}
- string
- end
- print "Enter message: "
- text = gets.chomp!
- text = text.chars.map { |m| m == ' ' ? '|' : ":#{m}:" }.join(' ')
- # verify expected format
- puts text
- to_clipboard(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement