Gista is a very simple command-line program and Ruby library for creating Gists. As a stand-alone program, it can create a new gist from files listed as arguments, or by reading from STDIN.
Gista is distributed as a Ruby gem, which should be installed on most Macs and Linux systems. Once you have ensured you have a working installation of Ruby and Ruby gems, install the gem as follows from the command line:
$ gem install gista
You can verify the gem has installed correctly by checking its version number:
$ gista -v
If this generates an error, something has gone wrong. You should see something
along the lines of
You can list one or more filenames as an argument:
$ gista filename1 filename2...
Or, you can read content from STDIN:
$ echo "Hello, world!" | gista
When reading from STDIN one file will be created, by default called
You can override this name:
$ echo "Hello, world!" | gista -f "my new gist"
By default, new gists are private. You can make a public gist with the
$ gista -p filename1 $ gista --public filename1
When everything went according to plan, the program will output the URL to the newly created gist.
If you want to use Gista as a Ruby library, take a look at the
file for an example how to use it:
authoriser = Gista::TokenRequest.new(Gista::LoginPrompt.new) token = Gista::UserToken.new(authoriser).token options = Gista::Options.new(ARGV).options puts Gista.post_and_get_url(token, options)
See the inline API docs for more information.
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don't break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
- Send me a pull request. Bonus points for topic branches.
Please report any issues, defects or suggestions in the Github issue tracker.
What has changed?
See the HISTORY file for a detailed changelog.