Read my latest article: 8 things I look for in a Ruby on Rails app (posted Thu, 06 Jul 2017 16:59:00 GMT)

ShortURL 0.8.4 released and gets a new mainainer... me!

Posted by Sun, 06 Jan 2008 23:49:00 GMT

Earlier today, Vincent Foley was kind enough to hand over maitenance of the the ShortURL project on RubyForge to me. He first released it back in 2005, which I blogged about as RubyURL was the first shortening service that it supported (and is the default). Unfortunately, the release of RubyURL 2.0 broke backwards compatibility and Vincent wasn’t maintaining it anymore. So, earlier, I decided to patch this and got a new version released that now works with the current RubyURL site.

While working on the code, I decided to extend the compatible services to include moourl and urlTea.

These updates are available in ShortURL version 0.8.4.

Install the ShortURL gem

Installation is a snap… (like 99.7% of rubygems…)


  ~ > sudo gem install shorturl                                                                                                                                                                                                           Password:

  Successfully installed shorturl-0.8.4
  1 gem installed
  Installing ri documentation for shorturl-0.8.4...
  Installing RDoc documentation for shorturl-0.8.4.  

Using ShortURL

The ShortURL gem provides the ShortURL library, which you can use from any Ruby application.

Using the ShortURL library


  ~ > irb                                                                                                                                                                                                                           
  irb(main):001:0> require 'rubygems'
  => true
  irb(main):002:0> require 'shorturl'
  => true
  irb(main):003:0> ShortURL.shorten( 'http://www.istwitterdown.com' )
  => "http://rubyurl.com/P9w" 

As you can see…it’s really straight forward.

Let’s try it with a few other services.


irb(main):004:0> ShortURL.shorten( 'http://www.istwitterdown.com', :moourl )
=> "http://moourl.com/fvoky" 
irb(main):005:0> ShortURL.shorten( 'http://www.istwitterdown.com', :tinyurl )
=> "http://tinyurl.com/2t3qmh" 

Using the shorturl command-line tool

Many people don’t know that ShortURL provides a command-line tool, which you can use after installing the gem.


  ~ > shorturl http://istwitterdown.com                                                                                                                                                                                               
  http://rubyurl.com/Lwk

If you’d like to see more services provided than the ones listed here, please submit feature requests and/or patches on the rubyforge project.

ShortURL Documentation

To see the latest documentation for the project, please visit:

My favorite part about this? My rbot plugin for RubyURL works again!

rbot and rubyurl
Uploaded with plasq’s Skitch!

Happy URL-shortening!

Get to Know a Gem: Rak

Posted by Tue, 11 Dec 2007 16:10:00 GMT

A few months ago, I posted about an article that showed you how to colorize your grep search results. Since then, I’ve heard people talking about ack, which describes itself as…

“a tool like grep, aimed at programmers with large trees of heterogeneous source code.”

It’s written in Perl, which is fine and dandy… but before I installed it, I heard that there was a Ruby version named rak, which describes itself as…

“a grep replacement in pure Ruby. It accepts Ruby syntax regular expressions and automatically recurses directories, skipping .svn/, .cvs/, pkg/ and more things you don’t care about. “

Sounds great. Let’s see what this thing can do.

Installing rak

Daniel Lucraft, the author of rak, was kind enough to package it up as a Rubygem. So, all we have to do is install it via gem install rak.


   > sudo gem install rak                                                                                                                                                                                                     
  Password:
  Bulk updating Gem source index for: http://gems.rubyforge.org
  Successfully installed rak-0.8.0
  Installing ri documentation for rak-0.8.0...
  Installing RDoc documentation for rak-0.8.0...
  ~ >

Great, let’s move on.

Using rak

Now that it’s installed, we can use Rak by typing rak from the command line. You’d typically want to run this from within the root of your application.

For example, basic usage would look like the following.

$ rak search-pattern

In my first test, I ran rak README.

Immediately, I see a greater advantage to rak over using grep and that’s because it’s giving me line numbers for free, which takes remembering a few extra options with grep.

