Skip to content

Commit

Permalink
Merge pull request #1124 from MSP-Greg/trunk_fixes
Browse files Browse the repository at this point in the history
Fixes for trunk as of svn 60140 2017-10-08
  • Loading branch information
lsegal committed Oct 16, 2017
2 parents c546a8a + 2142516 commit f180935
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
9 changes: 8 additions & 1 deletion lib/yard/parser/ruby/ast_node.rb
Expand Up @@ -412,7 +412,14 @@ def unnamed_end_params

def double_splat_param
return nil unless YARD.ruby2?
self[-2] if self[-2].is_a?(AstNode) && self[-2].type == :ident
if (node = self[-2]).is_a?(AstNode)
if node.type == :ident
node
elsif node.type == :kwrest_param
# See https://bugs.ruby-lang.org/issues/12387
node.last
end
end
end

def block_param
Expand Down
14 changes: 11 additions & 3 deletions lib/yard/rubygems/specification.rb
Expand Up @@ -35,8 +35,16 @@ def _dump_with_rdoc(limit)
alias _dump_without_rdoc _dump
alias _dump _dump_with_rdoc

@@default_value[:has_rdoc] = true if defined?(@@default_value)
@@attributes << 'has_rdoc' if defined?(@@attributes)
@@nil_attributes << 'has_rdoc' if defined?(@@nil_attributes)
if class_variable_defined?(:@@default_value)
if @@default_value.frozen?
t = @@default_value.dup
t[:has_rdoc] = true
@@default_value = t.freeze
else
@@default_value[:has_rdoc] = true
end
end
@@attributes << 'has_rdoc' if class_variable_defined?(:@@attributes)
@@nil_attributes << 'has_rdoc' if class_variable_defined?(:@@nil_attributes)
end
end

0 comments on commit f180935

Please sign in to comment.