Class: HamlLint::CLI

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

Overview

Command line application interface.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ CLI

Returns a new instance of CLI

Parameters:


11
12
13
# File 'lib/haml_lint/cli.rb', line 11

def initialize(logger)
  @log = logger
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options


8
9
10
# File 'lib/haml_lint/cli.rb', line 8

def options
  @options
end

Instance Method Details

#run(args) ⇒ Fixnum

Parses the given command-line arguments and executes appropriate logic based on those arguments.

Parameters:

  • args (Array<String>)

    command line arguments

Returns:

  • (Fixnum)

    exit status returned by the application


20
21
22
23
24
25
# File 'lib/haml_lint/cli.rb', line 20

def run(args)
  options = HamlLint::Options.new.parse(args)
  act_on_options(options)
rescue => ex
  handle_exception(ex)
end