/usr/lib/ruby/vendor_ruby/moneta/utils.rb is in ruby-moneta 0.7.20-2.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | module Moneta
# @api private
module Utils
extend self
def without(hash, *keys)
return hash if hash.empty?
if keys.any? {|k| hash.include?(k) }
hash = hash.dup
keys.each {|k| hash.delete(k) }
end
hash
end
def only(hash, *keys)
return hash if hash.empty?
ret = {}
keys.each {|k| ret[k] = hash[k] }
ret
end
def to_int(value)
intvalue = value.to_i
raise "#{value.inspect} is not an integer value" unless value == nil || intvalue.to_s == value.to_s
intvalue
end
end
end
|