Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress warnings #18

Merged
merged 1 commit into from
Jun 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/irb/ext/history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ class Context
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

@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.
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/ext/save-history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def save_history
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.
#
Expand Down
3 changes: 3 additions & 0 deletions lib/irb/ext/use-loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ class Object

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)
Expand All @@ -44,6 +46,7 @@ def use_loader

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.
Expand Down