Class: Giblish::DirTreeConvert

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

Overview

# does not return, exits with status code

def run_from_cmd_line
  begin
    run(ARGV)
    exit_code = 0
  rescue => exc
    Giblog.logger.error { exc.message }
    Giblog.logger.error { exc.backtrace }
    exit_code = 1
  end
  exit(exit_code)
end

end

Defined Under Namespace

Classes: AdocFileProvider

Instance Method Summary collapse

Constructor Details

#initialize(user_opts) ⇒ DirTreeConvert

Returns a new instance of DirTreeConvert.



76
77
78
79
80
81
82
# File 'lib/giblish/application.rb', line 76

def initialize(user_opts)
  @user_opts = user_opts.dup

  # get all adoc source files from disk
  o = @user_opts
  @src_tree = build_src_tree(o.srcdir, o.include_regex, o.exclude_regex)
end

Instance Method Details

#run(configurator = nil) ⇒ Object

returns on success, raises otherwise



85
86
87
88
89
90
91
92
93
# File 'lib/giblish/application.rb', line 85

def run(configurator = nil)
  return if @src_tree.nil?

  # assign/setup a configurator containing all api options and doc attributes
  build_config = configurator || Configurator.new(@user_opts)

  tc = setup_converter(@src_tree, AdocFileProvider.new, build_config)
  tc.run
end