Skip to content

Instantly share code, notes, and snippets.

@davidbegin
Created June 18, 2015 15:03
Show Gist options
  • Save davidbegin/c217345207daa2fedf65 to your computer and use it in GitHub Desktop.
Save davidbegin/c217345207daa2fedf65 to your computer and use it in GitHub Desktop.

Using Pry and Gist together

gem install pry
gem install gist

gist --login # otherwise it will post anon
gist file.rb
# => https://gist.github.com/34ebbc09i62fd7909565

or inside pry, you can gist all sorts of things like the result of method call

From: /Users/dbegin/renewable/holmes/lib/database_seeder/random_location_generator.rb @ line 10 DatabaseSeeder::RandomLocationGenerator#call:

     9: def call
 => 10:   require 'pry'; binding.pry; 1
    11:   ContractorBuilder.new(payload.to_json).build
    12: end

# You might have to allow web connections if WebMock is enabled
# We should maybe look into disable this when you enter into pry through the .pryrc
[1] pry(#<DatabaseSeeder::RandomLocationGenerator>)> WebMock.allow_net_connect!

[1] pry(#<DatabaseSeeder::RandomLocationGenerator>)> gist payload
# => Gist created at URL https://gist.github.com/3le8bc99402fdv609565, which is now in the clipboard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment