-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
178 lines (143 loc) · 5.48 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
---
# Jekyll wants this YAML front matter to parse the document.
layout: default
title: Pry - an IRB alternative and runtime developer console
---
<header>
{% include devswag.html %}
<div class="fork_me ribbon">
<a href="http://github.com/pry/pry" rel="external"><img style="position: absolute; top: 0; right: 0; border: 0;" src="/images/clone.png" alt="Fork me on GitHub"></a>
</div>
{% include logo.html %}
<p class="infobox">
Pry is a <em>powerful</em> alternative to the standard IRB shell for
Ruby. It features <em>syntax highlighting</em>, a flexible <em>plugin
architecture</em>, <em>runtime invocation</em> and <em>source and
documentation browsing</em>.
</p>
</header>
{% include navigation.html %}
<article>
<h1>Quickstart</h1>
<p>
Install Pry:
</p>
{% highlight bash %}{% include code/install.sh %}{% endhighlight %}
<p>
Try it out: (Displaying source for FileUtils.rm)
</p>
{% highlight ruby %}{% include code/tryout.rb %}{% endhighlight %}
<p>
For comprehensive coverage of Pry's features please
<a href="https://github.com/pry/pry/wiki"><strong>check out the Wiki</strong></a> and watch the <a href="screencasts.html">screencasts</a>.
</p>
</article>
<article>
<h1>Introductory screencast</h1>
<p>
It is recommended you watch the following screencast put
together by <a href="https://github.com/joshcheek">Josh
Cheek</a>. It includes instructions on installing Pry as
well as some coverage of core features.
</p>
<center>
<iframe src="https://player.vimeo.com/video/26391171?title=0&byline=0&portrait=0"
width="633" height="475" frameborder="0"></iframe>
</center>
<p>
<a href="screencasts.html">Watch other screencasts</a>
</p>
</article>
<article>
<h1>Features</h1>
<p>
Pry is written from scratch to provide a number of advanced features,
some of these include:
</p>
<ul>
<li>Source code browsing (including core C source with the pry-doc gem)</li>
<li>Navigation around state (cd, ls and friends)</li>
<li>Documentation browsing</li>
<li>Live help system</li>
<li>Open methods in editors (edit-method Class#method)</li>
<li>Syntax highlighting</li>
<li>Command shell integration (start editors, run git, and rake from within Pry)</li>
<li>Gist integration</li>
<li>Runtime invocation (use Pry as a developer console or debugger)</li>
<li>Exotic object support (BasicObject instances, IClasses, ...)</li>
<li>A powerful and flexible command system</li>
<li>Ability to view and replay history</li>
<li>Many convenience commands inspired by IPython, Smalltalk and other advanced REPLs</li>
</ul>
<p>
Pry also aims to be more than an IRB replacement; it is an attempt to
bring REPL driven programming to the Ruby language. It is currently not
as powerful as tools like SLIME for lisp, but that is the general
direction Pry is heading.
</p>
<p>
Pry is also fairly flexible and allows significant user customization
making it a good choice for implementing custom shells.
</p>
</article>
<article>
<h1>More examples</h1>
<h2>Runtime invocation</h2>
<p>
Pry can be invoked in the middle of a running program. It opens a Pry
session at the point it's called and makes all program state at that
point available. When the session ends the program continues with any
modifications you made to it.
</p>
<p>
This functionality can be used for such things as: debugging,
implementing developer consoles and applying hot patches.
</p>
{% highlight ruby %}{% include code/runtime.rb %}{% endhighlight %}
<p>
Pry session:
</p>
{% highlight ruby %}{% include code/session.rb %}{% endhighlight %}
<h2>Command Shell Integration</h2>
<p>
A line of input that begins with a '.' will be forwarded to the command
shell. This enables us to navigate the file system, spawn editors, and
run git and rake directly from within Pry.
</p>
<p>
Further, we can use the shell-mode command to incorporate the present
working directory into the Pry prompt and bring file name completion.
We can also interpolate Ruby code directly into the shell by using the
normal #{} string interpolation syntax.
</p>
<p>
In the code below we're going to switch to shell-mode and edit the .pryrc
file in the home directory. We'll then cat its contents and reload the
file.
</p>
{% highlight ruby %}{% include code/pyrc.rb %}{% endhighlight %}
</article>
<article>
<h1>Please support Pry!</h1>
<p class="donate">
If you liked Pry and found it useful, <em>please consider
making a donation</em> to support its continued development!
</p>
<p>
Pry was a huge amount of work and every dollar received is encouraging!
</p>
</article>
<article>
<h1>Credits</h1>
<p>
The Pry core team are <a href="https://github.com/banister">John Mair</a>
(project founder; aka banisterfiend; <a href="https://twitter.com/banisterfiend">twitter</a>; <a href="http://banisterfiend.wordpress.com">blog</a>),
<a href="https://github.com/conradirwin">Conrad Irwin</a> and <a href="https://github.com/rf-">Ryan Fitzgerald</a>.
The project is also aided by a healthy number
of <a href="https://github.com/pry/pry/contributors">contributors</a>.
</p>
<p>
To participate in Pry's development (and get your name on
the list!) see the wiki article on <a href="https://github.com/pry/pry/wiki/Contributing">how to contribute</a>.
</p>
</article>