From 44466b8bdac92a523d806b79e7a0469530003ef0 Mon Sep 17 00:00:00 2001 From: Ryan Fitzgerald Date: Sun, 1 Jul 2012 23:10:10 -0700 Subject: [PATCH] Fix warnings --- lib/pry.rb | 3 --- lib/pry/core_extensions.rb | 4 ++-- lib/pry/default_commands/introspection.rb | 2 +- lib/pry/module_candidate.rb | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/pry.rb b/lib/pry.rb index cc272977..f846b8a9 100644 --- a/lib/pry.rb +++ b/lib/pry.rb @@ -10,9 +10,6 @@ class Pry # The default hooks - display messages when beginning and ending Pry sessions. DEFAULT_HOOKS = Pry::Hooks.new.add_hook(:before_session, :default) do |out, target, _pry_| next if _pry_.quiet? - # ensure we're actually in a method - file = target.eval('__FILE__') - _pry_.run_command("whereami --quiet", "", target) end diff --git a/lib/pry/core_extensions.rb b/lib/pry/core_extensions.rb index 69a947ae..7edd2187 100644 --- a/lib/pry/core_extensions.rb +++ b/lib/pry/core_extensions.rb @@ -73,14 +73,14 @@ class Object # it has the nice property that we can memoize this check. begin # instance_eval sets the default definee to the object's singleton class - instance_eval *binding_impl_method + instance_eval(*binding_impl_method) # If we can't define methods on the Object's singleton_class. Then we fall # back to setting the default definee to be the Object's class. That seems # nicer than having a REPL in which you can't define methods. rescue TypeError # class_eval sets the default definee to self.class - self.class.class_eval *binding_impl_method + self.class.class_eval(*binding_impl_method) end end diff --git a/lib/pry/default_commands/introspection.rb b/lib/pry/default_commands/introspection.rb index f0971203..d3ca02f7 100644 --- a/lib/pry/default_commands/introspection.rb +++ b/lib/pry/default_commands/introspection.rb @@ -132,7 +132,7 @@ class Pry begin doc << "\nCandidate #{v+1}/#{module_object.number_of_candidates}: #{candidate.file} @ #{candidate.line}:\n\n" doc << candidate.doc - rescue Pry::RescuableException => ex + rescue Pry::RescuableException doc << "No documentation found.\n" next end diff --git a/lib/pry/module_candidate.rb b/lib/pry/module_candidate.rb index a9f3acc5..08461e65 100644 --- a/lib/pry/module_candidate.rb +++ b/lib/pry/module_candidate.rb @@ -22,7 +22,7 @@ class Pry :strip_leading_whitespace] def_delegators :@wrapper, *to_delegate - private *to_delegate + private(*to_delegate) # @raise [Pry::CommandError] If `rank` is out of bounds. # @param [Pry::WrappedModule] wrapper The associated