A simple ruby gem to upload text to paste it services.

Corey Prophitt 3fb214491b Rubocop'd rakefile 5 years ago
bin 02aa09c066 Rubocop cleanup. 5 years ago
lib 04a4ccea8c Commented on versioning 5 years ago
test 62ea463cec Cleaned up tests 5 years ago
.gitignore 24030eb844 Initial commit. 5 years ago
.travis.yml 8b65248e77 Removed some useless travis settings. 5 years ago
README.md d09d022540 Updated readme. 5 years ago
Rakefile 3fb214491b Rubocop'd rakefile 5 years ago
pasteit.gemspec 626b4b71fd Rubocop cleanup. 5 years ago

README.md

Paste It

Build Status

A simple API for uploading any text to a paste service. Comes with a simple command line tool for uploading text as well.

Installation

$ gem install pasteit

API Usage

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!

Command Line Usage

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.

License

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.