Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- $:.unshift(File.dirname(__FILE__) + "/../lib")
- require "rubygems"
- begin
- require "gist"
- rescue LoadError
- puts "Please install rubygem 'gist' to use this command"
- exit
- end
- selection = nil
- if ENV['TM_SELECTED_TEXT']
- selection = ENV['TM_SELECTED_TEXT']
- else
- selection = STDIN.read
- end
- if url = Gist.write(selection, ARGV[0] == "private" ? true : false)
- puts "Created gist at #{url}. URL copied to clipboard."
- end
Add Comment
Please, Sign In to add comment