Class: Pipefitter::Cli

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments, options = {}) ⇒ Cli

Returns a new instance of Cli.



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

def initialize(arguments, options = {})
  @arguments = arguments
  @options = options
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



5
6
7
# File 'lib/pipefitter/cli.rb', line 5

def arguments
  @arguments
end

Class Method Details

.run(arguments, options = {}) ⇒ Object



7
8
9
# File 'lib/pipefitter/cli.rb', line 7

def self.run(arguments, options = {})
  new(arguments, options).run
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
# File 'lib/pipefitter/cli.rb', line 16

def run
  if help_requested?
    logger.info help_text
  else
    Pipefitter.compile(path, compiler_options)
  end
end