Class: Climate::Help::Man::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/climate/help/man.rb

Overview

Eat my own dog food

Instance Method Summary collapse

Instance Method Details

#runObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/climate/help/man.rb', line 26

def run
  out_file = (of = options[:out_file]) && File.open(of, 'w') || $stdout

  command_class = arguments[:command_class].split('::').
    inject(Object) {|m,v| m.const_get(v) }

  template_file = options[:template] || File.join(
    File.dirname(__FILE__), 'man.erb')

  Man.new(command_class, :output => out_file,
    :template_file => template_file).print
end