Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A better Ruby gem for the Ideone API
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test Handle authentication errors gracefully and toggle logging. Fixes #2
.document
.gitignore
.travis.yml
Gemfile
LICENSE.txt
README.rdoc
Rakefile
VERSION
ideone-ruby-api.gemspec

README.rdoc

ideone-ruby-api

Gem Version GA analytics

Ideone is a pastebin, as well as an online compiler and debugger. This project is a Ruby binding to the Ideone API.

Requires Ruby =>1.9.2

Usage

require 'ideone'

# Authenticate with Ideone
i = Ideone.new('username', 'password')
=> #<Ideone:0x000000021dfd88 ... >

# Enable logging by setting flag to `true`
i = Ideone.new('username', 'password', true)
=> #<Ideone:0x000000021dfd88 ... >

# Create submission
source_code = "puts 'hello, world'"
i.create_submission(source_code,
                    17) # Ruby
=> 'TOKEN'

# Get submission status
i.submission_status("TOKEN")
=> {:status=>0, :result=>15}

# Get all available languages
i.languages
=> {"1"=>"C++ (gcc-4.3.4)", "2"=>"Pascal (gpc) (gpc 20070904)",
    "3"=>"Perl (perl 5.12.1)", "4"=>"Python (python 2.6.4)"

# Test that everything's working
i.test
=> {"error"=>"OK",
    "moreHelp"=>"ideone.com",
    "pi"=>"3.14",
    "answerToLifeAndEverything"=>"42",
    "oOok"=>true}

Similar projects

I stole the best ideas from each of the above projects, which, I think, makes it much more robust, and it includes tests (which actually pass).

Running the test suite

To run the test suite, please fill out USER and PASS in test/test_ideone-ruby-api.rb

Then, you can run `rake test`

In the wild

Contributing to ideone-ruby-api

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet

  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

References

Copyright

Copyright © 2011-2014 Kenny Meyer. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.