Class: RDoc::RubygemsHook
- Inherits:
-
Object
- Object
- RDoc::RubygemsHook
- Defined in:
- lib/rdoc/rubygems_hook.rb
Overview
This class is referenced by RubyGems to create documents. All implementations are moved to the above RubyGemsHook.
This class does nothing when this RDoc is installed as a normal gem or a bundled gem.
This class does generate/remove documents for compatibility when this RDoc is installed as a default gem.
We can remove this when all maintained RubyGems remove
rubygems/rdoc.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.
279 280 281 282 283 284 |
# File 'lib/rdoc/rubygems_hook.rb', line 279 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.
273 274 275 |
# File 'lib/rdoc/rubygems_hook.rb', line 273 def force @force end |
#generate_rdoc ⇒ Object
Returns the value of attribute generate_rdoc.
273 274 275 |
# File 'lib/rdoc/rubygems_hook.rb', line 273 def generate_rdoc @generate_rdoc end |
#generate_ri ⇒ Object
Returns the value of attribute generate_ri.
273 274 275 |
# File 'lib/rdoc/rubygems_hook.rb', line 273 def generate_ri @generate_ri end |
Class Method Details
.default_gem? ⇒ Boolean
275 276 277 |
# File 'lib/rdoc/rubygems_hook.rb', line 275 def self.default_gem? !File.exist?(File.join(__dir__, "..", "rubygems_plugin.rb")) end |
.generation_hook(installer, specs) ⇒ Object
305 306 307 308 309 310 311 |
# File 'lib/rdoc/rubygems_hook.rb', line 305 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
313 314 315 |
# File 'lib/rdoc/rubygems_hook.rb', line 313 def self.load_rdoc RubyGemsHook.load_rdoc end |
.rdoc_version ⇒ Object
317 318 319 |
# File 'lib/rdoc/rubygems_hook.rb', line 317 def self.rdoc_version RubyGemsHook.rdoc_version end |
Instance Method Details
#generate ⇒ Object
286 287 288 289 290 291 292 293 294 |
# File 'lib/rdoc/rubygems_hook.rb', line 286 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
321 322 323 |
# File 'lib/rdoc/rubygems_hook.rb', line 321 def rdoc_installed? RubyGemsHook.new(@spec).rdoc_installed? end |
#remove ⇒ Object
296 297 298 299 300 301 302 303 |
# File 'lib/rdoc/rubygems_hook.rb', line 296 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
325 326 327 |
# File 'lib/rdoc/rubygems_hook.rb', line 325 def ri_installed? RubyGemsHook.new(@spec).ri_installed? end |