irb 1.0.0 → 1.4.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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.document +4 -0
  3. data/Gemfile +10 -2
  4. data/LICENSE.txt +3 -3
  5. data/README.md +3 -3
  6. data/Rakefile +17 -1
  7. data/doc/irb/irb-tools.rd.ja +184 -0
  8. data/doc/irb/irb.rd.ja +427 -0
  9. data/irb.gemspec +18 -4
  10. data/lib/irb/cmd/fork.rb +2 -4
  11. data/lib/irb/cmd/help.rb +10 -5
  12. data/lib/irb/cmd/info.rb +32 -0
  13. data/lib/irb/cmd/ls.rb +101 -0
  14. data/lib/irb/cmd/measure.rb +43 -0
  15. data/lib/irb/cmd/nop.rb +10 -4
  16. data/lib/irb/cmd/pushws.rb +0 -1
  17. data/lib/irb/cmd/show_source.rb +93 -0
  18. data/lib/irb/cmd/whereami.rb +20 -0
  19. data/lib/irb/color.rb +246 -0
  20. data/lib/irb/color_printer.rb +47 -0
  21. data/lib/irb/completion.rb +254 -55
  22. data/lib/irb/context.rb +165 -72
  23. data/lib/irb/easter-egg.rb +138 -0
  24. data/lib/irb/ext/change-ws.rb +0 -1
  25. data/lib/irb/ext/history.rb +47 -11
  26. data/lib/irb/ext/loader.rb +46 -20
  27. data/lib/irb/ext/multi-irb.rb +7 -7
  28. data/lib/irb/ext/save-history.rb +36 -11
  29. data/lib/irb/ext/tracer.rb +14 -2
  30. data/lib/irb/ext/use-loader.rb +4 -3
  31. data/lib/irb/ext/workspaces.rb +0 -1
  32. data/lib/irb/extend-command.rb +113 -63
  33. data/lib/irb/frame.rb +12 -7
  34. data/lib/irb/help.rb +0 -1
  35. data/lib/irb/init.rb +146 -26
  36. data/lib/irb/input-method.rb +287 -9
  37. data/lib/irb/inspector.rb +15 -11
  38. data/lib/irb/lc/error.rb +55 -16
  39. data/lib/irb/lc/help-message +25 -13
  40. data/lib/irb/lc/ja/error.rb +55 -14
  41. data/lib/irb/lc/ja/help-message +11 -6
  42. data/lib/irb/locale.rb +13 -4
  43. data/lib/irb/notifier.rb +12 -8
  44. data/lib/irb/output-method.rb +6 -6
  45. data/lib/irb/ruby-lex.rb +673 -992
  46. data/lib/irb/ruby_logo.aa +37 -0
  47. data/lib/irb/version.rb +2 -2
  48. data/lib/irb/workspace.rb +65 -21
  49. data/lib/irb/xmp.rb +1 -1
  50. data/lib/irb.rb +276 -96
  51. data/man/irb.1 +229 -0
  52. metadata +25 -31
  53. data/.gitignore +0 -9
  54. data/.travis.yml +0 -6
  55. data/lib/irb/lc/.document +0 -4
  56. data/lib/irb/ruby-token.rb +0 -267
  57. data/lib/irb/slex.rb +0 -282
@@ -31,8 +31,31 @@ module IRB # :nodoc:
31
31
  load_file(path, priv)
32
32
  end
33
33
 
