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.



53
54
55
56
57
# File 'lib/aptible/cli/helpers/app.rb', line 53

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

Instance Method Details

#app_handleObject



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

def app_handle
  handles_from_remote[:app_handle]
end

#env_handleObject



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

def env_handle
  handles_from_remote[:environment_handle]
end

#explainObject



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

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

#usable?Boolean

Returns:

  • (Boolean)


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

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