Sha256: 465d06fe5392af29cc7587dcb94cd9758a23cb1a16aa992130243d99d7b2812b

Contents?: true

Size: 699 Bytes

Versions: 11

Compression:

Stored size: 699 Bytes

Contents

require 'find'

def list_files(dir, pattern)
  arr = []
  Find.find(dir) do |filename|
    if filename =~ pattern then
      arr.push(filename)
    end
  end
  return arr
end

def generate_rdoc(*options)
  begin
    require 'rdoc/rdoc'
  rescue LoadError
    puts "WARNING: RDoc not installed; skipping generation of docs"
    return
  end

  r = RDoc::RDoc.new
  rdoc_files = []
  rdoc_files.concat [ 'README' ]
  rdoc_files.concat list_files('lib', /\.rb$/) if File.exist?('lib')
  rdoc_files.concat list_files('ext', /\.c$/)  if File.exist?('ext')
  rdoc_files.reject! { |file| file =~ %r{^ext/cached/} }
  r.document(options + rdoc_files)
end

if __FILE__ == $0 then
  generate_rdoc(*ARGV)
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruby-internal-0.8.5 generate_rdoc.rb
ruby-internal-0.8.4 generate_rdoc.rb
ruby-internal-0.8.3 generate_rdoc.rb
ruby-internal-0.8.2 generate_rdoc.rb
ruby-internal-0.8.1 generate_rdoc.rb
ruby-internal-0.8.0 generate_rdoc.rb
ruby-internal-0.7.3 generate_rdoc.rb
ruby-internal-0.7.2 generate_rdoc.rb
ruby-internal-0.7.1 generate_rdoc.rb
ruby-internal-0.7.0 generate_rdoc.rb
ruby-internal-0.6.0 generate_rdoc.rb