Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts

Wednesday, February 27, 2013

Unable to install Ruby version 2.0.0-p0 via RVM on Fedora 18

Ruby 2.0.0. version 2.0.0-p0 to be exact, was released on 24th Feb 2013 and as any Ruby programmer would do, i too tried to upgrade to Ruby 2.0.0
Fedora 18 Linux being a new OS, which too was released recently in the mid of January wasn't very helpful in the installation.

Tuesday, February 12, 2013

RSpec test failing when testing for parameters using "should_receive" and "with"

So, another weird and frustrating thing happened to me while i was running my app's tests using rspec.
I got 1 failing spec showing the following error:


Spec::Mocks::MockExpectationError in 'FeedsController#get_recent_feeds gets the recent feeds for live deals'

#[Feed:0x3fa7ffc8de1c @name="Feed_1001"] received :all with unexpected arguments
  expected: ({:include=>:feedable,  :order=>"updated_at desc, feedable_type desc"})
       got: ({:include=>:feedable, :order=>"updated_at desc, feedable_type desc"})

Monday, January 14, 2013

Get original urls from short urls created by services like bitly, tinyurl, twitter etc using ruby and open-uri

Pretty straight forward it is. Writing it here coz i couldn't find anything like this explained for ruby, found a lotta blogs for python though.

So i thought of explaining it here. So here goes. Sometimes we come across urls like http://bit.ly/y2uy321oy3 which can be for any website. There's this simple way to retrieve its original url.