module Vocco

Constants

DEFAULTS
OPTIONS

These are the available options. They can be given on the command line, the linux way, or as a hash to Vocco.run(...), the Rubygem way. The format is:

[name, description,

        default_value
]
OPTION_NAMES

Public Class Methods

gemspec(prop) click to toggle source

Tries to read a property from the gemspec with the same name as the working dir, in the working dir.

# File lib/vocco.rb, line 38
def gemspec(prop)
  begin
    require 'rubygems'
    @gemspec ||= Gem::Specification.load(
      Dir['**/*.gemspec'].first
      )
    @gemspec.send prop
  rescue
    nil
  end
end
run(opts) click to toggle source

Vocco::run is the interface for using Vocco as a gem.

# File lib/vocco.rb, line 18
def run(opts)
  validate(opts)
  Generator.new(
    DEFAULTS.merge(opts)
    ).run
end
Also aliased as: run!, start
run!(opts)
Alias for: run
start(opts)
Alias for: run
validate(opts) click to toggle source
# File lib/vocco.rb, line 28
def validate(opts)
  bad_opts = opts.keys - OPTION_NAMES

  if bad_opts.any?
    raise "Invalid options: #{bad_opts}"
  end
end