emonti-wxirb 1.0.1 → 1.0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{README.rdoc → README.markdown} +16 -14
- metadata +3 -2
@@ -1,11 +1,13 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
# WxIRB
|
3
3
|
|
4
4
|
This is a GUI "irb-alike" console based on WxRuby. I wrote this because I
|
5
5
|
needed a better way to prototype and debug my wxruby applications as I was
|
6
6
|
developing them. WxIRB puts you "inside" a Wx::App.run event loop, which
|
7
7
|
lets you easily play with window objects during run-time.
|
8
8
|
|
9
|
+

|
10
|
+
|
9
11
|
This is mostly just a port of why_the_lucky_stiff's Shoes GUI irb example to
|
10
12
|
wxruby with the addition of a command history and a few other convenience
|
11
13
|
methods added in the window classes.
|
@@ -13,12 +15,12 @@ methods added in the window classes.
|
|
13
15
|
Credit to Why.
|
14
16
|
See: http://github.com/why/shoes/blob/master/samples/expert-irb.rb
|
15
17
|
|
16
|
-
|
18
|
+
## Installation
|
17
19
|
|
18
20
|
WxIRB is available as a gem from github.
|
19
21
|
|
20
22
|
gem sources -a http://gems.github.com #(you only have to do this once)
|
21
|
-
sudo gem install wxirb
|
23
|
+
sudo gem install emonti-wxirb
|
22
24
|
|
23
25
|
Or you can install it manually:
|
24
26
|
|
@@ -26,7 +28,7 @@ Or you can install it manually:
|
|
26
28
|
sudo cp wxirb/lib/wxirb.rb /usr/lib/ruby/1.8/site_ruby/1.8 # or wherever
|
27
29
|
sudo cp wxirb/bin/wxirb /usr/local/bin # or wherever
|
28
30
|
|
29
|
-
|
31
|
+
## Keyboard Interaction
|
30
32
|
|
31
33
|
WxIRB is designed to allow you to edit multi-line ruby statements in the
|
32
34
|
input window. The keyboard commands in the input text area are what you'
|
@@ -44,9 +46,9 @@ The output text area is read-only from the UI. Tabbing focus from the output
|
|
44
46
|
text area should land you back in the input text area.
|
45
47
|
|
46
48
|
|
47
|
-
|
49
|
+
## Interacting with the WxIRB Window Objects
|
48
50
|
|
49
|
-
When running
|
51
|
+
When running 'bin/wxirb' directly a global variable named '$wxirb' is created
|
50
52
|
for you which holds a reference to the WxIRB::BaseFrame window you are using.
|
51
53
|
|
52
54
|
This is done so you can easily access the UI frame object and children from
|
@@ -65,7 +67,7 @@ exposed this way:
|
|
65
67
|
when running eval() on user input. See also, 'Object Binding'.
|
66
68
|
|
67
69
|
|
68
|
-
|
70
|
+
## WxIRB CommandHistory
|
69
71
|
|
70
72
|
WxIRB maintains a persistent history log. The WxIRB history uses a separate
|
71
73
|
file from IRB which is defined by WxIRB::CommandHistory::HISTFILE. It is
|
@@ -94,7 +96,7 @@ an array with a few convenience methods and accessors:
|
|
94
96
|
* 'clear' empties the history array and persistent history file
|
95
97
|
|
96
98
|
|
97
|
-
|
99
|
+
## Output to WxIRB
|
98
100
|
|
99
101
|
The WxIRB::BaseFrame object also has an 'output' accessor which returns a
|
100
102
|
reference to the OutputTextCtrl text window half of the display. This object
|
@@ -119,7 +121,7 @@ Note: This doesn't actually inherit from or implement all of IO class, however.
|
|
119
121
|
IO object with their return values. Other than that, they do nothing.
|
120
122
|
|
121
123
|
|
122
|
-
|
124
|
+
## Object Binding
|
123
125
|
|
124
126
|
Originally, WxIRB just ran 'eval' using the TOPLEVEL_BINDING (aka main)
|
125
127
|
This is how you usually run IRB. However, it may be desirable to instantiate
|
@@ -140,7 +142,7 @@ fly.
|
|
140
142
|
|
141
143
|
* As mentioned above, WxIRB::BaseFrame also has an instance method called
|
142
144
|
set_binding. This method lets you change WxIRB's binding on the fly.
|
143
|
-
Here's a short example from inside WxIRB running 'wxirb
|
145
|
+
Here's a short example from inside WxIRB while running 'wxirb' directly:
|
144
146
|
|
145
147
|
>> self
|
146
148
|
=> main
|
@@ -161,13 +163,13 @@ fly.
|
|
161
163
|
=> main
|
162
164
|
|
163
165
|
|
164
|
-
|
166
|
+
## BUGS
|
165
167
|
|
166
168
|
* Running statements gets slow when the Output window gets very full. Not
|
167
169
|
really sure why this is, but running 'wxirb.clear' periodically helps.
|
168
170
|
|
169
|
-
* An effort is made to rescue most exceptions
|
170
|
-
close due to an un-handled exception. Regular
|
171
|
-
sometimes
|
171
|
+
* An effort is made to rescue most exceptions and display them. But
|
172
|
+
occasionally, wxirb will close due to an un-handled exception. Regular
|
173
|
+
'irb' does this too sometimes though we'd like not to.
|
172
174
|
|
173
175
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emonti-wxirb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.1
|
4
|
+
version: 1.0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Monti
|
@@ -31,9 +31,10 @@ extensions: []
|
|
31
31
|
extra_rdoc_files:
|
32
32
|
- README.rdoc
|
33
33
|
files:
|
34
|
-
- README.
|
34
|
+
- README.markdown
|
35
35
|
- bin/wxirb
|
36
36
|
- lib/wxirb.rb
|
37
|
+
- README.rdoc
|
37
38
|
has_rdoc: true
|
38
39
|
homepage: http://www.matasano.com
|
39
40
|
post_install_message:
|