2 Replies - 252 Views - Last Post: 26 September 2011 - 07:05 AM

#1 Skaggles  Icon User is offline

  • I AM THE LAW!
  • member icon





Reputation: 248
  • View blog
  • Posts: 637
  • Joined: 01-March 09

DICRb -- The DreamInCode API wrapper for Ruby

Posted 17 September 2011 - 12:36 AM

*
POPULAR

Well, Sergio Tapia did it in C#, then supercorey did it in Java. Now, another wrapper around the DreamInCode.net API as been created, only this time, it's been Ruby'd! supercorey actually suggested I make this and, after a few days of procrastination and a few hours of actual work, I got something working. Originally, I was also going to do a 1-to-1 and try to keep the code as much the same as possible so that the APIs would all work the same way, but some of the code just wasn't ruby enough, so I changed it up a bit. There's still a lot similar to the other API wrappers.

The code over at github: https://github.com/aburdette/dicrb

To use it, until I complete some testing and upload it as a ruby gem, you'll need to download the code and build/install the gem locally. Doing that is just running a couple commands from the project directory:

gem build dicrb.gemspec
gem install dicrb-*.gem



Using it is actually pretty straight-forward and I put together an example in the examples directory of the project: https://github.com/a...master/examples

require 'dicrb'

@user = DICRb::Profile.new(12345)

puts @user.name
puts @user.group

@user.comments.each do |c|
    puts "#{c.user.name}: #{c.text}"
end


This post has been edited by Skaggles: 17 September 2011 - 12:41 AM


Is This A Good Question/Topic? 6
  • +

Replies To: DICRb -- The DreamInCode API wrapper for Ruby

#2 supercorey  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 119
  • View blog
  • Posts: 206
  • Joined: 15-February 09

Re: DICRb -- The DreamInCode API wrapper for Ruby

Posted 17 September 2011 - 11:54 AM

Nice! I think I'll learn Ruby now just so I can write a sample with this or something. We're gonna need to start a list of DIC API wrappers sooner or later now :)

Anyways, cool library. If I knew anything about how it worked, I'd fork it.

Cheers! Let's see if anyone finds a use for it.
Was This Post Helpful? 1
  • +
  • -

#3 DaneAU  Icon User is offline

  • Great::Southern::Land
  • member icon

Reputation: 278
  • View blog
  • Posts: 1,588
  • Joined: 15-May 08

Re: DICRb -- The DreamInCode API wrapper for Ruby

Posted 26 September 2011 - 07:05 AM

Nice work, i wrote something in c++ but got over it after a bit. I probably should also stop procrastinating around it :)

The example does look straight forward indeed. Good job Skaggles :D
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1