34
+ if File.respond_to?(:absolute_path?)
35
+ def absolute_path?(path)
36
+ File.absolute_path?(path)
37
+ end
38
+ else
39
+ separator =
40
+ if File::ALT_SEPARATOR
41
+ "[#{Regexp.quote(File::SEPARATOR + File::ALT_SEPARATOR)}]"
42
+ else
43
+ File::SEPARATOR
44
+ end
45
+ ABSOLUTE_PATH_PATTERN = # :nodoc:
46
+ case Dir.pwd
47
+ when /\A\w:/, /\A#{separator}{2}/
48
+ /\A(?:\w:|#{separator})#{separator}/
49
+ else
50
+ /\A#{separator}/
51
+ end
52
+ def absolute_path?(path)
53
+ ABSOLUTE_PATH_PATTERN =~ path
54
+ end
55
+ end
56
+
34
57
  def search_file_from_ruby_path(fn) # :nodoc:
35
- if /^#{Regexp.quote(File::Separator)}/ =~ fn
58
+ if absolute_path?(fn)
36
59
  return fn if File.exist?(fn)
37
60
  return nil
38
61
  end
@@ -50,16 +73,18 @@ module IRB # :nodoc:
50
73
  # See Irb#suspend_input_method for more information.
51
74
  def source_file(path)
52
75
  irb.suspend_name(path, File.basename(path)) do
53
- irb.suspend_input_method(FileInputMethod.new(path)) do
54
- |back_io|
55
- irb.signal_status(:IN_LOAD) do
56
- if back_io.kind_of?(FileInputMethod)
57
- irb.eval_input
58
- else
59
- begin
76
+ FileInputMethod.open(path) do |io|
77
+ irb.suspend_input_method(io) do
78
+ |back_io|
79
+ irb.signal_status(:IN_LOAD) do
80
+ if back_io.kind_of?(FileInputMethod)
60
81
  irb.eval_input
61
- rescue LoadAbort
62
- print "load abort!!\n"
82
+ else
83
+ begin
84
+ irb.eval_input
85
+ rescue LoadAbort
86
+ print "load abort!!\n"
87
+ end
63
88
  end
64
89
  end
65
90
  end
@@ -79,16 +104,18 @@ module IRB # :nodoc:
79
104
  ws = WorkSpace.new
80
105
  end
81
106
  irb.suspend_workspace(ws) do
82
- irb.suspend_input_method(FileInputMethod.new(path)) do
83
- |back_io|
84
- irb.signal_status(:IN_LOAD) do
85
- if back_io.kind_of?(FileInputMethod)
86
- irb.eval_input
87
- else
88
- begin
107
+ FileInputMethod.open(path) do |io|
108
+ irb.suspend_input_method(io) do
109
+ |back_io|
110
+ irb.signal_status(:IN_LOAD) do
111
+ if back_io.kind_of?(FileInputMethod)
89
112
  irb.eval_input
90
- rescue LoadAbort
91
- print "load abort!!\n"
113
+ else
114
+ begin
115
+ irb.eval_input
116
+ rescue LoadAbort
117
+ print "load abort!!\n"
118
+ end
92
119
  end
93
120
  end
94
121
  end
@@ -126,4 +153,3 @@ module IRB # :nodoc:
126
153
  end
127
154
  end
128
155
  end
129
-
@@ -9,7 +9,7 @@
9
9
  #
10
10
  #
11
11
  #
12
- IRB.fail CantShiftToMultiIrbMode unless defined?(Thread)
12
+ fail CantShiftToMultiIrbMode unless defined?(Thread)
13
13
 
14
14
  module IRB
15
15
  class JobManager
@@ -67,8 +67,8 @@ module IRB
67
67
  # exception is raised.
68
68
  def switch(key)
69
69
  th, irb = search(key)
70
- IRB.fail IrbAlreadyDead unless th.alive?
71
- IRB.fail IrbSwitchedToCurrentThread if th == Thread.current
70
+ fail IrbAlreadyDead unless th.alive?
71
+ fail IrbSwitchedToCurrentThread if th == Thread.current
72
72
  @current_job = irb
73
73
  th.run
74
74
  Thread.stop
@@ -84,7 +84,7 @@ module IRB
84
84
  def kill(*keys)
85
85
  for key in keys
86
86
  th, _ = search(key)
87
- IRB.fail IrbAlreadyDead unless th.alive?
87
+ fail IrbAlreadyDead unless th.alive?
88
88
  th.exit
89
89
  end
90
90
  end
@@ -114,7 +114,7 @@ module IRB
114
114
  else
115
115
  @jobs.find{|k, v| v.context.main.equal?(key)}
116
116
  end
117
- IRB.fail NoSuchJob, key if job.nil?
117
+ fail NoSuchJob, key if job.nil?
118
118
  job
119
119
  end
120
120
 
@@ -122,7 +122,7 @@ module IRB
122
122
  def delete(key)
123
123
  case key
124
124
  when Integer
125
- IRB.fail NoSuchJob, key unless @jobs[key]
125
+ fail NoSuchJob, key unless @jobs[key]
126
126
  @jobs[key] = nil
127
127
  else
128
128
  catch(:EXISTS) do
@@ -135,7 +135,7 @@ module IRB
135
135
  throw :EXISTS
136
136
  end
137
137
  end
138
- IRB.fail NoSuchJob, key
138
+ fail NoSuchJob, key
139
139
  end
140
140
  end
141
141
  until assoc = @jobs.pop; end unless @jobs.empty?
@@ -9,8 +9,6 @@
9
9
  #
10
10
  #
11
11
 
12
- require "readline"
13
-
14
12
  module IRB
15
13
  module HistorySavingAbility # :nodoc:
16
14
  end
@@ -27,7 +25,7 @@ module IRB
27
25
  IRB.conf[:SAVE_HISTORY]
28
26
  end
29
27
 
30
- remove_method :save_history= if respond_to?(:save_history=)
28
+ remove_method(:save_history=) if method_defined?(:save_history=)
31
29
  # Sets <code>IRB.conf[:SAVE_HISTORY]</code> to the given +val+ and calls
32
30
  # #init_save_history with this context.
33
31
  #
@@ -58,8 +56,6 @@ module IRB
58
56
  end
59
57
 
60
58
  module HistorySavingAbility # :nodoc:
61
- include Readline
62
-
63
59
  def HistorySavingAbility.extended(obj)
64
60
  IRB.conf[:AT_EXIT].push proc{obj.save_history}
65
61
  obj.load_history
@@ -67,19 +63,33 @@ module IRB
67
63
  end
68
64
 
69
65
  def load_history
66
+ return unless self.class.const_defined?(:HISTORY)
67
+ history = self.class::HISTORY
70
68
  if history_file = IRB.conf[:HISTORY_FILE]
71
69
  history_file = File.expand_path(history_file)
72
70
  end
73
71
  history_file = IRB.rc_file("_history") unless history_file
74
72
  if File.exist?(history_file)
75
- open(history_file) do |f|
76
- f.each {|l| HISTORY << l.chomp}
73
+ open(history_file, "r:#{IRB.conf[:LC_MESSAGES].encoding}") do |f|
74
+ f.each { |l|
75
+ l = l.chomp
76
+ if self.class == ReidlineInputMethod and history.last&.end_with?("\\")
77
+ history.last.delete_suffix!("\\")
78
+ history.last << "\n" << l
79
+ else
80
+ history << l
81
+ end
82
+ }
77
83
  end
84
+ @loaded_history_lines = history.size
85
+ @loaded_history_mtime = File.mtime(history_file)
78
86
  end
79
87
  end
80
88
 
81
89
  def save_history
82
- if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0
90
+ return unless self.class.const_defined?(:HISTORY)
91
+ history = self.class::HISTORY
92
+ if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) != 0
83
93
  if history_file = IRB.conf[:HISTORY_FILE]
