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.
280 281 282 283 284 285 |
# 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 |
Instance Attribute Details
#force ⇒ Object
Returns the value of attribute force.
274 275 276 |
# File 'lib/rdoc/rubygems_hook.rb', line 274 def force @force end |
#generate_rdoc ⇒ Object
Returns the value of attribute generate_rdoc.
274 275 276 |
# File 'lib/rdoc/rubygems_hook.rb', line 274 def generate_rdoc @generate_rdoc end |
#generate_ri ⇒ Object
Returns the value of attribute generate_ri.
274 275 276 |
# File 'lib/rdoc/rubygems_hook.rb', line 274 def generate_ri @generate_ri end |
Class Method Details
.default_gem? ⇒ Boolean
276 277 278 |
# File 'lib/rdoc/rubygems_hook.rb', line 276 def self.default_gem? !File.exist?(File.join(__dir__, "..", "rubygems_plugin.rb")) end |
.generation_hook(installer, specs) ⇒ Object
306 307 308 309 310 311 312 |
# 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 |
.load_rdoc ⇒ Object
314 315 316 |
# File 'lib/rdoc/rubygems_hook.rb', line 314 def self.load_rdoc RubyGemsHook.load_rdoc end |
.rdoc_version ⇒ Object
318 319 320 |
# File 'lib/rdoc/rubygems_hook.rb', line 318 def self.rdoc_version RubyGemsHook.rdoc_version end |
Instance Method Details
#generate ⇒ Object
287 288 289 290 291 292 293 294 295 |
# 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 |
#rdoc_installed? ⇒ Boolean
322 323 324 |
# File 'lib/rdoc/rubygems_hook.rb', line 322 def rdoc_installed? RubyGemsHook.new(@spec).rdoc_installed? end |
#remove ⇒ Object
297 298 299 300 301 302 303 304 |
# 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 |
#ri_installed? ⇒ Boolean
326 327 328 |
# File 'lib/rdoc/rubygems_hook.rb', line 326 def ri_installed? RubyGemsHook.new(@spec).ri_installed? end |