class SubCommand

Public Instance Methods

directory() click to toggle source
# File lib/dockit/cli.rb, line 38
def directory
  @directory ||= shell.base.module_directory(self.class)
end
in_directory() { || ... } click to toggle source
# File lib/dockit/cli.rb, line 42
def in_directory
  Dir.chdir(directory) do
    yield
  end
end
invoke_default(service=nil, cmd: nil, opts: {}) click to toggle source

invoke command against the Dockit.yaml for the given service.

# File lib/dockit/cli.rb, line 11
def invoke_default(service=nil, cmd: nil, opts: {})
  service  ||= self.class.to_s.downcase
  cmd ||= current_command_chain[-1]
  cmd = "default:#{cmd}"
  invoke cmd, [service], options.merge(opts)
  instance_variable_get('@_invocations')[Default].slice!(-1)
end
invoke_git(service) click to toggle source

export git repository before running default command

# File lib/dockit/cli.rb, line 30
def invoke_git(service)
  invoke_default service, cmd: 'git-build'
end
invoke_service(service, cmd: nil, opts: {}) click to toggle source

invoke the method in the Dockit.rb for the given service.

# File lib/dockit/cli.rb, line 20
def invoke_service(service, cmd: nil, opts: {})
  cmd ||= current_command_chain[-1]
  cmd = "#{service}:#{cmd}"

  say "Invoking #{cmd}"
  invoke cmd, [], options.merge(opts)
  instance_variable_get('@_invocations')[Default].slice!(-1)
end
project_root() click to toggle source
# File lib/dockit/cli.rb, line 34
def project_root
  shell.base.project_root
end