84
94
  history_file = File.expand_path(history_file)
85
95
  end
@@ -91,13 +101,28 @@ module IRB
91
101
  File.chmod(0600, history_file)
92
102
  end
93
103
  rescue Errno::ENOENT
104
+ rescue Errno::EPERM
105
+ return
94
106
  rescue
95
107
  raise
96
108
  end
97
109
 
98
- open(history_file, 'w', 0600 ) do |f|
99
- hist = HISTORY.to_a
100
- f.puts(hist[-num..-1] || hist)
110
+ if File.exist?(history_file) && @loaded_history_mtime &&
111
+ File.mtime(history_file) != @loaded_history_mtime
112
+ history = history[@loaded_history_lines..-1]
113
+ append_history = true
114
+ end
115
+
116
+ open(history_file, "#{append_history ? 'a' : 'w'}:#{IRB.conf[:LC_MESSAGES].encoding}", 0600) do |f|
117
+ hist = history.map{ |l| l.split("\n").join("\\\n") }
118
+ unless append_history
119
+ begin
120
+ hist = hist.last(num) if hist.size > num and num > 0
121
+ rescue RangeError # bignum too big to convert into `long'
122
+ # Do nothing because the bignum should be treated as inifinity
123
+ end
124
+ end
125
+ f.puts(hist)
101
126
  end
