lib/riak/bucket.rb in riak-client-2.2.0 vs lib/riak/bucket.rb in riak-client-2.2.1

- old
+ new

@@ -31,10 +31,14 @@ # Retrieves a list of keys in this bucket. # If a block is given, keys will be streamed through # the block (useful for large buckets). When streaming, # results of the operation will not be returned to the caller. + # + # Returned keys will be in binary encoding regardless of the key's original + # encoding. + # # @yield [Array<String>] a list of keys from the current chunk # @return [Array<String>] Keys in this bucket # @note This operation has serious performance implications and # should not be used in production applications. def keys(options = {}, &block) @@ -288,10 +292,14 @@ # @return [true,false] whether the other is equivalent def ==(other) return false unless self.class == other.class return false unless self.client == other.client - return false unless self.name == other.name + return true if self.name.nil? && other.name.nil? + unless self.name.respond_to?(:bytes) && other.name.respond_to?(:bytes) + return false + end + return false unless self.name.bytes == other.name.bytes true end end end