Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .document

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [master, main]
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["3.4", "4.0"]
steps:
- uses: actions/checkout@v7
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
70 changes: 21 additions & 49 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,49 +1,21 @@
# rcov generated
coverage

# rdoc generated
rdoc

# yard generated
doc
.yardoc

# bundler
.bundle

# jeweler generated
pkg

# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
#
# * Create a file at ~/.gitignore
# * Include files you want ignored
# * Run: git config --global core.excludesfile ~/.gitignore
#
# After doing this, these files will be ignored in all your git projects,
# saving you from having to 'pollute' every project you touch with them
#
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
#
# For MacOS:
#
#.DS_Store

# For TextMate
#*.tmproj
#tmtags

# For emacs:
#*~
#\#*
#.\#*

# For vim:
#*.swp

# For redcar:
#.redcar

# For rubinius:
#*.rbc
Gemfile.lock
*.gem
*.rbc
/Gemfile.lock
/.bundle/
/.config
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/rdoc/
/spec/reports/
/tmp/
/vendor/bundle
.DS_Store
.idea/
.serena/
.planning/
task_plan.md
findings.md
progress.md
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

## 3.0.0

- Require Ruby 3.4 or newer. Developed and CI-tested on Ruby 4.0.
- Upgrade Savon to `~> 2.17` and add the `cgi` gem (removed from default gems in Ruby 4.0).
- Call the Ideone SOAP API over HTTPS (`https://ideone.com/api/1/service.wsdl`).
- Replace Jeweler-generated packaging with a hand-maintained gemspec.
- Replace Travis CI with GitHub Actions (Ruby 3.4 and 4.0).
- Use Minitest 6 and WebMock for the test suite.
- Stop treating every Ideone error as `Ideone::AuthError`. Authentication failures still raise `AuthError`; other API errors raise `Ideone::Error`.
- Stop mutating shared request state between calls.
- Read credentials from `IDEONE_USER` / `IDEONE_PASSWORD` in optional live tests instead of hardcoding them.

## 2.1.2

- Last Jeweler-era release (2014-05-10).
15 changes: 4 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
source "http://rubygems.org"
# Add dependencies required to use your gem here.
# Example:
# gem "activesupport", ">= 2.3.5"
gem "savon", "~> 2.3.3"
# frozen_string_literal: true

# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
gem "jeweler", "~> 2.0.1"
gem "test-unit", "~> 2.3"
end
source "https://rubygems.org"

gemspec
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011 Kenny Meyer
Copyright (c) 2011-2026 Kenny Meyer

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
130 changes: 130 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# ideone-ruby-api

[![CI](https://github.com/kennym/ideone-ruby-api/actions/workflows/ci.yml/badge.svg)](https://github.com/kennym/ideone-ruby-api/actions/workflows/ci.yml)
[![Gem Version](https://badge.fury.io/rb/ideone-ruby-api.svg)](https://badge.fury.io/rb/ideone-ruby-api)

Ruby bindings for the [Ideone](https://ideone.com) SOAP API — an online compiler and pastebin.

Requires **Ruby 3.4+**. Developed on **Ruby 4.0**.

## Ideone API status

The SOAP service this gem wraps is still live. The original operations
(`testFunction`, `getLanguages`, `createSubmission`, `getSubmissionStatus`,
`getSubmissionDetails`) still work:

| | |
|---|---|
| WSDL | `https://ideone.com/api/1/service.wsdl` |
| Endpoint | `https://ideone.com/api/1/service` |

[Sphere Engine](https://sphere-engine.com) no longer develops this SOAP API.
They recommend the [Compilers REST API v4](https://docs.sphere-engine.com/compilers/api/overview-version-4)
for new products. This gem stays on Ideone SOAP so existing callers keep working.

The old PDF (`http://ideone.com/files/ideone-api.pdf`) is gone.

## Installation

```ruby
# Gemfile
gem "ideone-ruby-api"
```

```bash
gem install ideone-ruby-api
```

## Usage

```ruby
require "ideone"

client = Ideone.new("username", "password")

# Log SOAP traffic
client = Ideone.new("username", "password", true)

link = client.create_submission("puts 'hello, world'", 17) # 17 = Ruby
# => "TOKEN"

client.submission_status(link)
# => { status: 0, result: 15 }

client.submission_details(link)
# => { "error" => "OK", "langName" => "Ruby", "output" => "hello, world\n", ... }

client.languages
# => { "1" => "C++ (gcc 8.3)", "17" => "Ruby (ruby 2.5.5)", "116" => "Python 3 (python 3.12)", ... }

client.test
# => { "error" => "OK", "moreHelp" => "ideone.com", "pi" => "3.14",
# "answerToLifeAndEverything" => "42", "oOok" => true }
```

### Language ids

Call `languages` for the current list. As of 2026-09 these still match the old docs:

| Id | Language |
|---:|---|
| 1 | C++ (gcc 8.3) |
| 17 | Ruby (ruby 2.5.5) |
| 116 | Python 3 (python 3.12) |

### Submission status and result

`submission_status` returns integers:

**status** (execution stage)

| Value | Meaning |
|---:|---|
| < 0 | waiting in queue |
| 0 | finished |
| 1 | compiling |
| 3 | running |

**result** (when status is 0)

| Value | Meaning |
|---:|---|
| 11 | compilation error |
| 12 | runtime error |
| 13 | time limit exceeded |
| 15 | success |
| 17 | memory limit exceeded |
| 19 | illegal system call |
| 20 | internal error |

Poll until `status == 0` before reading output from `submission_details`.

### Errors

- `Ideone::AuthError` — Ideone returned `AUTH_ERROR`
- `Ideone::Error` — any other API or transport failure

## Development

```bash
bundle install
bundle exec rake
```

Default tests are mocked (WebMock) and do not call Ideone.

```bash
IDEONE_USER=you IDEONE_PASSWORD=secret bundle exec rake
```

CI runs on Ruby 3.4 and 4.0.

## Similar projects

- https://github.com/maveonair/ccpacona
- https://github.com/jonathanperret/ideone.rb
- https://github.com/Pistos/ideone-gem

## License

Copyright (c) 2011-2026 Kenny Meyer. See [LICENSE.txt](LICENSE.txt).
85 changes: 0 additions & 85 deletions README.rdoc

This file was deleted.

Loading
Loading