class ActiveFacts::Generators::HELP

Generate nothing from an ActiveFacts vocabulary. This is useful to check the file can be read ok. Invoke as

afgen --null <file>.cql

Public Class Methods

new(vocabulary, *options) click to toggle source
# File lib/activefacts/generators/help.rb, line 16
      def initialize(vocabulary, *options)
        generators = $:.
          map{|path|
            Dir[path+"/activefacts/generators/**/*.rb"].
              reject{|p|
                p =~ %r{/(transform|helpers)/}
              }.
              map{|p|
                p.sub(%r{.*/activefacts/generators/}, '').sub(/\.rb/,'')
              }
          }
        transformers = $:.
          map{|path|
            Dir[path+"/activefacts/generators/transform/**/*.rb"].
              map{|p|
                p.sub(%r{.*/activefacts/generators/}, '').sub(/\.rb/,'')
              }
          }

        puts %Q{
Usage: afgen [ --transformer[=options] ... ] [ --generator[=options] ... ] file.inp[=options]
        options are comma-separated lists. Use =help to get more information.

Available generators are:
        #{generators.flatten.uniq.sort.join("\n\t")
}

Available transformers are:
        #{transformers.flatten.uniq.sort.join("\n\t")
}

inp is the name of a file input handler. Available input handlers are:
        #{$:.map{|path|
            Dir[path+"/activefacts/input/**.rb"].map{|p|
                p.sub(%r{.*/}, '').sub(/\.rb/,'')
            }
        }.flatten.uniq.sort.join("\n\t")
}
}
      end

Public Instance Methods

generate(out = $>) click to toggle source
# File lib/activefacts/generators/help.rb, line 58
def generate(out = $>)
end