Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A better Ruby client for the Ideone API
tag: v1.3.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.document
.gitignore
Gemfile
LICENSE.txt
README.rdoc
Rakefile
VERSION
ideone-ruby-api.gemspec

README.rdoc

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
=> [{:key=>"7", :value=>"Ada (gnat-4.3.2)"},
    {:key=>"13", :value=>"Assembler (nasm-2.07)"},
    ...
    {:key=>"104", :value=>"AWK (gawk) (gawk-3.1.6)"},
    {:key=>"6", :value=>"Whitespace (wspace 0.3)"}]

# 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.

Something went wrong with that request. Please try again.