Sha256: 48068236c2ee724f044343141fe6cb84bce04a7ef89550efd08b26fd4723a36f

Contents?: true

Size: 1 KB

Versions: 8

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true
require 'rubygems/specification'

class Gem::Specification
  # @since 0.5.3
  def has_yardoc=(value)
    @has_rdoc = value ? 'yard' : false
  end

  def has_yardoc
    @has_rdoc == 'yard'
  end

  undef has_rdoc?
  def has_rdoc?
    (@has_rdoc ||= true) && @has_rdoc != 'yard'
  end

  alias has_yardoc? has_yardoc

  # has_rdoc should not be ignored!
  if respond_to?(:overwrite_accessor)
    overwrite_accessor(:has_rdoc) { @has_rdoc ||= true }
    overwrite_accessor(:has_rdoc=) {|v| @has_rdoc = v }
  else
    attr_accessor :has_rdoc
  end

  if defined?(Gem::VERSION) && Gem::VERSION >= '1.7.'
    def _dump_with_rdoc(limit)
      dmp = _dump_without_rdoc(limit)
      dmp[15] = @has_rdoc if dmp[15] == true
      dmp
    end
    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)
  end
end

Version data entries

8 entries across 7 versions & 4 rubygems

Version Path
yard-0.9.9 lib/yard/rubygems/specification.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.4.0/gems/yard-0.9.8/lib/yard/rubygems/specification.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.2.0/gems/yard-0.9.8/lib/yard/rubygems/specification.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/yard-0.9.8/lib/yard/rubygems/specification.rb
yard-0.9.8 lib/yard/rubygems/specification.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.7/lib/yard/rubygems/specification.rb
yard-0.9.7 lib/yard/rubygems/specification.rb
yard-0.9.6 lib/yard/rubygems/specification.rb