Class: Erlapi::Cmd

Inherits:
Object
  • Object
show all
Defined in:
lib/erlapi.rb

Class Method Summary collapse

Class Method Details

.start!(options) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/erlapi.rb', line 19

def start!(options)
  if !options[:source_dir] || !options[:output_dir]
    raise "You must define source and output dirs"
  end
  
  pa = Erlapi::Parser::Base.new(options[:source_dir])

  pa.parse

  ge = Erlapi::Generator.new(:data => pa.modules, :output_dir => options[:output_dir])

  options = OpenStruct.new( {:charset => 'utf-8', :title => 'Erlang API'})
  ge.generate(options)
  
  puts 'Generating completed'
end