Sha256: aca6cf29530a88ac7b5c6ab8ff218b8744063d0840c14da4b7c71fc9b7a75fcc

Contents?: true

Size: 580 Bytes

Versions: 4

Compression:

Stored size: 580 Bytes

Contents

class Freighthop::CLI; end

require_relative 'cli/checks'
require_relative 'cli/help'
require_relative 'cli/init'
require_relative 'cli/ssh'
require_relative 'cli/vagrant'

class Freighthop::CLI
  COMMANDS = [
    Freighthop::CLI::Help,
    Freighthop::CLI::Init,
    Freighthop::CLI::Vagrant,
    Freighthop::CLI::SSH,
  ]

  def initialize(*args)
    @args = args
  end

  def run
    Freighthop::VagrantEnv.activate!

    command = COMMANDS.detect { |c| c.match?(*@args) }
    # no need for a nil check, because CLI::SSH will always match
    command.new(*@args).run
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
freighthop-0.3.3 lib/freighthop/cli.rb
freighthop-0.3.2 lib/freighthop/cli.rb
freighthop-0.3.1 lib/freighthop/cli.rb
freighthop-0.3.0 lib/freighthop/cli.rb