Sha256: 9f8fd0b0501472500dc44c3c4c778c942b35ebcb1fdde5a1ee45590d2674f1ba

Contents?: true

Size: 640 Bytes

Versions: 7

Compression:

Stored size: 640 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'
require_relative 'cli/version'

class Freighthop::CLI
  COMMANDS = [
    Freighthop::CLI::Version,
    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

7 entries across 7 versions & 1 rubygems

Version Path
freighthop-0.6.1 lib/freighthop/cli.rb
freighthop-0.6.0 lib/freighthop/cli.rb
freighthop-0.5.2 lib/freighthop/cli.rb
freighthop-0.5.1 lib/freighthop/cli.rb
freighthop-0.5.0 lib/freighthop/cli.rb
freighthop-0.4.1 lib/freighthop/cli.rb
freighthop-0.4.0 lib/freighthop/cli.rb