|Corey Prophitt 3fb214491b Rubocop'd rakefile||5 years ago|
|bin||5 years ago|
|lib||5 years ago|
|test||5 years ago|
|.gitignore||5 years ago|
|.travis.yml||5 years ago|
|README.md||5 years ago|
|Rakefile||5 years ago|
|pasteit.gemspec||5 years ago|
A simple API for uploading any text to a paste service. Comes with a simple command line tool for uploading text as well.
$ gem install pasteit
When you know the language (filetype) of the code you can specify it:
require "pasteit" paste_tool = Pasteit::PasteTool.new("echo 'hello world!'", "sh") paste_url = paste_tool.upload! puts paste_url
The server can take a best guess at the filetye, so the type is optional:
require "pasteit" puts Pasteit::PasteTool.new("print 'Hello World!'").upload!
The pasteit gem comes with a command line tool you can use in multiple ways.
You can use via stdin (pipes):
$ cat hello.cpp | pasteit
You can also use command line options to get text from files:
$ pasteit -s hello.cpp -l cpp
Like the API usage, the language specification is optional:
$ pasteit -s helloworld.py
If you are an OSX user, you can benefit from the OSes
pbcopy utility. Which
will automatically copy the paste URL to your system clipboard.
$ cat hello.rb | pasteit | pbcopy
If you are a Linux user, you can use
xclip in a similar fashion to pbcopy.
Copyright (c) 2015, Corey Prophitt.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.