Class: SafePusher::CLI

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

Instance Method Summary collapse

Constructor Details

#initialize(arguments:) ⇒ CLI

Returns a new instance of CLI.



3
4
5
# File 'lib/safe_pusher/cli.rb', line 3

def initialize(arguments:)
  @arguments = arguments
end

Instance Method Details

#startObject



7
8
9
10
11
12
13
# File 'lib/safe_pusher/cli.rb', line 7

def start
  return version if arguments.first == '--version'

  help if commands.include?(nil)

  commands.compact.each { |command| execute_command(command) }
end