Sha256: d212d062a8c59fe915dfc95b3a3f655b452093ac3d2b3e3e9ed751426acf79c5

Contents?: true

Size: 1.09 KB

Versions: 20

Compression:

Stored size: 1.09 KB

Contents

require 'rdoc/rdoc'
require 'gauntlet'
require 'fileutils'

##
# Allows for testing of RDoc against every gem

class RDoc::Gauntlet < Gauntlet

  ##
  # Runs an RDoc generator for gem +name+

  def run name
    return if self.data.key? name

    dir = File.expand_path "~/.gauntlet/data/rdoc/#{name}"
    FileUtils.rm_rf dir if File.exist? dir

    yaml = File.read 'gemspec'
    spec = Gem::Specification.from_yaml yaml

    args = %W[--ri --op #{dir}]
    args.push(*spec.rdoc_options)
    args << spec.require_paths
    args << spec.extra_rdoc_files
    args = args.flatten.map { |a| a.to_s }
    args.delete '--quiet'

    puts "#{name} - rdoc #{args.join ' '}"

    self.dirty = true
    r = RDoc::RDoc.new

    begin
      r.document args
      self.data[name] = true
      puts 'passed'
      FileUtils.rm_rf dir
    rescue Interrupt, StandardError, RDoc::Error, SystemStackError => e
      puts "failed - (#{e.class}) #{e.message}"
      self.data[name] = false
    end
  rescue Gem::Exception
    puts "bad gem #{name}"
  ensure
    puts
  end

end

RDoc::Gauntlet.new.run_the_gauntlet if $0 == __FILE__

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rdoc-3.9.5 lib/rdoc/gauntlet.rb
rdoc-3.9.4 lib/rdoc/gauntlet.rb
rdoc-3.9.3 lib/rdoc/gauntlet.rb
rdoc-3.9.2 lib/rdoc/gauntlet.rb
rdoc-3.9.1 lib/rdoc/gauntlet.rb
rdoc-3.9 lib/rdoc/gauntlet.rb
rdoc-3.8 lib/rdoc/gauntlet.rb
rdoc-3.7 lib/rdoc/gauntlet.rb
rdoc-3.6.1 lib/rdoc/gauntlet.rb
rdoc-3.6 lib/rdoc/gauntlet.rb
rdoc-3.5.3 lib/rdoc/gauntlet.rb
rdoc-3.5.2 lib/rdoc/gauntlet.rb
rdoc-3.5.1 lib/rdoc/gauntlet.rb
rdoc-3.5 lib/rdoc/gauntlet.rb
rdoc-3.4 lib/rdoc/gauntlet.rb
rdoc-3.3 lib/rdoc/gauntlet.rb
rdoc-3.2 lib/rdoc/gauntlet.rb
rdoc-3.1 lib/rdoc/gauntlet.rb
rdoc-3.0.1 lib/rdoc/gauntlet.rb
rdoc-3.0 lib/rdoc/gauntlet.rb