(ds)

by dean@strelau.net

twitter.com/dstrelau:

    ruby -rubygems

    You know, I’ve always wondered why requiring a library on the command line is ruby -r library but you can require rubygems with ruby -rubygems. Here’s why:

    [rubygems-1.3.5] cat lib/ubygems.rb 
    # This file allows for the running of rubygems with a nice
    # command line look-and-feel: ruby -rubygems foo.rb
    #--
    # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
    # All rights reserved.
    # See LICENSE.txt for permissions.
    #++
    
    
    require 'rubygems'
    

    Nice hack.

    — 4 months ago with 3 notes
    #ruby 
    1. drj reblogged this from dstrelau
    2. dstrelau posted this