Skip to content
Browse files

re-add reload-method as an alias for reload-code

Turns out some people actually used reload-method, so we re-add it to avoid them getting angry
  • Loading branch information...
1 parent 4afb8d3 commit 2e40eb24c6dcfcaf8555264fb464fecbb816a566 @banister banister committed
View
1 lib/pry/commands/reload_code.rb
@@ -36,4 +36,5 @@ def check_for_reloadability(code_object)
end
Pry::Commands.add_command(Pry::Command::ReloadCode)
+ Pry::Commands.alias_command 'reload-method', 'reload-code'
end
View
10 lib/pry/commands/show_info.rb
@@ -23,9 +23,13 @@ def process
if show_all_modules?(code_object)
# show all monkey patches for a module
+
+ @all_modules = true
result = content_and_headers_for_all_module_candidates(code_object)
else
# show a specific code object
+
+ @all_modules = false
result = content_and_header_for_code_object(code_object)
end
@@ -34,7 +38,7 @@ def process
end
def content_and_header_for_code_object(code_object)
- header(code_object) << content_for(code_object)
+ header(code_object) + content_for(code_object)
end
def content_and_headers_for_all_module_candidates(mod)
@@ -120,6 +124,10 @@ def file_and_line_for(code_object)
end
end
+ def all_modules?
+ @all_modules
+ end
+
def complete(input)
if input =~ /([^ ]*)#([a-z0-9_]*)\z/
prefix, search = [$1, $2]
View
1 lib/pry/commands/show_source.rb
@@ -25,7 +25,6 @@ class Command::ShowSource < Command::ShowInfo
# The source for code_object prepared for display.
def content_for(code_object)
- raise CommandError, "Cannot locate source!" if !code_object.source
Code.new(code_object.source, start_line_for(code_object)).
with_line_numbers(use_line_numbers?).to_s
end
View
4 lib/pry/wrapped_module.rb
@@ -259,6 +259,10 @@ def super(times=1)
Pry::WrappedModule(sup) if sup
end
+ def first_module_candidate_with_source
+
+ end
+
private
# @return [Pry::WrappedModule::Candidate] The candidate of rank 0,

0 comments on commit 2e40eb2

Please sign in to comment.
Something went wrong with that request. Please try again.