0.01
No commit activity in last 3 years
No release in over 3 years
A better Ruby binding for the Ideone API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0.1
~> 2.3

Runtime

~> 2.3.3
 Project Readme

ideone-ruby-api¶ ↑

<img src=“https://secure.travis-ci.org/kennym/ideone-ruby-api.png” /> <img src=“https://badge.fury.io/rb/ideone-ruby-api.png” alt=“Gem Version” /> <img src=“https://ga-beacon.appspot.com/UA-48308186-1/ideone-ruby-api/README.rdoc” alt=“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 © 2011-2014 Kenny Meyer. See LICENSE.txt for further details.