lib/berkshelf/locations/site_location.rb in berkshelf-2.0.0.beta vs lib/berkshelf/locations/site_location.rb in berkshelf-2.0.0
- old
+ new
@@ -1,7 +1,6 @@
module Berkshelf
- # @author Jamie Winsor <reset@riotgames.com>
class SiteLocation
extend Forwardable
include Location
set_location_key :site
@@ -20,10 +19,12 @@
# be provided to initialize a SiteLocation pointing to the Opscode Community Site.
def initialize(name, version_constraint, options = {})
@name = name
@version_constraint = version_constraint
- api_uri = if options[:site].nil? || SHORTNAMES.has_key?(options[:site])
+ api_uri = if options[:site].nil?
+ SHORTNAMES[:opscode]
+ elsif SHORTNAMES.has_key?(options[:site])
SHORTNAMES[options[:site]]
elsif options[:site].kind_of?(Symbol)
raise InvalidSiteShortnameError.new(options[:site])
else
options[:site]