0.01
No commit activity in last 3 years
No release in over 3 years
Allows you to do object.@instance_var, or object.!private_method(:args), or foo.map &object.:method_name
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.9.8
 Project Readme

Introduction

Pry Syntax Hacks adds a few short-hands to help when exploring ruby objects.

The word "hack" is in the name of the gem deliberately — using this will almost certainly bite you in unexpected ways.

Features

Accessing instance variables:

pry (main)> User.new.@secret_password
=> "lollercoaster"

Calling private methods:

pry (main)> User.new.!hash_password("foo")
=> "a4721n"

Accessing method objects:

pry (main)> ["foo@bar.com"].map &User.:find_by_email

Accessing outer Pry bindings:

pry (main)> cd (a = Object.new)
pry (main)> puts ../a
#<Object:0x195aca8>

Issues

This will break regular expressions most often:

pry (main)>  Users.all.map(&:email).grep /...@foo.com/

will still get rewritten to:

pry (main)> Users.all.map(&:email).grep /..instance_variable_get('@foo').com/

which is probably not what you want.

Meta-foo

Licensed under the MIT license. Contributions welcome.