Class: HerokuFormationValidator::Runner

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Runner

Returns a new instance of Runner.



5
6
7
8
# File 'lib/heroku_formation_validator/runner.rb', line 5

def initialize(*args)
  @args = args
  run
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



3
4
5
# File 'lib/heroku_formation_validator/runner.rb', line 3

def args
  @args
end

Class Method Details

.execute(*args) ⇒ Object



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

def self.execute(*args)
  new(*args).execute
end

Instance Method Details

#help_textObject



23
24
25
26
27
# File 'lib/heroku_formation_validator/runner.rb', line 23

def help_text
  <<-help
usage: heroku_formation_validator <config file name>
help
end

#runObject



14
15
16
17
18
19
20
21
# File 'lib/heroku_formation_validator/runner.rb', line 14

def run
  if filename = @args[0]
    exit HerokuFormationValidator.run(filename) ? 0 : 1
  else
    puts help_text
    exit 1
  end
end