class Publicity::Exec
Kicks off the parsing process by parsing command-line arguments and calling the method that parses each input file.
Public Class Methods
new(args)
click to toggle source
@param args [Array<String>] All command-line arguments
# File lib/publicity.rb, line 11 def initialize(args) @args = args @options = {} end
Public Instance Methods
parse()
click to toggle source
Parses the command-line arguments and begins parsing the files.
@see parse!
# File lib/publicity.rb, line 27 def parse @opts = OptionParser.new(&method(:set_opts)) @opts.parse!(@args) process_result end
parse!()
click to toggle source
Parses the command-line arguments and begins parsing the files.
@see parse
# File lib/publicity.rb, line 19 def parse! parse exit 0 end
process_result()
click to toggle source
Kickstarts the script prompt
# File lib/publicity.rb, line 59 def process_result Publicity::Main.new end
set_opts(opts)
click to toggle source
Takes the command-line arguments and parses them for optparse.
@param opts [OptionParser]
# File lib/publicity.rb, line 37 def set_opts(opts) opts.banner = <<EOS publicity v#{Publicity::VERSION} Description: TODO Usage (from within a .git repository): publicity [options] Options: EOS opts.on_tail( '-h', '--help', 'Display this screen' ) do puts opts exit end end