Class: Phare::CLI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, argv) ⇒ CLI

Returns a new instance of CLI.



6
7
8
9
10
11
# File 'lib/phare/cli.rb', line 6

def initialize(env, argv)
  @env = env
  @options = parsed_options(argv)

  @suite = Phare::CheckSuite.new(@options)
end

Instance Attribute Details

#suiteObject (readonly)

Returns the value of attribute suite.



4
5
6
# File 'lib/phare/cli.rb', line 4

def suite
  @suite
end

Instance Method Details

#runObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/phare/cli.rb', line 13

def run
  if @options[:version]
    Phare.puts Phare::VERSION
    exit 0
  elsif @env['SKIP_CODE_CHECK'] || @env['SKIP_PHARE']
    Phare.banner 'Skipping code style checking… Really? Well alright then…'
    exit 0
  else
    exit run_suite
  end
end