summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMasataka Pocke Kuwabara <kuwabara@pocke.me>2019-06-13 16:09:02 +0900
committeraycabta <aycabta@gmail.com>2019-07-15 00:13:01 +0900
commit9806da50f49843c6983e3110a23ab7822c2e089d (patch)
tree4cbca881fd333342813d9a1215ab328356d8ee3c /lib
parent83171b0ee8dc8000819259bde764ea9ca3489290 (diff)
Suppress warnings
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/ext/history.rb3
-rw-r--r--lib/irb/ext/save-history.rb2
-rw-r--r--lib/irb/ext/use-loader.rb3
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/irb/ext/history.rb b/lib/irb/ext/history.rb
index 62363b13f4..43c3e4dbf3 100644
--- a/lib/irb/ext/history.rb
+++ b/lib/irb/ext/history.rb
@@ -22,7 +22,7 @@ module IRB # :nodoc:
def set_last_value(value)
_set_last_value(value)
- if @eval_history
+ if defined?(@eval_history) && @eval_history
@eval_history_values.push @line_no, @last_value
@workspace.evaluate self, "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
end
@@ -30,6 +30,7 @@ module IRB # :nodoc:
@last_value
end
+ remove_method :eval_history= if method_defined?(:eval_history=)
# The command result history limit.
attr_reader :eval_history
# Sets command result history limit.
diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb
index 8ee5d269e6..9aeb5dee0c 100644
--- a/lib/irb/ext/save-history.rb
+++ b/lib/irb/ext/save-history.rb
@@ -27,7 +27,7 @@ module IRB
IRB.conf[:SAVE_HISTORY]
end
- remove_method :save_history= if respond_to?(:save_history=)
+ remove_method :save_history= if method_defined?(:save_history=)
# Sets <code>IRB.conf[:SAVE_HISTORY]</code> to the given +val+ and calls
# #init_save_history with this context.
#
diff --git a/lib/irb/ext/use-loader.rb b/lib/irb/ext/use-loader.rb
index cc71706671..cb10e8a254 100644
--- a/lib/irb/ext/use-loader.rb
+++ b/lib/irb/ext/use-loader.rb
@@ -20,10 +20,12 @@ end
module IRB
module ExtendCommandBundle
+ remove_method :irb_load if method_defined?(:irb_load)
# Loads the given file similarly to Kernel#load, see IrbLoader#irb_load
def irb_load(*opts, &b)
ExtendCommand::Load.execute(irb_context, *opts, &b)
end
+ remove_method :irb_require if method_defined?(:irb_require)
# Loads the given file similarly to Kernel#require
def irb_require(*opts, &b)
ExtendCommand::Require.execute(irb_context, *opts, &b)
@@ -44,6 +46,7 @@ module IRB
alias use_loader? use_loader
+ remove_method :use_loader= if method_defined?(:use_loader=)
# Sets IRB.conf[:USE_LOADER]
#
# See #use_loader for more information.