summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/helper_method/base.rb4
-rw-r--r--lib/irb/workspace.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/irb/helper_method/base.rb b/lib/irb/helper_method/base.rb
index dc74b046da..a68001ed28 100644
--- a/lib/irb/helper_method/base.rb
+++ b/lib/irb/helper_method/base.rb
@@ -1,6 +1,10 @@
+require "singleton"
+
module IRB
module HelperMethod
class Base
+ include Singleton
+
class << self
def description(description = nil)
@description = description if description
diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb
index dd92d99014..d24d1cc38d 100644
--- a/lib/irb/workspace.rb
+++ b/lib/irb/workspace.rb
@@ -179,7 +179,7 @@ EOF
def self.install_helper_methods
HelperMethod.helper_methods.each do |name, helper_method_class|
define_method name do |*args, **opts, &block|
- helper_method_class.new.execute(*args, **opts, &block)
+ helper_method_class.instance.execute(*args, **opts, &block)
end unless method_defined?(name)
end
end