102
127
  end
103
128
  end
@@ -9,7 +9,20 @@
9
9
  #
10
10
  #
11
11
  #
12
- require "tracer"
12
+ begin
13
+ require "tracer"
14
+ rescue LoadError
15
+ $stderr.puts "Tracer extension of IRB is enabled but tracer gem doesn't found."
16
+ module IRB
17
+ TracerLoadError = true
18
+ class Context
19
+ def use_tracer=(opt)
20
+ # do nothing
21
+ end
22
+ end
23
+ end
24
+ return # This is about to disable loading below
25
+ end
13
26
 
14
27
  module IRB
15
28
 
@@ -69,4 +82,3 @@ module IRB
69
82
 
70
83
  IRB.initialize_tracer
71
84
  end
72
-
@@ -20,10 +20,12 @@ end
20
20
 
21
21
  module IRB
22
22
  module ExtendCommandBundle
23
+ remove_method :irb_load if method_defined?(:irb_load)
23
24
  # Loads the given file similarly to Kernel#load, see IrbLoader#irb_load
24
25
  def irb_load(*opts, &b)
25
26
  ExtendCommand::Load.execute(irb_context, *opts, &b)
26
27
  end
28
+ remove_method :irb_require if method_defined?(:irb_require)
27
29
  # Loads the given file similarly to Kernel#require
28
30
  def irb_require(*opts, &b)
29
31
  ExtendCommand::Require.execute(irb_context, *opts, &b)
@@ -44,7 +46,8 @@ module IRB
44
46
 
45
47
  alias use_loader? use_loader
46
48
 
47
- # Sets IRB.conf[:USE_LOADER]
49
+ remove_method :use_loader= if method_defined?(:use_loader=)
50
+ # Sets <code>IRB.conf[:USE_LOADER]</code>
48
51
  #
49
52
  # See #use_loader for more information.
50
53
  def use_loader=(opt)
@@ -70,5 +73,3 @@ module IRB
70
73
  end
71
74
  end
72
75
  end
73
-
74
-
@@ -64,4 +64,3 @@ module IRB # :nodoc:
64
64
  end
65
65
  end
66
66
  end
67
-
@@ -32,7 +32,7 @@ module IRB # :nodoc:
32
32
 
33
33
  # Displays current configuration.
34
34
  #
35
- # Modifing the configuration is achieved by sending a message to IRB.conf.
35
+ # Modifying the configuration is achieved by sending a message to IRB.conf.
36
36
  def irb_context
37
37
  IRB.CurrentContext
38
38
  end
@@ -46,58 +46,104 @@ module IRB # :nodoc:
46
46
  ]
47
47
 
