Efficient Development with Pry, Or Why You'll Love This Gem

10
Ana Perez Will Lowry Efficient Development with Pry Flatiron School Ruby-005 Jul-29-2014

description

Flatiron Students Ana Perez and Will Lowry talk about why they've been using Pry—a gem that can be used as an alternative to IRB. It allows you to step into your Ruby program by acting as an interactive shell.

Transcript of Efficient Development with Pry, Or Why You'll Love This Gem

Page 1: Efficient Development with Pry, Or Why You'll Love This Gem

Ana Perez Will Lowry

Efficient Development with Pry

Flatiron School Ruby-005

Jul-29-2014

Page 2: Efficient Development with Pry, Or Why You'll Love This Gem

• What is Pry?

PRY

• Why you will love Pry

• Setting up Pry

• Using Pry

Page 3: Efficient Development with Pry, Or Why You'll Love This Gem

WHAT IS PRY?

All modern scripting languages have an Eval function that allows to Read Eval

Print Loop (REPL)

PRY is a gem that can be used as an alternative to IRB. It allows you to step into your Ruby program

by acting as an interactive shell

Page 4: Efficient Development with Pry, Or Why You'll Love This Gem

WHY YOU WILL LOVE PRY?

Programming Time

50%Debugging

50%Productive

Source: Evans Data Corporation (2012), Payscale (2012) RTI (2002), CVP Surveys (2012)

Page 5: Efficient Development with Pry, Or Why You'll Love This Gem

WHY YOU WILL LOVE PRY?

Annual Software Development Wages

Annual Software Development Wages Spent on Debugging

Source: Evans Data Corporation (2012), Payscale (2012) RTI (2002), CVP Surveys (2012)

Page 6: Efficient Development with Pry, Or Why You'll Love This Gem

WHY YOU WILL LOVE PRY?

Get it right the first time!

Page 7: Efficient Development with Pry, Or Why You'll Love This Gem
Page 8: Efficient Development with Pry, Or Why You'll Love This Gem

SETUP

require ‘pry’

require ‘pry-rescue/rspec’

gem install pry

gem install pry-plus

Page 9: Efficient Development with Pry, Or Why You'll Love This Gem

SETUP

DEMO

Page 10: Efficient Development with Pry, Or Why You'll Love This Gem

COMMANDS RECAP

• show-doc • show-source • ls • cd • whereami • edit

• play • wtf? • wtf???? • cat—ex • try-again