Class: RDoc::RubygemsHook
- Inherits:
-
Object
- Object
- RDoc::RubygemsHook
- Defined in:
- lib/rdoc/rubygems_hook.rb
Instance Attribute Summary collapse
-
#force ⇒ Object
Returns the value of attribute force.
-
#generate_rdoc ⇒ Object
Returns the value of attribute generate_rdoc.
-
#generate_ri ⇒ Object
Returns the value of attribute generate_ri.
Class Method Summary collapse
- .default_gem? ⇒ Boolean
- .generation_hook(installer, specs) ⇒ Object
- .load_rdoc ⇒ Object
- .rdoc_version ⇒ Object
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(spec, generate_rdoc = false, generate_ri = true) ⇒ RubygemsHook
constructor
A new instance of RubygemsHook.
- #rdoc_installed? ⇒ Boolean
- #remove ⇒ Object
- #ri_installed? ⇒ Boolean
Constructor Details
#initialize(spec, generate_rdoc = false, generate_ri = true) ⇒ RubygemsHook
Returns a new instance of RubygemsHook.
277 278 279 280 281 282 |
# File 'lib/rdoc/rubygems_hook.rb', line 277 def initialize(spec, generate_rdoc = false, generate_ri = true) @spec = spec @generate_rdoc = generate_rdoc @generate_ri = generate_ri @force = false end |
Instance Attribute Details
#force ⇒ Object
Returns the value of attribute force.
271 272 273 |
# File 'lib/rdoc/rubygems_hook.rb', line 271 def force @force end |
#generate_rdoc ⇒ Object
Returns the value of attribute generate_rdoc.
271 272 273 |
# File 'lib/rdoc/rubygems_hook.rb', line 271 def generate_rdoc @generate_rdoc end |
#generate_ri ⇒ Object
Returns the value of attribute generate_ri.
271 272 273 |
# File 'lib/rdoc/rubygems_hook.rb', line 271 def generate_ri @generate_ri end |
Class Method Details
.default_gem? ⇒ Boolean
273 274 275 |
# File 'lib/rdoc/rubygems_hook.rb', line 273 def self.default_gem? !File.exist?(File.join(__dir__, "..", "rubygems_plugin.rb")) end |
.generation_hook(installer, specs) ⇒ Object
303 304 305 306 307 308 309 |
# File 'lib/rdoc/rubygems_hook.rb', line 303 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 |
.load_rdoc ⇒ Object
311 312 313 |
# File 'lib/rdoc/rubygems_hook.rb', line 311 def self.load_rdoc RubyGemsHook.load_rdoc end |
.rdoc_version ⇒ Object
315 316 317 |
# File 'lib/rdoc/rubygems_hook.rb', line 315 def self.rdoc_version RubyGemsHook.rdoc_version end |
Instance Method Details
#generate ⇒ Object
284 285 286 287 288 289 290 291 292 |
# File 'lib/rdoc/rubygems_hook.rb', line 284 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 |
#rdoc_installed? ⇒ Boolean
319 320 321 |
# File 'lib/rdoc/rubygems_hook.rb', line 319 def rdoc_installed? RubyGemsHook.new(@spec).rdoc_installed? end |
#remove ⇒ Object
294 295 296 297 298 299 300 301 |
# File 'lib/rdoc/rubygems_hook.rb', line 294 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 |
#ri_installed? ⇒ Boolean
323 324 325 |
# File 'lib/rdoc/rubygems_hook.rb', line 323 def ri_installed? RubyGemsHook.new(@spec).ri_installed? end |