class Dip::CLI

Constants

TOP_LEVEL_COMMANDS

Public Class Methods

exit_on_failure?() click to toggle source
# File lib/dip/cli.rb, line 18
def exit_on_failure?
  true
end
is_thor_reserved_word?(word, type) click to toggle source

Hackery. Take the run method away from Thor so that we can redefine it.

Calls superclass method
# File lib/dip/cli.rb, line 12
def is_thor_reserved_word?(word, type)
  return false if word == "run"

  super
end
start(argv) click to toggle source
Calls superclass method
# File lib/dip/cli.rb, line 22
def start(argv)
  argv = Dip::RunVars.call(argv, ENV)

  cmd = argv.first

  if cmd && !TOP_LEVEL_COMMANDS.include?(cmd) && Dip.config.exist? && Dip.config.interaction.key?(cmd.to_sym)
    argv.unshift("run")
  end

  super Dip::RunVars.call(argv, ENV)
end

Public Instance Methods

build(*argv) click to toggle source
# File lib/dip/cli.rb, line 57
def build(*argv)
  compose("build", *argv)
end
compose(*argv) click to toggle source
# File lib/dip/cli.rb, line 51
def compose(*argv)
  require_relative "commands/compose"
  Dip::Commands::Compose.new(*argv).execute
end
down(*argv) click to toggle source
# File lib/dip/cli.rb, line 72
def down(*argv)
  compose("down", *argv)
end
ls() click to toggle source
# File lib/dip/cli.rb, line 45
def ls
  require_relative "commands/list"
  Dip::Commands::List.new.execute
end
provision() click to toggle source
# File lib/dip/cli.rb, line 92
def provision
  if options[:help]
    invoke :help, ["provision"]
  else
    require_relative "commands/provision"
    Dip::Commands::Provision.new.execute
  end
end
run(*argv) click to toggle source
# File lib/dip/cli.rb, line 80
def run(*argv)
  if argv.empty? || options[:help]
    invoke :help, ["run"]
  else
    require_relative "commands/run"
    Dip::Commands::Run.new(*argv, publish: options[:publish]).execute
  end
end
stop(*argv) click to toggle source
# File lib/dip/cli.rb, line 67
def stop(*argv)
  compose("stop", *argv)
end
up(*argv) click to toggle source
# File lib/dip/cli.rb, line 62
def up(*argv)
  compose("up", *argv)
end
version() click to toggle source
# File lib/dip/cli.rb, line 38
def version
  require_relative "version"
  puts Dip::VERSION
end