Sha256: 23498dbf0247d254c911938b571414459bd92b4d79e3c6de3d800dbf503bff19

Contents?: true

Size: 966 Bytes

Versions: 2

Compression:

Stored size: 966 Bytes

Contents

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 && @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 }
    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
      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

2 entries across 2 versions & 1 rubygems

Version Path
yard-0.6.8 lib/yard/rubygems/specification.rb
yard-0.6.7 lib/yard/rubygems/specification.rb