/usr/share/rubygems-integration/all/gems/faker-1.6.6/lib/faker/id_number.rb is in ruby-faker 1.6.6-1.
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 29 30 31 32 33 34 35 36 | module Faker
class IDNumber < Base
INVALID_SSN = [
/0{3}-\d{2}-\d{4}/,
/\d{3}-0{2}-\d{4}/,
/\d{3}-\d{2}-0{4}/,
/666-\d{2}-\d{4}/,
/9\d{2}-\d{2}-\d{4}/
]
class << self
def valid
_translate 'valid'
end
def invalid
_translate 'invalid'
end
def ssn_valid
ssn = regexify(/[0-8]\d{2}-\d{2}-\d{4}/)
# We could still have all 0s in one segment or another
INVALID_SSN.any? { |regex| regex =~ ssn } ? ssn_valid : ssn
end
private
def _translate key
if parse("id_number.#{key}") == ''
numerify(fetch("id_number.#{key}"))
else
parse("id_number.#{key}")
end
end
end
end
end
|