OpenCPU Gem for Ruby

[This article was first published on OpenCPU, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

opencpu logo

The guys from are working on a OpenCPU wrapper Gem. This simple API client provides a pretty nice basis for building R web applications with Ruby. A minimal example from the readme:

<span class="n">client</span><span class="o">.</span><span class="n">execute</span> <span class="ss">:digest</span><span class="p">,</span> <span class="ss">:hmac</span><span class="p">,</span> <span class="p">{</span> <span class="ss">key</span><span class="p">:</span> <span class="s1">'foo'</span><span class="p">,</span> <span class="ss">object</span><span class="p">:</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="ss">algo</span><span class="p">:</span> <span class="s1">'md5'</span> <span class="p">}</span>
<span class="c1"># => ['0c7a250281315ab863549f66cd8a3a53']</span>

Which performs the following JSON RPC request:

digest<span class="o">::</span>hmac<span class="p">(</span>key<span class="o">=</span><span class="s">"foo"</span><span class="p">,</span> object<span class="o">=</span><span class="s">"bar"</span><span class="p">,</span> algo<span class="o">=</span><span class="s">"md5"</span><span class="p">)</span>

They are accepting pull requests!

To leave a comment for the author, please follow the link and comment on their blog: OpenCPU. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)