48
48
  @EXTEND_COMMANDS = [
49
- [:irb_current_working_workspace, :CurrentWorkingWorkspace, "irb/cmd/chws",
50
- [:irb_print_working_workspace, OVERRIDE_ALL],
51
- [:irb_cwws, OVERRIDE_ALL],
52
- [:irb_pwws, OVERRIDE_ALL],
53
- [:cwws, NO_OVERRIDE],
54
- [:pwws, NO_OVERRIDE],
55
- [:irb_current_working_binding, OVERRIDE_ALL],
56
- [:irb_print_working_binding, OVERRIDE_ALL],
57
- [:irb_cwb, OVERRIDE_ALL],
58
- [:irb_pwb, OVERRIDE_ALL],
59
- ],
60
- [:irb_change_workspace, :ChangeWorkspace, "irb/cmd/chws",
61
- [:irb_chws, OVERRIDE_ALL],
62
- [:irb_cws, OVERRIDE_ALL],
63
- [:chws, NO_OVERRIDE],
64
- [:cws, NO_OVERRIDE],
65
- [:irb_change_binding, OVERRIDE_ALL],
66
- [:irb_cb, OVERRIDE_ALL],
67
- [:cb, NO_OVERRIDE]],
68
-
69
- [:irb_workspaces, :Workspaces, "irb/cmd/pushws",
70
- [:workspaces, NO_OVERRIDE],
71
- [:irb_bindings, OVERRIDE_ALL],
72
- [:bindings, NO_OVERRIDE]],
73
- [:irb_push_workspace, :PushWorkspace, "irb/cmd/pushws",
74
- [:irb_pushws, OVERRIDE_ALL],
75
- [:pushws, NO_OVERRIDE],
76
- [:irb_push_binding, OVERRIDE_ALL],
77
- [:irb_pushb, OVERRIDE_ALL],
78
- [:pushb, NO_OVERRIDE]],
79
- [:irb_pop_workspace, :PopWorkspace, "irb/cmd/pushws",
80
- [:irb_popws, OVERRIDE_ALL],
81
- [:popws, NO_OVERRIDE],
82
- [:irb_pop_binding, OVERRIDE_ALL],
83
- [:irb_popb, OVERRIDE_ALL],
84
- [:popb, NO_OVERRIDE]],
85
-
86
- [:irb_load, :Load, "irb/cmd/load"],
87
- [:irb_require, :Require, "irb/cmd/load"],
88
- [:irb_source, :Source, "irb/cmd/load",
89
- [:source, NO_OVERRIDE]],
90
-
91
- [:irb, :IrbCommand, "irb/cmd/subirb"],
92
- [:irb_jobs, :Jobs, "irb/cmd/subirb",
93
- [:jobs, NO_OVERRIDE]],
94
- [:irb_fg, :Foreground, "irb/cmd/subirb",
95
- [:fg, NO_OVERRIDE]],
96
- [:irb_kill, :Kill, "irb/cmd/subirb",
97
- [:kill, OVERRIDE_PRIVATE_ONLY]],
98
-
99
- [:irb_help, :Help, "irb/cmd/help",
100
- [:help, NO_OVERRIDE]],
49
+ [
50
+ :irb_current_working_workspace, :CurrentWorkingWorkspace, "irb/cmd/chws",
51
+ [:irb_print_working_workspace, OVERRIDE_ALL],
52
+ [:irb_cwws, OVERRIDE_ALL],
53
+ [:irb_pwws, OVERRIDE_ALL],
54
+ [:cwws, NO_OVERRIDE],
55
+ [:pwws, NO_OVERRIDE],
56
+ [:irb_current_working_binding, OVERRIDE_ALL],
57
+ [:irb_print_working_binding, OVERRIDE_ALL],
58
+ [:irb_cwb, OVERRIDE_ALL],
59
+ [:irb_pwb, OVERRIDE_ALL],
60
+ ],
61
+ [
62
+ :irb_change_workspace, :ChangeWorkspace, "irb/cmd/chws",
63
+ [:irb_chws, OVERRIDE_ALL],
64
+ [:irb_cws, OVERRIDE_ALL],
65
+ [:chws, NO_OVERRIDE],
66
+ [:cws, NO_OVERRIDE],
67
+ [:irb_change_binding, OVERRIDE_ALL],
68
+ [:irb_cb, OVERRIDE_ALL],
69
+ [:cb, NO_OVERRIDE],
70
+ ],
71
+
72
+ [
73
+ :irb_workspaces, :Workspaces, "irb/cmd/pushws",
74
+ [:workspaces, NO_OVERRIDE],
75
+ [:irb_bindings, OVERRIDE_ALL],
76
+ [:bindings, NO_OVERRIDE],
77
+ ],
78
+ [
79
+ :irb_push_workspace, :PushWorkspace, "irb/cmd/pushws",
80
+ [:irb_pushws, OVERRIDE_ALL],
81
+ [:pushws, NO_OVERRIDE],
82
+ [:irb_push_binding, OVERRIDE_ALL],
83
+ [:irb_pushb, OVERRIDE_ALL],
84
+ [:pushb, NO_OVERRIDE],
85
+ ],
86
+ [
87
+ :irb_pop_workspace, :PopWorkspace, "irb/cmd/pushws",
88
+ [:irb_popws, OVERRIDE_ALL],
89
+ [:popws, NO_OVERRIDE],
90
+ [:irb_pop_binding, OVERRIDE_ALL],
91
+ [:irb_popb, OVERRIDE_ALL],
92
+ [:popb, NO_OVERRIDE],
93
+ ],
94
+
95
+ [
96
+ :irb_load, :Load, "irb/cmd/load"],
97
+ [
98
+ :irb_require, :Require, "irb/cmd/load"],
99
+ [
100
+ :irb_source, :Source, "irb/cmd/load",
101
+ [:source, NO_OVERRIDE],
102
+ ],
103
+
104
+ [
105
+ :irb, :IrbCommand, "irb/cmd/subirb"],
106
+ [
107
+ :irb_jobs, :Jobs, "irb/cmd/subirb",
108
+ [:jobs, NO_OVERRIDE],
109
+ ],
110
+ [
111
+ :irb_fg, :Foreground, "irb/cmd/subirb",
112
+ [:fg, NO_OVERRIDE],
113
+ ],
114
+ [
115
+ :irb_kill, :Kill, "irb/cmd/subirb",
116
+ [:kill, OVERRIDE_PRIVATE_ONLY],
117
+ ],
118
+
119
+ [
120
+ :irb_help, :Help, "irb/cmd/help",
121
+ [:help, NO_OVERRIDE],
122
+ ],
123
+
124
+ [
125
+ :irb_info, :Info, "irb/cmd/info"
126
+ ],
127
+
128
+ [
129
+ :irb_ls, :Ls, "irb/cmd/ls",
130
+ [:ls, NO_OVERRIDE],
131
+ ],
132
+
133
+ [
134
+ :irb_measure, :Measure, "irb/cmd/measure",
135
+ [:measure, NO_OVERRIDE],
136
+ ],
137
+
138
+ [
139
+ :irb_show_source, :ShowSource, "irb/cmd/show_source",
140
+ [:show_source, NO_OVERRIDE],
141
+ ],
142
+
143
+ [
144
+ :irb_whereami, :Whereami, "irb/cmd/whereami",
145
+ [:whereami, NO_OVERRIDE],
146
+ ],
101
147
 
102
148
  ]
