123456789_123456789_123456789_123456789_123456789_

Class: RDoc::RubygemsHook

Relationships & Source Files
Inherits: Object
Defined in: lib/rdoc/rubygems_hook.rb

Class Attribute Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(spec, generate_rdoc = false, generate_ri = true) ⇒ RubygemsHook

[ GitHub ]

  
# File 'lib/rdoc/rubygems_hook.rb', line 280

def initialize(spec, generate_rdoc = false, generate_ri = true)
  @spec = spec
  @generate_rdoc = generate_rdoc
  @generate_ri   = generate_ri
  @force = false
end

Class Attribute Details

.default_gem?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rdoc/rubygems_hook.rb', line 276

def self.default_gem?
  !File.exist?(File.join(__dir__, "..", "rubygems_plugin.rb"))
end

Class Method Details

.generation_hook(installer, specs)

[ GitHub ]

  
# File 'lib/rdoc/rubygems_hook.rb', line 306

def self.generation_hook installer, specs
  # Do nothing if this is NOT a default gem.
  return unless default_gem?

  # Generate document for compatibility if this is a default gem.
  RubyGemsHook.generate(installer, specs)
end

Instance Attribute Details

#force (rw)

[ GitHub ]

  
# File 'lib/rdoc/rubygems_hook.rb', line 274

attr_accessor :generate_rdoc, :generate_ri, :force

#generate_rdoc (rw)

[ GitHub ]

  
# File 'lib/rdoc/rubygems_hook.rb', line 274

attr_accessor :generate_rdoc, :generate_ri, :force

#generate_ri (rw)

[ GitHub ]

  
# File 'lib/rdoc/rubygems_hook.rb', line 274

attr_accessor :generate_rdoc, :generate_ri, :force

Instance Method Details

#generate

[ GitHub ]

  
# File 'lib/rdoc/rubygems_hook.rb', line 287

def generate
  # Do nothing if this is NOT a default gem.
  return unless self.class.default_gem?

  # Generate document for compatibility if this is a default gem.
  hook = RubyGemsHook.new(@spec, @generate_rdoc, @generate_ri)
  hook.force = @force
  hook.generate
end

#remove

[ GitHub ]

  
# File 'lib/rdoc/rubygems_hook.rb', line 297

def remove
  # Do nothing if this is NOT a default gem.
  return unless self.class.default_gem?

  # Remove generated document for compatibility if this is a
  # default gem.
  RubyGemsHook.new(@spec).remove
end