Know your rails better 8

Posted by pratik
on Thursday, September 27

Burn/donate/throw away all your ruby/rails books

1
2
3
4
5
6
7
8
lifo:~/Rails pratik$ ruby ~/Rails/rails/railties/bin/rails foobar
lifo:~/Rails pratik$ cd foobar
lifo:~/Rails/foobar pratik$ svn co http://dev.rubyonrails.com/svn/rails/trunk vendor/rails
lifo:~/Rails/foobar pratik$ cd vendor/rails/
lifo:~/Rails/foobar/vendor/rails pratik$ find . | grep .rb$ | xargs perl -pi -e 's/^\s*?#.*?$//'
lifo:~/Rails/foobar/vendor/rails pratik$ cd ../../
lifo:~/Rails/foobar pratik$ rake doc:rails
lifo:~/Rails/foobar pratik$ open doc/api/index.html 

And you’ll know the difference in 15 days.

Have fun.

Comments

Leave a response

  1. bryanlSeptember 27, 2007 @ 02:03 PM

    Piston1 is your friend. Find it. Learn it. Know it.

    1: http://piston.rubyforge.org/

  2. PratikSeptember 27, 2007 @ 02:11 PM

    Yeah, except you can’t use piston unless your main project is under svn. I’m just talking about learning. Plus, I never really use piston for edge rails.

  3. MislavSeptember 27, 2007 @ 03:12 PM

    Insane!

  4. schwabsauceSeptember 27, 2007 @ 08:01 PM

    it’s like das keyboard

  5. Dan TrippSeptember 27, 2007 @ 08:41 PM

    WOO HOO! THANK YOU SO MUCH for posting this.

    I’ve tried to use “rake doc:rails” to generate offline documentation several times, but always get funky errors that I’ve never been able to decipher, and my web searches for a solution have proven infertile. This method, however, WORKED. I’m stoked! :)

    Since you don’t have a tip jar, I donated to Child’s Play instead. Thanks again Pratik!

  6. TarmoSeptember 27, 2007 @ 11:29 PM

    git-svn fixed this bug ;)

  7. MirecOctober 02, 2007 @ 12:08 PM

    this is cool, is there a way to do this for ruby/gems/plugins at once?

  8. PratikJanuary 12, 2008 @ 02:34 PM

    A minor modification to the regexp :

    
    
    find . | grep .rb$ | xargs perl -pi -e 's/^\s*?#[^\{].*?$//'
Comment