Skip to content

Commit

Permalink
Return aliases either way
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutov committed Mar 16, 2024
1 parent 45bb8ba commit 1e86780
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/robe/sash/doc_for.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def self.method_struct(method)
begin
info = Pry::Method.new(method)

aliases = info.aliases.map(&:to_sym)

if info.dynamically_defined?
doc = ""
source = "# This method was defined outside of a source file."
Expand All @@ -46,10 +48,10 @@ def self.method_struct(method)
end

OpenStruct.new(docstring: doc, source: source,
aliases: info.aliases.map(&:to_sym))
aliases: aliases)
rescue Pry::CommandError
message = $!.message =~ /pry-doc/ ? $!.message : ""
return OpenStruct.new(docstring: message)
return OpenStruct.new(docstring: message, aliases: aliases)
end
end
end
Expand Down

0 comments on commit 1e86780

Please sign in to comment.