Skip to content

Commit

Permalink
fix: Updated check logic for token_stream existence
Browse files Browse the repository at this point in the history
Due to the change in ruby/rdoc#1055,
`token_stream` returns empty Array instead of `nil`,
so update check logic for `token_stream` existence.
  • Loading branch information
toshimaru committed Nov 17, 2023
1 parent e26cca7 commit 7869682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sdoc/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def method_signature(rdoc_method)
end

def method_source_code_and_url(rdoc_method)
source_code = rdoc_method.markup_code if rdoc_method.token_stream
source_code = rdoc_method.markup_code if rdoc_method.token_stream&.any?

if source_code&.match(/File\s(\S+), line (\d+)/)
source_url = github_url($1, line: $2)
Expand Down

0 comments on commit 7869682

Please sign in to comment.