Fetching contributors…
Cannot retrieve contributors at this time
76 lines (52 sloc) 2.19 KB

ideone-ruby-api

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

Usage

require 'ideone'

# Authenticate with Ideone
i = Ideone.new('username', 'password')
=> #<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 Kenny Meyer. See LICENSE.txt for further details.