Class: Aptible::CLI::Helpers::App::GitRemoteHandleStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/aptible/cli/helpers/app.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ GitRemoteHandleStrategy

Returns a new instance of GitRemoteHandleStrategy.



57
58
59
60
61
# File 'lib/aptible/cli/helpers/app.rb', line 57

def initialize(options)
  @remote_name = options[:remote] || ENV['APTIBLE_REMOTE'] ||
                 'aptible'
  @repo_dir = Dir.pwd
end

Instance Method Details

#app_handleObject



63
64
65
# File 'lib/aptible/cli/helpers/app.rb', line 63

def app_handle
  handles_from_remote[:app_handle]
end

#env_handleObject



67
68
69
# File 'lib/aptible/cli/helpers/app.rb', line 67

def env_handle
  handles_from_remote[:environment_handle]
end

#explainObject



75
76
77
# File 'lib/aptible/cli/helpers/app.rb', line 75

def explain
  "(options derived from git remote #{@remote_name})"
end

#usable?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/aptible/cli/helpers/app.rb', line 71

def usable?
  !app_handle.nil? && !env_handle.nil?
end