Like grep, we can specify a specific path to search with. For example, we use a view helper named link_to_unimplemented to help us track actions that aren’t implemented yet. Looking at a current project, I can run rak link_to_unimplemented app/views and produce the following results.

I’m going to keep playing with it, but wanted to help get the word out. If you have any tips on using it, please share them in the comments. :-)

Gems Gone Wild!

Posted by Mon, 12 Feb 2007 06:27:00 GMT

Mike Clark is offering everyone1 in the Ruby community Mardis Gras beads… in exchange for showing everyone your sexy gems. Chad and Bryan showed us theirs, so I figured it was my turn to show you all what I’ve been hiding beneath this shell.


    # gem list|grep '^[a-zA-Z]'
    actionmailer (1.2.5)
    actionpack (1.12.5)
    actionwebservice (1.1.6)
    activerecord (1.14.4)
    activesupport (1.3.1)
    asset_compiler (0.2)
    BlueCloth (1.0.0)
    builder (2.0.0)
    camping (1.5)
    capistrano (1.4.0, 1.3.1, 1.2.0)
    capistrano-ext (1.1.0)
    cgi_multipart_eof_fix (2.0.2)
    cheat (1.2.1)
    chronic (0.1.6)
    color (0.1.0)
    daemons (1.0.3, 0.4.4, 0.4.2)
    diff-lcs (1.1.2)
    facets (1.4.5)
    fastercsv (1.2.0)
    fastthread (0.6.2)
    feedtools (0.2.26)
    flexmock (0.5.0)
    gem_plugin (0.2.2, 0.2.1)
    gen (0.41.0)
    glue (0.41.0)
    google-geocode (1.2.1)
    gruff (0.2.8)
    hoe (1.1.6, 1.1.2)
    hpricot (0.5.110, 0.4.86, 0.4, 0.2)
    livejournal (0.3.1, 0.3.0)
    markaby (0.5)
    metaid (1.0)
    mocha (0.4.0)
    mongrel (1.0, 0.3.13.4, 0.3.13.3)
    mongrel_cluster (0.2.1, 0.2.0)
    needle (1.3.0)
    net-ping (1.2.0)
    net-sftp (1.1.0)
    net-ssh (1.0.10)
    nitro (0.41.0)
    og (0.41.0)
    payment (1.0.1)
    piston (1.2.1)
    postgres (0.7.1)
    quickbooks (0.0.2)
    rails (1.1.6)
    rake (0.7.1)
    rc-rest (2.1.0)
    rcov (0.7.0.1)
    RedCloth (3.0.4)
    rmagick (1.14.1)
    rspec (0.7.5, 0.7.4, 0.7.0, 0.6.4)
    ruby-breakpoint (0.5.0)
    ruby-growl (1.0.1)
    rubyforge (0.3.2, 0.3.1)
    RubyInline (3.6.2)
    shipping (1.5.0)
    sources (0.0.1)
    superredcloth (1.160)
    sydparse (1.2.0)
    syntax (1.0.0)
    tattle (1.0.1)
    unicode (0.1)
    uuidtools (1.0.0)
    xml-simple (1.0.10, 1.0.9)
    ZenTest (3.4.3, 3.4.1)

Perhaps it is time to run some updates. Been running off of Rails edge forever and never remember to update those gems. :-)

puts his new beads on…

1 Okay, maybe I lied about the free beads… ;-)

Planet Argon now a RubyForge mirror

Posted by Sun, 25 Sep 2005 11:44:00 GMT

Finally got everything setup with the initial RSYNC and wanted to let it keep syncing overnight. We (PLANET ARGON) are excited to announce that we will be an official mirror of RubyForge.

The RubyForge.org downloads currently take up just over 1GB in disk space and they say that they are getting just over 200GB of transfer a month now. We’re happy to help out. :-)

We should be put into the rotation sometime in the next day. Until then you can start downloading stuff now at http://rubyforge.planetargon.com/.