103
149
 
@@ -138,20 +184,24 @@ module IRB # :nodoc:
138
184
  end
139
185
 
140
186
  if load_file
187
+ kwargs = ", **kwargs" if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.7.0"
141
188
  line = __LINE__; eval %[
142
- def #{cmd_name}(*opts, &b)
189
+ def #{cmd_name}(*opts#{kwargs}, &b)
143
190
  require "#{load_file}"
144
191
  arity = ExtendCommand::#{cmd_class}.instance_method(:execute).arity
145
192
  args = (1..(arity < 0 ? ~arity : arity)).map {|i| "arg" + i.to_s }
146
- args << "*opts" if arity < 0
193
+ args << "*opts#{kwargs}" if arity < 0
147
194
  args << "&block"
148
195
  args = args.join(", ")
149
196
  line = __LINE__; eval %[
150
- def #{cmd_name}(\#{args})
151
- ExtendCommand::#{cmd_class}.execute(irb_context, \#{args})
197
+ unless singleton_class.class_variable_defined?(:@@#{cmd_name}_)
198
+ singleton_class.class_variable_set(:@@#{cmd_name}_, true)
199
+ def self.#{cmd_name}_(\#{args})
200
+ ExtendCommand::#{cmd_class}.execute(irb_context, \#{args})
201
+ end
152
202
  end
153
203
  ], nil, __FILE__, line
154
- send :#{cmd_name}, *opts, &b
204
+ __send__ :#{cmd_name}_, *opts#{kwargs}, &b
155
205
  end
156
206
  ], nil, __FILE__, line
157
207
  else
@@ -239,7 +289,7 @@ module IRB # :nodoc:
239
289
  def #{cmd_name}(*opts, &b)
240
290
  Context.module_eval {remove_method(:#{cmd_name})}
241
291
  require "#{load_file}"
242
- send :#{cmd_name}, *opts, &b
292
+ __send__ :#{cmd_name}, *opts, &b
243
293
  end
244
294
  for ali in aliases
245
295
  alias_method ali, cmd_name
@@ -262,8 +312,8 @@ module IRB # :nodoc:
262
312
  module_eval %[
263
313
  alias_method alias_name, base_method
264
314
  def #{base_method}(*opts)
265
- send :#{extend_method}, *opts
266
- send :#{alias_name}, *opts
315
+ __send__ :#{extend_method}, *opts
316
+ __send__ :#{alias_name}, *opts
267
317
  end
268
318
  ]
269
319
  end
@@ -278,8 +328,8 @@ module IRB # :nodoc:
278
328
  module_eval %[
279
329
  alias_method alias_name, base_method
280
330
  def #{base_method}(*opts)
281
- send :#{alias_name}, *opts
282
- send :#{extend_method}, *opts
331
+ __send__ :#{alias_name}, *opts
332
+ __send__ :#{extend_method}, *opts
283
333
  end
284
334
  ]
285
335
  end
data/lib/irb/frame.rb CHANGED
@@ -10,13 +10,18 @@
10
10
  #
11
11
  #
12
12
 
13
- require "e2mmap"
14
-
15
13
  module IRB
16
14
  class Frame
17
- extend Exception2MessageMapper
18
- def_exception :FrameOverflow, "frame overflow"
19
- def_exception :FrameUnderflow, "frame underflow"
15
+ class FrameOverflow < StandardError
16
+ def initialize
17
+ super("frame overflow")
18
+ end
19
+ end
20
+ class FrameUnderflow < StandardError
21
+ def initialize
22
+ super("frame underflow")
23
+ end
24
+ end
20
25
 
21
26
  # Default number of stack frames
22
27
  INIT_STACK_TIMES = 3
@@ -44,7 +49,7 @@ module IRB
44
49
  # Raises FrameUnderflow if there are no frames in the given stack range.
45
50
  def top(n = 0)
46
51
  bind = @frames[-(n + CALL_STACK_OFFSET)]
47
- Fail FrameUnderflow unless bind
52
+ fail FrameUnderflow unless bind
48
53
  bind
49
54
  end
50
55
 
@@ -54,7 +59,7 @@ module IRB
54
59
  # Raises FrameOverflow if there are no frames in the given stack range.
55
60
  def bottom(n = 0)
56
61
  bind = @frames[n]
57
- Fail FrameOverflow unless bind
62
+ fail FrameOverflow unless bind
58
63
  bind
59
64
  end
60
65
 
data/lib/irb/help.rb CHANGED
@@ -34,4 +34,3 @@ module IRB
34
34
  }
35
35
  end
36
36
  end
37
-