Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Random_Ruby_Tips.pdf

 Random_Ruby_Tips.pdf

Lightning Talk given as part of the RUG::B(https://www.rug-b.de/) March 2020 meetup at HeyJobs Berlin office :) I'm grateful the organisers of RUG::B for the opportunity and to the people behind HeyJobs for being such wonderful hosts :)

Mohnish G J

March 05, 2020
Tweet

More Decks by Mohnish G J

Other Decks in Programming

Transcript

  1. play -I Why this command? • A way to type

    or copy paste less and debug faster What does this pry command do? • Replay code from files & methods as if they were entered directly in the Pry REPL How to use this command? • To execute a single line of code: play -l 32 • To execute multiple lines of code: play -l 32..35 Bonus The command is very easy to remember!
  2. Why? • It’s easier than to remember/look up these options

    when creating a new rails app • You no more have to explicitly specify them like - rails new new_app_name -T --skip-turbolinks --database=postgresql Leveraging defaults for a new rails app through options defined in .railsrc How? • Edit your .railsrc file and add the following commands ◦ To use Postgres DB: --database=postgresql ◦ Skip test unit: -T ◦ Skip Turbolinks: --skip-turbolinks • Place the .railsrc file in the home directory of your computer
  3. To quit an IRB session • Command: alias q exit

    To require a file/library in IRB • Command: alias re require To relatively require a file/library in IRB • Command: alias rer require_relative Handy aliases one could add in their .irbrc
  4. Mohnish G Jadwani Twitter @mohnishgj Github boddhisattva Blog medium.com/@mohnishgj Site

    http://www.mohnishjadwani.com/ Speakerdeck https://speakerdeck.com/boddhisattva Email [email protected]