Class: Guideline::Runner

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

Defined Under Namespace

Classes: Parser

Constant Summary collapse

CONFIG_FILE_NAME =
".guideline.yml"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Runner

Returns a new instance of Runner.



14
15
16
# File 'lib/guideline/runner.rb', line 14

def initialize(argv)
  @hash = Parser.parse(argv).with_indifferent_access
end

Class Method Details

.parse(*argv) ⇒ Object



10
11
12
# File 'lib/guideline/runner.rb', line 10

def self.parse(*argv)
  new(*argv).parse
end

Instance Method Details

#parseObject



18
19
20
21
22
23
# File 'lib/guideline/runner.rb', line 18

def parse
  before_hook
  @hash[:config] = load_config
  @hash.delete(:help)
  @hash
end