Sha256: cf6f137a1014144f633271fb824222b8d95c1f92ee50707942f50f0b60619b03

Contents?: true

Size: 760 Bytes

Versions: 1

Compression:

Stored size: 760 Bytes

Contents

#!/usr/bin/env ruby

require "erb"

if ARGV.size != 1
  $stderr.puts "No path given to search for plugin docs"
  $stderr.puts "Usage: #{$0} plugin_doc_dir"
  exit 1
end

def plugins(glob)
  files = Dir.glob(glob)
  names = files.collect { |f| File.basename(f).gsub(".html", "") }
  return names.sort
end # def plugins

basedir = ARGV[0]
docs = {
  "inputs" => plugins(File.join(basedir, "inputs/*.html")),
  "codecs" => plugins(File.join(basedir, "codecs/*.html")),
  "filters" => plugins(File.join(basedir, "filters/*.html")),
  "outputs" => plugins(File.join(basedir, "outputs/*.html")),
}

template_path = File.join(File.dirname(__FILE__), "index.html.erb")
template = File.new(template_path).read
erb = ERB.new(template, nil, "-")
puts erb.result(binding)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logstash-lib-1.3.2 docs/generate_index.rb