fxri 0.3.5 → 0.3.6
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/fxri-0.3.6.tar.gz +0 -0
- data/fxri.gemspec +1 -1
- data/lib/fxirb.rb +433 -369
- metadata +3 -2
data/fxri-0.3.6.tar.gz
ADDED
Binary file
|
data/fxri.gemspec
CHANGED
@@ -4,7 +4,7 @@ require 'rubygems'
|
|
4
4
|
spec = Gem::Specification.new do |s|
|
5
5
|
s.name = "fxri"
|
6
6
|
s.add_dependency('fxruby', '>= 1.2.0')
|
7
|
-
s.version = "0.3.
|
7
|
+
s.version = "0.3.6"
|
8
8
|
s.date = Time.now
|
9
9
|
s.summary = "Graphical interface to the RI documentation, with search engine."
|
10
10
|
s.require_paths = ["lib"]
|
data/lib/fxirb.rb
CHANGED
@@ -1,20 +1,17 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
|
-
# TODO
|
4
|
-
# - handle user input redirection
|
5
|
-
# - readline
|
6
|
-
|
7
3
|
# Credits:
|
8
4
|
# - Initial linux version: Gilles Filippini
|
9
5
|
# - Initial windows port : Marco Frailis
|
10
|
-
# - Currently maintained and developed by
|
6
|
+
# - Currently maintained and developed by
|
11
7
|
# Martin DeMello <martindemello@gmail.com>
|
12
8
|
|
13
|
-
#
|
14
|
-
#require "
|
9
|
+
# fxri already includes Fox
|
10
|
+
#require "fox12"
|
15
11
|
require "irb"
|
16
12
|
require "singleton"
|
17
13
|
require "English"
|
14
|
+
require 'thread'
|
18
15
|
|
19
16
|
include Fox
|
20
17
|
|
@@ -22,380 +19,447 @@ STDOUT.sync = true
|
|
22
19
|
|
23
20
|
class FXIRBInputMethod < IRB::StdioInputMethod
|
24
21
|
|
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
|
-
|
22
|
+
attr_accessor :print_prompt, :gets_mode
|
23
|
+
|
24
|
+
def initialize
|
25
|
+
super
|
26
|
+
@history = 1
|
27
|
+
@begin = nil
|
28
|
+
@end = nil
|
29
|
+
@print_prompt = true
|
30
|
+
@continued_from = nil
|
31
|
+
@gets_mode = false
|
32
|
+
end
|
33
|
+
|
34
|
+
def gets
|
35
|
+
if @gets_mode
|
36
|
+
return FXIrb.instance.get_line
|
37
|
+
end
|
38
|
+
|
39
|
+
if (a = @prompt.match(/(\d+)[>*]/))
|
40
|
+
level = a[1].to_i
|
41
|
+
continued = @prompt =~ /\*\s*$/
|
42
|
+
else
|
43
|
+
level = 0
|
44
|
+
end
|
45
|
+
|
46
|
+
if level > 0 or continued
|
47
|
+
@continued_from ||= @line_no
|
48
|
+
elsif @continued_from
|
49
|
+
merge_last(@line_no-@continued_from+1)
|
50
|
+
@continued_from = nil
|
51
|
+
end
|
52
|
+
|
53
|
+
l = @line.length
|
54
|
+
@line = @line.reverse.uniq.reverse
|
55
|
+
delta = l - @line.length
|
56
|
+
@line_no -= delta
|
57
|
+
@history -= delta
|
58
|
+
|
59
|
+
if print_prompt
|
60
|
+
print @prompt
|
61
|
+
|
62
|
+
#indentation
|
63
|
+
print " "*level
|
64
|
+
end
|
65
|
+
|
66
|
+
str = FXIrb.instance.get_line
|
67
|
+
|
68
|
+
@line_no += 1
|
69
|
+
@history = @line_no + 1
|
70
|
+
@line[@line_no] = str
|
71
|
+
|
72
|
+
str
|
73
|
+
end
|
74
|
+
|
75
|
+
# merge a block spanning several lines into one \n-separated line
|
76
|
+
def merge_last(i)
|
77
|
+
return unless i > 1
|
78
|
+
range = -i..-1
|
79
|
+
@line[range] = @line[range].join
|
80
|
+
@line_no -= (i-1)
|
81
|
+
@history -= (i-1)
|
82
|
+
end
|
83
|
+
|
84
|
+
def prev_cmd
|
85
|
+
return "" if @gets_mode
|
86
|
+
|
87
|
+
if @line_no > 0
|
88
|
+
@history -= 1 unless @history <= 1
|
89
|
+
return line(@history)
|
90
|
+
end
|
91
|
+
return ""
|
92
|
+
end
|
93
|
+
|
94
|
+
def next_cmd
|
95
|
+
return "" if @gets_mode
|
96
|
+
|
97
|
+
if (@line_no > 0) && (@history < @line_no)
|
98
|
+
@history += 1
|
99
|
+
return line(@history)
|
100
|
+
end
|
101
|
+
return ""
|
102
|
+
end
|
99
103
|
|
100
104
|
end
|
101
105
|
|
102
106
|
module IRB
|
103
107
|
|
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
|
-
|
108
|
+
def IRB.start_in_fxirb(im)
|
109
|
+
if RUBY_VERSION < "1.7.3"
|
110
|
+
IRB.initialize(nil)
|
111
|
+
IRB.parse_opts
|
112
|
+
IRB.load_modules
|
113
|
+
else
|
114
|
+
IRB.setup(nil)
|
115
|
+
end
|
116
|
+
|
117
|
+
irb = Irb.new(nil, im)
|
118
|
+
|
119
|
+
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
|
120
|
+
@CONF[:MAIN_CONTEXT] = irb.context
|
121
|
+
trap("SIGINT") do
|
122
|
+
irb.signal_handle
|
123
|
+
end
|
124
|
+
|
125
|
+
class << irb.context.workspace.main
|
126
|
+
def gets
|
127
|
+
inp = IRB.conf[:MAIN_CONTEXT].io
|
128
|
+
inp.gets_mode = true
|
129
|
+
retval = IRB.conf[:MAIN_CONTEXT].io.gets
|
130
|
+
inp.gets_mode = false
|
131
|
+
retval
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
catch(:IRB_EXIT) do
|
136
|
+
irb.eval_input
|
137
|
+
end
|
138
|
+
print "\n"
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
class FXEvent
|
144
|
+
def ctrl?
|
145
|
+
(self.state & CONTROLMASK) != 0
|
146
|
+
end
|
137
147
|
|
148
|
+
def shift?
|
149
|
+
(self.state & SHIFTMASK) != 0
|
150
|
+
end
|
138
151
|
end
|
139
152
|
|
140
153
|
|
141
154
|
class FXIrb < FXText
|
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
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
155
|
+
include Singleton
|
156
|
+
include Responder
|
157
|
+
|
158
|
+
attr_reader :input
|
159
|
+
attr_accessor :multiline
|
160
|
+
|
161
|
+
def FXIrb.init(p, tgt, sel, opts)
|
162
|
+
unless @__instance__
|
163
|
+
Thread.critical = true
|
164
|
+
begin
|
165
|
+
@__instance__ ||= new(p, tgt, sel, opts)
|
166
|
+
ensure
|
167
|
+
Thread.critical = false
|
168
|
+
end
|
169
|
+
end
|
170
|
+
return @__instance__
|
171
|
+
end
|
172
|
+
|
173
|
+
def initialize(p, tgt, sel, opts)
|
174
|
+
FXMAPFUNC(SEL_KEYRELEASE, 0, "onKeyRelease")
|
175
|
+
FXMAPFUNC(SEL_KEYPRESS, 0, "onKeyPress")
|
176
|
+
FXMAPFUNC(SEL_LEFTBUTTONPRESS,0,"onLeftBtnPress")
|
177
|
+
FXMAPFUNC(SEL_MIDDLEBUTTONPRESS,0,"onMiddleBtnPress")
|
178
|
+
FXMAPFUNC(SEL_LEFTBUTTONRELEASE,0,"onLeftBtnRelease")
|
179
|
+
|
180
|
+
super
|
181
|
+
setFont(FXFont.new(FXApp.instance, "lucida console", 9))
|
182
|
+
@anchor = 0
|
183
|
+
end
|
184
|
+
|
185
|
+
def create
|
186
|
+
super
|
187
|
+
setFocus
|
188
|
+
# IRB initialization
|
189
|
+
@inputAdded = 0
|
190
|
+
@input = IO.pipe
|
191
|
+
$DEFAULT_OUTPUT = self
|
192
|
+
|
193
|
+
@im = FXIRBInputMethod.new
|
194
|
+
@irb = Thread.new {
|
195
|
+
IRB.start_in_fxirb(@im)
|
196
|
+
self.crash
|
197
|
+
}
|
198
|
+
|
199
|
+
@multiline = false
|
200
|
+
|
201
|
+
@exit_proc = lambda {exit}
|
202
|
+
end
|
203
|
+
|
204
|
+
def on_exit(&block)
|
205
|
+
@exit_proc = block
|
206
|
+
end
|
207
|
+
|
208
|
+
private
|
209
|
+
|
210
|
+
def crash
|
211
|
+
instance_eval(&@exit_proc)
|
212
|
+
end
|
213
|
+
|
214
|
+
def onLeftBtnPress(sender,sel,event)
|
215
|
+
@store_anchor = @anchor
|
216
|
+
setFocus
|
217
|
+
super
|
218
|
+
end
|
219
|
+
|
220
|
+
def onLeftBtnRelease(sender,sel,event)
|
221
|
+
super
|
222
|
+
@anchor = @store_anchor
|
223
|
+
setCursorPos(getLength)
|
224
|
+
end
|
225
|
+
|
226
|
+
def onMiddleBtnPress(sender,sel,event)
|
227
|
+
pos = getPosAt(event.win_x,event.win_y)
|
228
|
+
if pos >= @anchor
|
229
|
+
super
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
def onKeyRelease(sender, sel, event)
|
234
|
+
case event.code
|
235
|
+
when KEY_Return, KEY_KP_Enter
|
236
|
+
new_line_entered unless empty_frame?
|
237
|
+
end
|
238
|
+
return 1
|
239
|
+
end
|
240
|
+
|
241
|
+
def onKeyPress(sender,sel,event)
|
242
|
+
case event.code
|
243
|
+
when KEY_Return, KEY_KP_Enter
|
244
|
+
move_to_end_of_frame
|
245
|
+
super unless empty_frame?
|
246
|
+
|
247
|
+
when KEY_Up,KEY_KP_Up
|
248
|
+
multiline = true if get_from_start_of_line =~ /\n/
|
249
|
+
multiline ? super : history(:prev)
|
250
|
+
move_to_start_of_line if invalid_pos?
|
251
|
+
|
252
|
+
when KEY_Down,KEY_KP_Down
|
253
|
+
multiline = true if get_to_end_of_line =~ /\n/
|
254
|
+
multiline ? super : history(:next)
|
255
|
+
|
256
|
+
when KEY_Left,KEY_KP_Left
|
257
|
+
super if can_move_left?
|
258
|
+
|
259
|
+
when KEY_Delete,KEY_KP_Delete,KEY_BackSpace
|
260
|
+
if event.shift? or event.ctrl?
|
261
|
+
event.code == KEY_BackSpace ?
|
262
|
+
delete_from_start_of_line :
|
263
|
+
delete_to_end_of_line
|
264
|
+
elsif can_move_left?
|
265
|
+
super
|
266
|
+
end
|
267
|
+
|
268
|
+
when KEY_Home, KEY_KP_Home
|
269
|
+
move_to_start_of_line
|
270
|
+
|
271
|
+
when KEY_End, KEY_KP_End
|
272
|
+
move_to_end_of_line
|
273
|
+
|
274
|
+
when KEY_Page_Up, KEY_KP_Page_Up
|
275
|
+
history(:prev)
|
276
|
+
|
277
|
+
when KEY_Page_Down, KEY_KP_Page_Down
|
278
|
+
history(:next)
|
279
|
+
|
280
|
+
when KEY_bracketright, KEY_braceright
|
281
|
+
#auto-auto_dedent if the } or ] is on a line by itself
|
282
|
+
auto_dedent if empty_frame? and indented?
|
283
|
+
super
|
284
|
+
|
285
|
+
when KEY_u
|
286
|
+
event.ctrl? ? delete_from_start_of_line : super
|
287
|
+
|
288
|
+
when KEY_k
|
289
|
+
event.ctrl? ? delete_to_end_of_line : super
|
290
|
+
|
291
|
+
when KEY_d
|
292
|
+
if event.ctrl? and empty_frame?
|
293
|
+
quit_irb
|
294
|
+
else
|
295
|
+
# test for 'end' so we can auto_dedent
|
296
|
+
if (get_frame == "en") and indented?
|
297
|
+
auto_dedent
|
298
|
+
end
|
299
|
+
super
|
300
|
+
end
|
301
|
+
|
302
|
+
else
|
303
|
+
super
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
def auto_dedent
|
308
|
+
str = get_frame
|
309
|
+
clear_frame
|
310
|
+
@anchor -= 2
|
311
|
+
appendText(str)
|
312
|
+
setCursorPos(getLength)
|
313
|
+
end
|
314
|
+
|
315
|
+
def history(dir)
|
316
|
+
str = (dir == :prev) ? @im.prev_cmd.chomp : @im.next_cmd.chomp
|
317
|
+
if str != ""
|
318
|
+
clear_frame
|
319
|
+
write(str)
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
def quit_irb
|
324
|
+
clear_frame
|
325
|
+
appendText("exit")
|
326
|
+
new_line_entered
|
327
|
+
end
|
328
|
+
|
329
|
+
def get_frame
|
330
|
+
extractText(@anchor, getLength-@anchor)
|
331
|
+
end
|
332
|
+
|
333
|
+
def invalid_pos?
|
334
|
+
getCursorPos < @anchor
|
335
|
+
end
|
336
|
+
|
337
|
+
def can_move_left?
|
338
|
+
getCursorPos > @anchor
|
339
|
+
end
|
340
|
+
|
341
|
+
def move_to_start_of_frame
|
342
|
+
setCursorPos(@anchor)
|
343
|
+
end
|
344
|
+
|
345
|
+
def move_to_end_of_frame
|
346
|
+
setCursorPos(getLength)
|
347
|
+
end
|
348
|
+
|
349
|
+
def move_to_start_of_line
|
350
|
+
if multiline
|
351
|
+
cur = getCursorPos
|
352
|
+
pos = lineStart(cur)
|
353
|
+
pos = @anchor if pos < @anchor
|
354
|
+
else
|
355
|
+
pos = @anchor
|
356
|
+
end
|
357
|
+
setCursorPos(pos)
|
358
|
+
end
|
359
|
+
|
360
|
+
def move_to_end_of_line
|
361
|
+
if multiline
|
362
|
+
cur = getCursorPos
|
363
|
+
pos = lineEnd(cur)
|
364
|
+
else
|
365
|
+
pos = getLength
|
366
|
+
end
|
367
|
+
setCursorPos(pos)
|
368
|
+
end
|
369
|
+
|
370
|
+
def get_from_start_of_line
|
371
|
+
extractText(@anchor, getCursorPos-@anchor)
|
372
|
+
end
|
373
|
+
|
374
|
+
def get_to_end_of_line
|
375
|
+
extractText(getCursorPos, getLength - getCursorPos)
|
376
|
+
end
|
377
|
+
|
378
|
+
def clear_frame
|
379
|
+
removeText(@anchor, getLength-@anchor)
|
380
|
+
end
|
381
|
+
|
382
|
+
def delete_from_start_of_line
|
383
|
+
str = get_to_end_of_line
|
384
|
+
clear_frame
|
385
|
+
appendText(str)
|
386
|
+
setCursorPos(@anchor)
|
387
|
+
end
|
388
|
+
|
389
|
+
def delete_to_end_of_line
|
390
|
+
str = get_from_start_of_line
|
391
|
+
clear_frame
|
392
|
+
appendText(str)
|
393
|
+
setCursorPos(getLength)
|
394
|
+
end
|
395
|
+
|
396
|
+
def empty_frame?
|
397
|
+
get_frame == ""
|
398
|
+
end
|
399
|
+
|
400
|
+
def indented?
|
401
|
+
extractText(@anchor-2, 2) == " "
|
402
|
+
end
|
403
|
+
|
404
|
+
def new_line_entered
|
405
|
+
process_commandline(extractText(@anchor, getLength-@anchor))
|
406
|
+
end
|
407
|
+
|
408
|
+
def process_commandline(cmd)
|
409
|
+
multiline = false
|
410
|
+
lines = cmd.split(/\n/)
|
411
|
+
lines.each {|i|
|
412
|
+
@input[1].puts i
|
413
|
+
@inputAdded += 1
|
414
|
+
}
|
415
|
+
|
416
|
+
while (@inputAdded > 0) do
|
417
|
+
@irb.run
|
418
|
+
end
|
419
|
+
end
|
420
|
+
|
421
|
+
public
|
422
|
+
|
423
|
+
def send_command(cmd)
|
424
|
+
setCursorPos(getLength)
|
425
|
+
makePositionVisible(getLength) unless isPosVisible(getLength)
|
426
|
+
cmd += "\n"
|
427
|
+
appendText(cmd)
|
428
|
+
process_commandline(cmd)
|
429
|
+
end
|
430
|
+
|
431
|
+
def write(obj)
|
432
|
+
str = obj.to_s
|
433
|
+
appendText(str)
|
434
|
+
setCursorPos(getLength)
|
435
|
+
makePositionVisible(getLength) unless isPosVisible(getLength)
|
436
|
+
return str.length
|
437
|
+
end
|
438
|
+
|
439
|
+
def get_line
|
440
|
+
@anchor = getLength
|
441
|
+
if @inputAdded == 0
|
442
|
+
Thread.stop
|
443
|
+
end
|
444
|
+
@inputAdded -= 1
|
445
|
+
retval = @input[0].gets
|
446
|
+
# don't print every prompt for multiline input
|
447
|
+
@im.print_prompt = (@inputAdded == 0)
|
448
|
+
return retval
|
449
|
+
end
|
387
450
|
end
|
388
451
|
|
389
452
|
# Stand alone run
|
390
453
|
if __FILE__ == $0
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
454
|
+
application = FXApp.new("FXIrb", "ruby")
|
455
|
+
application.threadsEnabled = true
|
456
|
+
Thread.abort_on_exception = true
|
457
|
+
window = FXMainWindow.new(application, "FXIrb",
|
458
|
+
nil, nil, DECOR_ALL, 0, 0, 580, 500)
|
459
|
+
fxirb = FXIrb.init(window, nil, 0,
|
460
|
+
LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP|TEXT_SHOWACTIVE)
|
461
|
+
application.create
|
462
|
+
window.show(PLACEMENT_SCREEN)
|
463
|
+
fxirb.on_exit {exit}
|
464
|
+
application.run
|
401
465
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: fxri
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date: 2006-12-
|
6
|
+
version: 0.3.6
|
7
|
+
date: 2006-12-18 00:00:00 +01:00
|
8
8
|
summary: Graphical interface to the RI documentation, with search engine.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- lib
|
33
33
|
- fxri
|
34
34
|
- fxri.gemspec
|
35
|
+
- fxri-0.3.6.tar.gz
|
35
36
|
- fxri.rb
|
36
37
|
- lib/FoxDisplayer.rb
|
37
38
|
- lib/icons
|