lib/berkshelf/source.rb in berkshelf-7.0.8 vs lib/berkshelf/source.rb in berkshelf-7.0.9

- old
+ new

@@ -1,8 +1,8 @@ -require "berkshelf/api-client" -require "berkshelf/chef_repo_universe" -require "berkshelf/ssl_policies" +require_relative "api-client" +require_relative "chef_repo_universe" +require_relative "ssl_policies" require "openssl" module Berkshelf class Source include Comparable @@ -82,11 +82,11 @@ # # @return [Array<APIClient::RemoteCookbook>] def build_universe @universe = api_client.universe rescue => ex - @universe = Array.new + @universe = [] raise ex end # Return the universe from the API endpoint. # @@ -152,18 +152,19 @@ "#{type}: #{uri}" end end def inspect - "#<#{self.class.name} #{type}: #{uri.to_s.inspect}, #{options.map { |k, v| "#{k}: #{v.inspect}" }.join(', ')}>" + "#<#{self.class.name} #{type}: #{uri.to_s.inspect}, #{options.map { |k, v| "#{k}: #{v.inspect}" }.join(", ")}>" end def hash [type, uri_string, options].hash end def ==(other) return false unless other.is_a?(self.class) + type == other.type && uri == other.uri end private