Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 401 lines (301 sloc) 14.947 kB
d319e08 @banister moved build status image in README to top
banister authored
1 [![Build Status](https://secure.travis-ci.org/pry/pry.png)](http://travis-ci.org/pry/pry)
0b59951 @envygeeks Tell RBX users to complain more to us so we can make Pry better on RBX.
envygeeks authored
2
002f44e @banister trying to center logo
banister authored
3 <center>
48fe5dd @banister changed size of logo on README (reduced size)
banister authored
4 ![Alt text](http://dl.dropbox.com/u/26521875/pry_logo_350.png)
45888f1 @banister doc update, about to start on code browsing section
banister authored
5
00ac1ac @banister added travis build status to README
banister authored
6 (C) John Mair (banisterfiend) 2011<br>
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
7
8
3d9f8d1 @banister added link to atomic object sponsor to README
banister authored
9 **Please** [DONATE](http://www.pledgie.com/campaigns/15899) to the Pry project - Pry was a **huge** amount of work and every donation received is encouraging and supports Pry's continued development!
10
11 **Sponsors**
12
846f46c @banister fixed formatting for sponsors in readme
banister authored
13 [Atomic Object](http://www.atomicobject.com/)<br/>
14 [Bendyworks](http://bendyworks.com/)<br/>
15 [Intridea](http://intridea.com/)<br/>
3d9f8d1 @banister added link to atomic object sponsor to README
banister authored
16
17 **Other Resources**
74363ef @banister README improved, with links
banister authored
18
78aac6b @banister added recommendation to visit website from README
banister authored
19 [Skip to the website (recommended)](http://pry.github.com) <br />
98b6354 @banister oops, fixed broken link in wiki
banister authored
20 [Skip to the wiki](https://github.com/pry/pry/wiki)
002f44e @banister trying to center logo
banister authored
21 </center>
84d728e @banister added warning to README indicating documentation is out of date but w…
banister authored
22
a5c2dec @banister added highlighting to disabled commands in GNU bash, version 4.1.5(1)…
banister authored
23 Pry is a powerful alternative to the standard IRB shell for Ruby. It is
b707d84 @rf- Enormously important fix
rf- authored
24 written from scratch to provide a number of advanced features,
25 including:
a5c2dec @banister added highlighting to disabled commands in GNU bash, version 4.1.5(1)…
banister authored
26
a2bbd44 @banister updated docs
banister authored
27 * Source code browsing (including core C source with the pry-doc gem)
28 * Documentation browsing
29 * Live help system
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
30 * Open methods in editors (`edit-method Class#method`)
6d7cb1f @banister updated readme
banister authored
31 * Syntax highlighting
a2bbd44 @banister updated docs
banister authored
32 * Command shell integration (start editors, run git, and rake from within Pry)
33 * Gist integration
fd007cb @banister First stab at rewriting documentation, including new pry logo.
banister authored
34 * Navigation around state (`cd`, `ls` and friends)
2460df0 @banister trying out new logo, updated documentation
banister authored
35 * Runtime invocation (use Pry as a developer console or debugger)
5635e7b @benlangfeld [Typo] Fix a mistaken line break
benlangfeld authored
36 * Exotic object support (BasicObject instances, IClasses, ...)
279f2dc @benlangfeld [Typo] Missing line break
benlangfeld authored
37 * A Powerful and flexible command system
38 * Ability to view and replay history
b06cab6 @banister updated README for latest release
banister authored
39
2e6833e @banister updated README
banister authored
40 * Many convenience commands inspired by IPython, Smalltalk and other advanced REPLs
b06cab6 @banister updated README for latest release
banister authored
41 * A wide-range number of [plugins](https://github.com/pry/pry/wiki/Available-plugins) that provide remote sessions, full debugging functionality, and more.
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
42
e3a3a09 @banister added more info to documentation thanks to Asher
banister authored
43 Pry also aims to be more than an IRB replacement; it is an
44 attempt to bring REPL driven programming to the Ruby language. It is
2e6833e @banister updated README
banister authored
45 currently not as powerful as tools like [SLIME](http://en.wikipedia.org/wiki/SLIME) for lisp, but that is the
e3a3a09 @banister added more info to documentation thanks to Asher
banister authored
46 general direction Pry is heading.
47
9e78a80 @banister reworded some sections in README and Customizing-pry.md to make confi…
banister authored
48 Pry is also fairly flexible and allows significant user
d111435 @banister updated README
banister authored
49 [customization](https://github.com/pry/pry/wiki/Customization-and-configuration)
2108a05 @banister fixed docs
banister authored
50 is trivial to set it to read from any object that has a `readline` method and write to any object that has a
b4ef85d @banister fixed docs
banister authored
51 `puts` method - many other aspects of Pry are also configurable making
52 it a good choice for implementing custom shells.
9e78a80 @banister reworded some sections in README and Customizing-pry.md to make confi…
banister authored
53
e1d2372 @banister version 0.7.0, added pry-doc support and a few misc things.
banister authored
54 Pry comes with an executable so it can be invoked at the command line.
22d31c0 @banister version 0.5.7, added Pry executable, pry --help at command line for m…
banister authored
55 Just enter `pry` to start. A `.pryrc` file in the user's home directory will
e1d2372 @banister version 0.7.0, added pry-doc support and a few misc things.
banister authored
56 be loaded if it exists. Type `pry --help` at the command line for more
57 information.
58
59 Try `gem install pry-doc` for additional documentation on Ruby Core
60 methods. The additional docs are accessed through the `show-doc` and
61 `show-method` commands.
22d31c0 @banister version 0.5.7, added Pry executable, pry --help at command line for m…
banister authored
62
62d1e31 @banister updated README
banister authored
63 * Install the [gem](https://rubygems.org/gems/pry): `gem install pry`
74363ef @banister README improved, with links
banister authored
64 * Browse the comprehensive [documentation at the official Pry wiki](https://github.com/pry/pry/wiki)
d111435 @banister updated README
banister authored
65 * Read the [YARD API documentation](http://rdoc.info/github/pry/pry/master/file/README.markdown)
bcf239c @banister testing new repo
banister authored
66 * See the [source code](http://github.com/pry/pry)
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
67
6aacc87 @banister Made it so defining methods on a pry'd on object puts the methods on …
banister authored
68 Pry also has `rubygems-test` support; to participate, first install
69 Pry, then:
70
71 1. Install rubygems-test: `gem install rubygems-test`
72 2. Run the test: `gem test pry`
973c8f2 @banister updated docs
banister authored
73 3. Finally choose 'Yes' to upload the results.
6aacc87 @banister Made it so defining methods on a pry'd on object puts the methods on …
banister authored
74
973c8f2 @banister updated docs
banister authored
75 ### Commands
76
a2bbd44 @banister updated docs
banister authored
77 Nearly every piece of functionality in a Pry session is implemented as
78 a command. Commands are not methods and must start at the beginning of a line, with no
973c8f2 @banister updated docs
banister authored
79 whitespace in between. Commands support a flexible syntax and allow
a2bbd44 @banister updated docs
banister authored
80 'options' in the same way as shell commands, for example the following
81 Pry command will show a list of all private instance methods (in
82 scope) that begin with 'pa'
83
939c7f1 @banister fixed mistake in readme
banister authored
84 pry(YARD::Parser::SourceParser):5> ls -Mp --grep ^pa
b06cab6 @banister updated README for latest release
banister authored
85 YARD::Parser::SourceParser#methods: parse parser_class parser_type parser_type= parser_type_for_filename
a2bbd44 @banister updated docs
banister authored
86
537c4a6 @banister updated code browsing section
banister authored
87 ### Navigating around state
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
88
6d7cb1f @banister updated readme
banister authored
89 Pry allows us to pop in and out of different scopes (objects) using
fa8ca37 @banister added doc browsing section to readme
banister authored
90 the `cd` command. This enables us to explore the run-time view of a
91 program or library. To view which variables and methods are available
537c4a6 @banister updated code browsing section
banister authored
92 within a particular scope we use the versatile [ls command.](https://gist.github.com/c0fc686ef923c8b87715)
62d1e31 @banister updated README
banister authored
93
a2bbd44 @banister updated docs
banister authored
94 Here we will begin Pry at top-level, then Pry on a class and then on
62d1e31 @banister updated README
banister authored
95 an instance variable inside that class:
96
97 pry(main)> class Hello
98 pry(main)* @x = 20
99 pry(main)* end
100 => 20
dd6e207 @banister updated docs
banister authored
101 pry(main)> cd Hello
6d7cb1f @banister updated readme
banister authored
102 pry(Hello):1> ls -i
b06cab6 @banister updated README for latest release
banister authored
103 instance variables: @x
dd6e207 @banister updated docs
banister authored
104 pry(Hello):1> cd @x
a25c40d @banister version bump to 0.1.3 and slight aesthetic changes to code
banister authored
105 pry(20:2)> self + 10
62d1e31 @banister updated README
banister authored
106 => 30
99c0cb3 @banister udpated readme
banister authored
107 pry(20:2)> cd ..
108 pry(Hello):1> cd ..
109 pry(main)> cd ..
a25c40d @banister version bump to 0.1.3 and slight aesthetic changes to code
banister authored
110
111 The number after the `:` in the pry prompt indicates the nesting
112 level. To display more information about nesting, use the `nesting`
113 command. E.g
114
115 pry("friend":3)> nesting
116 Nesting status:
117 0. main (Pry top level)
118 1. Hello
119 2. 100
120 3. "friend"
121 => nil
ce3532e @banister added Pry.sessions and Pry#parent, for more info on pry sessions. Als…
banister authored
122
a25c40d @banister version bump to 0.1.3 and slight aesthetic changes to code
banister authored
123 We can then jump back to any of the previous nesting levels by using
42d1c12 @banister version 0.5.0pre4 Almost ready for release. Updated examples to match…
banister authored
124 the `jump-to` command:
a25c40d @banister version bump to 0.1.3 and slight aesthetic changes to code
banister authored
125
42d1c12 @banister version 0.5.0pre4 Almost ready for release. Updated examples to match…
banister authored
126 pry("friend":3)> jump-to 1
a25c40d @banister version bump to 0.1.3 and slight aesthetic changes to code
banister authored
127 => 100
128 pry(Hello):1>
129
537c4a6 @banister updated code browsing section
banister authored
130 ### Runtime invocation
2460df0 @banister trying out new logo, updated documentation
banister authored
131
132 Pry can be invoked in the middle of a running program. It opens a Pry
e6f664f @banister got rid of stray unicode char from README
banister authored
133 session at the point it's called and makes all program state at that
d52182c @banister updated docs for more specific info on runtime invocation
banister authored
134 point available. It can be invoked on any object using the
135 `my_object.pry` syntax or on the current binding (or any binding)
136 using `binding.pry`. The Pry session will then begin within the scope
137 of the object (or binding). When the session ends the program continues with any
2460df0 @banister trying out new logo, updated documentation
banister authored
138 modifications you made to it.
139
140 This functionality can be used for such things as: debugging,
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
141 implementing developer consoles and applying hot patches.
2460df0 @banister trying out new logo, updated documentation
banister authored
142
143 code:
144
145 # test.rb
146 require 'pry'
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
147
2460df0 @banister trying out new logo, updated documentation
banister authored
148 class A
149 def hello() puts "hello world!" end
150 end
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
151
2460df0 @banister trying out new logo, updated documentation
banister authored
152 a = A.new
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
153
2460df0 @banister trying out new logo, updated documentation
banister authored
154 # start a REPL session
155 binding.pry
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
156
2460df0 @banister trying out new logo, updated documentation
banister authored
157 # program resumes here (after pry session)
158 puts "program resumes here."
159
160 Pry session:
161
162 pry(main)> a.hello
163 hello world!
164 => nil
165 pry(main)> def a.goodbye
166 pry(main)* puts "goodbye cruel world!"
167 pry(main)* end
168 => nil
169 pry(main)> a.goodbye
170 goodbye cruel world!
171 => nil
172 pry(main)> exit
173
8af6e4f @banister new logo
banister authored
174 program resumes here.
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
175
537c4a6 @banister updated code browsing section
banister authored
176 ### Command Shell Integration
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
177
178 A line of input that begins with a '.' will be forwarded to the
179 command shell. This enables us to navigate the file system, spawn
537c4a6 @banister updated code browsing section
banister authored
180 editors, and run git and rake directly from within Pry.
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
181
182 Further, we can use the `shell-mode` command to incorporate the
537c4a6 @banister updated code browsing section
banister authored
183 present working directory into the Pry prompt and bring in (limited at this stage, sorry) file name completion.
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
184 We can also interpolate Ruby code directly into the shell by
185 using the normal `#{}` string interpolation syntax.
186
537c4a6 @banister updated code browsing section
banister authored
187 In the code below we're going to switch to `shell-mode` and edit the
26af578 @banister updated docs, added contributors and fixed a couple of typos
banister authored
188 `.pryrc` file in the home directory. We'll then cat its contents and
537c4a6 @banister updated code browsing section
banister authored
189 reload the file.
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
190
191 pry(main)> shell-mode
537c4a6 @banister updated code browsing section
banister authored
192 pry main:/home/john/ruby/projects/pry $ .cd ~
193 pry main:/home/john $ .emacsclient .pryrc
194 pry main:/home/john $ .cat .pryrc
195 def hello_world
196 puts "hello world!"
197 end
198 pry main:/home/john $ load ".pryrc"
199 => true
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
200 pry main:/home/john $ hello_world
537c4a6 @banister updated code browsing section
banister authored
201 hello world!
202
203 We can also interpolate Ruby code into the shell. In the
45888f1 @banister doc update, about to start on code browsing section
banister authored
204 example below we use the shell command `cat` on a random file from the
205 current directory and count the number of lines in that file with
206 `wc`:
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
207
537c4a6 @banister updated code browsing section
banister authored
208 pry main:/home/john $ .cat #{Dir['*.*'].sample} | wc -l
209 44
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
210
537c4a6 @banister updated code browsing section
banister authored
211 ### Code Browsing
212
213 You can browse method source code with the `show-method` command. Nearly all Ruby methods (and some C methods, with the pry-doc
214 gem) can have their source viewed. Code that is longer than a page is
215 sent through a pager (such as less), and all code is properly syntax
216 highlighted (even C code).
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
217
537c4a6 @banister updated code browsing section
banister authored
218 The `show-method` command accepts two syntaxes, the typical ri
219 `Class#method` syntax and also simply the name of a method that's in
220 scope. You can optionally pass the `-l` option to show-method to
221 include line numbers in the output.
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
222
537c4a6 @banister updated code browsing section
banister authored
223 In the following example we will enter the `Pry` class, list the
224 instance methods beginning with 're' and display the source code for the `rep` method:
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
225
537c4a6 @banister updated code browsing section
banister authored
226 pry(main)> cd Pry
7684e4c @banister Update README.markdown
banister authored
227 pry(Pry)> ls -M --grep re
228 Pry#methods: re readline refresh rep repl repl_epilogue repl_prologue retrieve_line
537c4a6 @banister updated code browsing section
banister authored
229 pry(Pry):1> show-method rep -l
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
230
537c4a6 @banister updated code browsing section
banister authored
231 From: /home/john/ruby/projects/pry/lib/pry/pry_instance.rb @ line 143:
232 Number of lines: 6
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
233
537c4a6 @banister updated code browsing section
banister authored
234 143: def rep(target=TOPLEVEL_BINDING)
235 144: target = Pry.binding_for(target)
236 145: result = re(target)
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
237 146:
537c4a6 @banister updated code browsing section
banister authored
238 147: show_result(result) if should_print?
239 148: end
240
241 Note that we can also view C methods (from Ruby Core) using the
d111435 @banister updated README
banister authored
242 `pry-doc` plugin; we also show off the alternate syntax for
537c4a6 @banister updated code browsing section
banister authored
243 `show-method`:
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
244
537c4a6 @banister updated code browsing section
banister authored
245 pry(main)> show-method Array#select
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
246
537c4a6 @banister updated code browsing section
banister authored
247 From: array.c in Ruby Core (C Method):
248 Number of lines: 15
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
249
537c4a6 @banister updated code browsing section
banister authored
250 static VALUE
251 rb_ary_select(VALUE ary)
252 {
253 VALUE result;
254 long i;
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
255
537c4a6 @banister updated code browsing section
banister authored
256 RETURN_ENUMERATOR(ary, 0, 0);
257 result = rb_ary_new2(RARRAY_LEN(ary));
258 for (i = 0; i < RARRAY_LEN(ary); i++) {
259 if (RTEST(rb_yield(RARRAY_PTR(ary)[i]))) {
260 rb_ary_push(result, rb_ary_elt(ary, i));
261 }
262 }
263 return result;
264 }
263e722 @banister resolved conflict, brought in injekt's awesome changes, added changes…
banister authored
265
973c8f2 @banister updated docs
banister authored
266 ### Documentation Browsing
fa8ca37 @banister added doc browsing section to readme
banister authored
267
268 One use-case for Pry is to explore a program at run-time by `cd`-ing
269 in and out of objects and viewing and invoking methods. In the course
270 of exploring it may be useful to read the documentation for a
271 specific method that you come across. Like `show-method` the `show-doc` command supports
272 two syntaxes - the normal `ri` syntax as well as accepting the name of
273 any method that is currently in scope.
274
275 The Pry documentation system does not rely on pre-generated `rdoc` or
276 `ri`, instead it grabs the comments directly above the method on
277 demand. This results in speedier documentation retrieval and allows
278 the Pry system to retrieve documentation for methods that would not be
279 picked up by `rdoc`. Pry also has a basic understanding of both the
280 rdoc and yard formats and will attempt to syntax highlight the
281 documentation appropriately.
282
87b519e @jollysonali Fixed grammar in README
jollysonali authored
283 Nonetheless, the `ri` functionality is very good and
fa8ca37 @banister added doc browsing section to readme
banister authored
284 has an advantage over Pry's system in that it allows documentation
285 lookup for classes as well as methods. Pry therefore has good
286 integration with `ri` through the `ri` command. The syntax
287 for the command is exactly as it would be in command-line -
973c8f2 @banister updated docs
banister authored
288 so it is not necessary to quote strings.
fa8ca37 @banister added doc browsing section to readme
banister authored
289
290 In our example we will enter the `Gem` class and view the
291 documentation for the `try_activate` method:
292
293 pry(main)> cd Gem
973c8f2 @banister updated docs
banister authored
294 pry(Gem):1> show-doc try_activate
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
295
fa8ca37 @banister added doc browsing section to readme
banister authored
296 From: /Users/john/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb @ line 201:
297 Number of lines: 3
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
298
fa8ca37 @banister added doc browsing section to readme
banister authored
299 Try to activate a gem containing path. Returns true if
300 activation succeeded or wasn't needed because it was already
301 activated. Returns false if it can't find the path in a gem.
302 pry(Gem):1>
303
304 We can also use `ri` in the normal way:
305
306 pry(main) ri Array#each
307 ----------------------------------------------------------- Array#each
308 array.each {|item| block } -> array
309 ------------------------------------------------------------------------
310 Calls _block_ once for each element in _self_, passing that element
311 as a parameter.
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
312
fa8ca37 @banister added doc browsing section to readme
banister authored
313 a = [ "a", "b", "c" ]
314 a.each {|x| print x, " -- " }
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
315
fa8ca37 @banister added doc browsing section to readme
banister authored
316 produces:
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
317
fa8ca37 @banister added doc browsing section to readme
banister authored
318 a -- b -- c --
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
319
a2bbd44 @banister updated docs
banister authored
320 ### Gist integration
321
26af578 @banister updated docs, added contributors and fixed a couple of typos
banister authored
322 If the `gist` gem is installed then method source or documentation can be gisted to github with the
b06cab6 @banister updated README for latest release
banister authored
323 `gist` command. The `gist` command is capable of gisting [almost any REPL content](https://gist.github.com/cae143e4533416529726), including methods, documentation,
7684e4c @banister Update README.markdown
banister authored
324 input expressions, command source, and so on. In the example below we will gist the C source
a2bbd44 @banister updated docs
banister authored
325 code for the `Symbol#to_proc` method to github:
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
326
7684e4c @banister Update README.markdown
banister authored
327 pry(main)> gist -m Symbol#to_proc
328 Gist created at https://gist.github.com/5332c38afc46d902ce46 and added to clipboard.
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
329 pry(main)>
330
331 You can see the actual gist generated here: [https://gist.github.com/5332c38afc46d902ce46](https://gist.github.com/5332c38afc46d902ce46)
332
333 ### Edit methods
334
335 You can use `edit-method Class#method` or `edit-method my_method`
336 (if the method is in scope) to open a method for editing directly in
337 your favorite editor. Pry has knowledge of a few different editors and
338 will attempt to open the file at the line the method is defined.
339
db5d582 @banister fixed encoding issue in readme
banister authored
340 You can set the editor to use by assigning to the `Pry.editor`
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
341 accessor. `Pry.editor` will default to `$EDITOR` or failing that will
342 use `nano` as the backup default. The file that is edited will be
343 automatically reloaded after exiting the editor - reloading can be
f6f7e81 @banister updated docs, fixed unicode error
banister authored
344 suppressed by passing the `--no-reload` option to `edit-method`
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
345
346 In the example below we will set our default editor to "emacsclient"
347 and open the `Pry#repl` method for editing:
348
349 pry(main)> Pry.editor = "emacsclient"
350 pry(main)> edit-method Pry#repl
a2bbd44 @banister updated docs
banister authored
351
352 ### Live Help System
973c8f2 @banister updated docs
banister authored
353
a2bbd44 @banister updated docs
banister authored
354 Many other commands are available in Pry; to see the full list type
355 `help` at the prompt. A short description of each command is provided
356 with basic instructions for use; some commands have a more extensive
26af578 @banister updated docs, added contributors and fixed a couple of typos
banister authored
357 help that can be accessed via typing `command_name --help`. A command
a2bbd44 @banister updated docs
banister authored
358 will typically say in its description if the `--help` option is
359 avaiable.
62d1e31 @banister updated README
banister authored
360
7d905c7 @xaviershay Added less-intrusive Rails console instructions, added a caveat to th…
xaviershay authored
361 ### Use Pry as your Rails Console
55fd3b8 @banister added info on using pry as rails 3 console to README
banister authored
362
ba580f4 @jrunning On my machine (RVM, Ruby 1.9.2, Rails 3.0.9, MacOS 10.6) this throws …
jrunning authored
363 pry -r ./config/environment
55fd3b8 @banister added info on using pry as rails 3 console to README
banister authored
364
7d905c7 @xaviershay Added less-intrusive Rails console instructions, added a caveat to th…
xaviershay authored
365 MyArtChannel has kindly provided a hack to replace the `rails console` command in Rails 3: [https://gist.github.com/941174](https://gist.github.com/941174) This is not recommended for code bases with multiple developers, as they may not all want to use Pry.
62d1e31 @banister updated README
banister authored
366
b06cab6 @banister updated README for latest release
banister authored
367 Also check out the [wiki](https://github.com/pry/pry/wiki/Setting-up-Rails-or-Heroku-to-use-Pry) for other strategies on integrating Pry with rails, notably the [pry-rails](https://github.com/pry/pry/wiki/Setting-up-Rails-or-Heroku-to-use-Pry#wiki-pry_rails) plugin.
368
d111435 @banister updated README
banister authored
369 ### Limitations:
370
fb5df51 @banister almost finished readme
banister authored
371 * Tab completion is currently a bit broken/limited this will have a
d111435 @banister updated README
banister authored
372 major overhaul in a future version.
9ba396b @banister version 0.8.3, added edit-method and updated documention for edit-method
banister authored
373
0f38673 @banister updated docs, properly structured headings
banister authored
374 ### Syntax Highlighting
4b9198d @banister version 0.6.8, added whereami command, made .pryrc run at the start o…
banister authored
375
376 Syntax highlighting is on by default in Pry. You can toggle it on and
377 off in a session by using the `toggle-color` command. Alternatively,
378 you can turn it off permanently by putting the line `Pry.color =
379 false` in your `~/.pryrc` file.
380
0f38673 @banister updated docs, properly structured headings
banister authored
381 ### Future Directions
32ec3d2 @banister updated documentation with details on future direction; stated JRuby …
banister authored
382
383 Many new features are planned such as:
384
74363ef @banister README improved, with links
banister authored
385 * Increase modularity (rely more on plugin system)
32ec3d2 @banister updated documentation with details on future direction; stated JRuby …
banister authored
386 * Much improved tab completion (using [Bond](http://github.com/cldwalker/bond))
387 * Much improved documentation system, better support for YARD
74363ef @banister README improved, with links
banister authored
388 * Better support for code and method reloading and saving code
32ec3d2 @banister updated documentation with details on future direction; stated JRuby …
banister authored
389 * Extended and more sophisticated command system, allowing piping
390 between commands and running commands in background
391
0f38673 @banister updated docs, properly structured headings
banister authored
392 ### Contact
2dc06b2 @banister adding READMEs and CHANGELOG etc
banister authored
393
eab393c @banister Update master
banister authored
394 Problems or questions? file an issue at [github](https://github.com/pry/pry/issues)
fb5df51 @banister almost finished readme
banister authored
395
0f38673 @banister updated docs, properly structured headings
banister authored
396 ### Contributors
fb5df51 @banister almost finished readme
banister authored
397
2e6833e @banister updated README
banister authored
398 Pry is primarily the work of [John Mair (banisterfiend)]((http://github.com/banister)), for full list
399 of contributors see the
400 [CONTRIBUTORS](https://github.com/pry/pry/blob/master/CONTRIBUTORS) file.
Something went wrong with that request. Please try again.