Exception: EY::AmbiguousEnvironmentGitUriError

Inherits:
EnvironmentError show all
Defined in:
lib/engineyard/error.rb

Instance Method Summary collapse

Methods inherited from Error

#ambiguous

Constructor Details

#initialize(environments) ⇒ AmbiguousEnvironmentGitUriError

Returns a new instance of AmbiguousEnvironmentGitUriError.



76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/engineyard/error.rb', line 76

def initialize(environments)
  message = "The repository url in this directory is ambiguous.\n"
  message << "Please use -e <envname> to specify one of the following environments:\n"
  environments.sort do |a, b|
    if a. == b.
      a.name <=> b.name
    else
      a..name <=> b..name
    end
  end.each { |env| message << "\t#{env.name} (#{env..name})\n" }
  super message
end