New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preparing for v2 #1651
Preparing for v2 #1651
Conversation
* Change `Number.number` to return integers. * Remove `leading_zero_number` because it has no meaning now that we are returning integers. * Remove `decimal_part` because it can now be replaced by `number`. * Fix all failing tests
* Update FillMurray Links To Include www * Faker::Number.decimal_part should return string for now
* Replace positional arguments with keyword arguments * Update CHANGELOG entries * Update docs
I'd like to see consistency with the argument names across the different classes. For example, some methods use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm of two minds for adding a keyword argument for methods that only take one argument... part of me thinks we should not use a keyword in those cases, but another part of me thinks it's useful from a self-documenting perspective. Thoughts?
doc/default/internet.md
Outdated
@@ -11,36 +11,36 @@ Faker::Internet.email('Janelle Santiago', '+') #=> janelle+santiago@becker.com" | |||
# Optional argument name=nil | |||
Faker::Internet.free_email #=> "freddy@gmail.com" | |||
|
|||
Faker::Internet.free_email('Nancy') #=> "nancy@yahoo.com" | |||
Faker::Internet.free_email(: 'Nancy') #=> "nancy@yahoo.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc error
lib/faker/default/number.rb
Outdated
def decimal(l_digits: 5, r_digits: 2) | ||
l_d = number(digits: l_digits) | ||
r_d = if r_digits == 1 | ||
0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be digit
instead of 0
? As written, decimal
numbers with 1 r_digit
will always be integers expressed as floats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused. Did you mean r_digits
instead of digit
? We don't have a digit
variable in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the method digit
, but you could also use generate(r_digits)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I think it should be random, not 0
(as it was when I made this comment) or 1
(as it is at this moment -- sorry I'm commenting on this outdated, I seem to be unable to add a new single comment on the not outdated file).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense 👍
I like the keyword argument for one-parameter methods. I like that it's self documenting, and I also like that it makes the methods consistent in their interface. If they're all keyword, then I don't need to remember how many options a method has to know whether it's positional or keyword. |
I think we still need to include this PR in v2: #1417. I'd be glad if anyone could help with a review. Thanks! |
* Add Faker::Time.between_dates, remove period from between This is an API breaking change. Before this change, issues such as #1280 existed due to some confusion about the behavior of Faker::Time.between. In essence, between could produce values outside of the range of (from..to) if the range is smaller than the provided period. After this change, between now behaves more like Faker::Date.between and as such the period argument has been removed. For the old behavior, a user should switch to calling between_dates, which has the same method signature as the old between method. The :between period is no longer valid. Documentation still needs to be updated, and additional tests need to be written. * Remove inheritance of Faker::Date by Faker::Time This is an API breaking change. Before this change, Faker::Time re-used some behavior of Faker::Date by first inheriting from Date, then using `super`. This relationship was one of convenience, though, and created some odd behavior for Time. For example, calling Faker::Time.birthday was possible, as birthday is defined in Faker::Date, but it would unintuitively return a Date object. Now, Faker::Time explicitly calls out to Faker::Date methods everywhere necessary, and the inheritance relationship has been removed. This does remove Faker::Time::birthday, and Faker::Time::between_except from the interface - but as these methods both return Date objects and are not documented in Faker::Time docs, they were never indicated for direct use anyway. * Improve Faker::Time.between tests for v2 behavior Adds a new test to prevent regression of #1280, and adds return type checking for new method between_dates. * Improve coverage of Faker::Time docs * Update docs * Add keyword args for Faker::Time * Delete time.md * Docs
…cated Space launch_vehicule (#1634) * deperecated misspelled launch_vehicule and removed test * corrected other occurrences of spelling vehicle spelling error and added to tests * deprecation and tests for Space.launch_vehicle * Remove unnecessary test
@stympy I've made some changes considering everyone's feedback and I think we could do the release on August 1st. Let me know if there is anything else that I forgot to include. |
Did a brief (5-10 minutes) review of the PR and it looks good to me 👍 |
Just tried upgrading my Rails app (https://github.com/connorshea/VideoGameList) with around ~50 uses of Faker between the seeds and factories. My only feedback would be to update the changelog with:
Ideally, we'd have a list of every single method changed and the new parameters, but that's probably too much work. A link to the commit diff should probably suffice for most people. Here's the upgrade commit for my project, it took ~30 minutes but I got the seeders and tests to all work: connorshea/vglist@1cc4d37 |
I’ll just add a note here before anyone goes and manually writes out the list of changed methods and their params: I have an idea for how to do this pretty easily by abusing Sorbet and it should only take me about 30 minutes. I’ll try to get to it tomorrow night :) |
It's looking good -- thanks for all the work! |
@vbrazo Well, that was dumb and I underestimated how long it'd take (it took around 90 minutes I think?) and how much manual work was involved. Here's a list of all the changed methods that you can add to the Changelog: - `Faker::Books::Dune.quote(character = nil)` becomes `Faker::Books::Dune.quote(character: nil)`
- `Faker::Books::Dune.saying(source = nil)` becomes `Faker::Books::Dune.saying(source: nil)`
- `Faker::Books::Lovecraft.fhtagn(number_of = nil)` becomes `Faker::Books::Lovecraft.fhtagn(number: nil)`
- `Faker::Books::Lovecraft.paragraph(sentence_count = nil, random_sentences_to_add = nil)` becomes `Faker::Books::Lovecraft.paragraph(sentence_count: nil, random_sentences_to_add: nil)`
- `Faker::Books::Lovecraft.paragraph_by_chars(chars = nil)` becomes `Faker::Books::Lovecraft.paragraph_by_chars(characters: nil)`
- `Faker::Books::Lovecraft.paragraphs(paragraph_count = nil)` becomes `Faker::Books::Lovecraft.paragraphs(number: nil)`
- `Faker::Books::Lovecraft.sentence(word_count = nil, random_words_to_add = nil)` becomes `Faker::Books::Lovecraft.sentence(word_count: nil, random_words_to_add: nil)`
- `Faker::Books::Lovecraft.sentences(sentence_count = nil)` becomes `Faker::Books::Lovecraft.sentences(number: nil)`
- `Faker::Books::Lovecraft.words(num = nil, spaces_allowed = nil)` becomes `Faker::Books::Lovecraft.words(number: nil, spaces_allowed: nil)`
- `Faker::Address.city(options = nil)` becomes `Faker::Address.city(options: nil)`
- `Faker::Address.postcode(state_abbreviation = nil)` becomes `Faker::Address.postcode(state_abbreviation: nil)`
- `Faker::Address.street_address(include_secondary = nil)` becomes `Faker::Address.street_address(include_secondary: nil)`
- `Faker::Address.zip(state_abbreviation = nil)` becomes `Faker::Address.zip(state_abbreviation: nil)`
- `Faker::Address.zip_code(state_abbreviation = nil)` becomes `Faker::Address.zip_code(state_abbreviation: nil)`
- `Faker::Alphanumeric.alpha(char_count = nil)` becomes `Faker::Alphanumeric.alpha(number: nil)`
- `Faker::Alphanumeric.alphanumeric(char_count = nil)` becomes `Faker::Alphanumeric.alphanumeric(number: nil)`
- `Faker::Avatar.image(slug = nil, size = nil, format = nil, set = nil, bgset = nil)` becomes `Faker::Avatar.image(slug: nil, size: nil, format: nil, set: nil, bgset: nil)`
- `Faker::Bank.account_number(digits = nil)` becomes `Faker::Bank.account_number(digits: nil)`
- `Faker::Bank.iban(country_code = nil)` becomes `Faker::Bank.iban(country_code: nil)`
- `Faker::ChileRut.full_rut(min_rut = nil, fixed = nil)` becomes `Faker::ChileRut.full_rut(min_rut: nil, fixed: nil)`
- `Faker::ChileRut.rut(min_rut = nil, fixed = nil)` becomes `Faker::ChileRut.rut(min_rut: nil, fixed: nil)`
- `Faker::Code.ean(base = nil)` becomes `Faker::Code.ean(base: nil)`
- `Faker::Code.isbn(base = nil)` becomes `Faker::Code.isbn(base: nil)`
- `Faker::Code.nric(min_age = nil, max_age = nil)` becomes `Faker::Code.nric(min_age: nil, max_age: nil)`
- `Faker::Commerce.department(max = nil, fixed_amount = nil)` becomes `Faker::Commerce.department(max: nil, fixed_amount: nil)`
- `Faker::Commerce.price(range = nil, as_string = nil)` becomes `Faker::Commerce.price(range: nil, as_string: nil)`
- `Faker::Commerce.promotion_code(digits = nil)` becomes `Faker::Commerce.promotion_code(digits: nil)`
- `Faker::Company.polish_register_of_national_economy(length = nil)` becomes `Faker::Company.polish_register_of_national_economy(length: nil)`
- `Faker::CryptoCoin.acronym(coin = nil)` becomes `Faker::CryptoCoin.acronym(coin: nil)`
- `Faker::CryptoCoin.coin_name(coin = nil)` becomes `Faker::CryptoCoin.coin_name(coin: nil)`
- `Faker::CryptoCoin.url_logo(coin = nil)` becomes `Faker::CryptoCoin.url_logo(coin: nil)`
- `Faker::Date.backward(days = nil)` becomes `Faker::Date.backward(days: nil)`
- `Faker::Date.between(from, to)` becomes `Faker::Date.between(from:, to:)`
- `Faker::Date.between_except(from, to, excepted)` becomes `Faker::Date.between_except(from:, to:, excepted:)`
- `Faker::Date.birthday(min_age = nil, max_age = nil)` becomes `Faker::Date.birthday(min_age: nil, max_age: nil)`
- `Faker::Date.forward(days = nil)` becomes `Faker::Date.forward(days: nil)`
- `Faker::Demographic.height(unit = nil)` becomes `Faker::Demographic.height(unit: nil)`
- `Faker::File.dir(segment_count = nil, root = nil, directory_separator = nil)` becomes `Faker::File.dir(segment_count: nil, root: nil, directory_separator: nil)`
- `Faker::File.file_name(dir = nil, name = nil, ext = nil, directory_separator = nil)` becomes `Faker::File.file_name(dir: nil, name: nil, ext: nil, directory_separator: nil)`
- `Faker::Fillmurray.image(grayscale = nil, width = nil, height = nil)` becomes `Faker::Fillmurray.image(grayscale: nil, width: nil, height: nil)`
- `Faker::Finance.vat_number(country = nil)` becomes `Faker::Finance.vat_number(country: nil)`
- `Faker::Hipster.paragraph(sentence_count = nil, supplemental = nil, random_sentences_to_add = nil)` becomes `Faker::Hipster.paragraph(sentence_count: nil, supplemental: nil, random_sentences_to_add: nil)`
- `Faker::Hipster.paragraph_by_chars(chars = nil, supplemental = nil)` becomes `Faker::Hipster.paragraph_by_chars(characters: nil, supplemental: nil)`
- `Faker::Hipster.paragraphs(paragraph_count = nil, supplemental = nil)` becomes `Faker::Hipster.paragraphs(number: nil, supplemental: nil)`
- `Faker::Hipster.sentence(word_count = nil, supplemental = nil, random_words_to_add = nil)` becomes `Faker::Hipster.sentence(word_count: nil, supplemental: nil, random_words_to_add: nil)`
- `Faker::Hipster.sentences(sentence_count = nil, supplemental = nil)` becomes `Faker::Hipster.sentences(number: nil, supplemental: nil)`
- `Faker::Hipster.words(num = nil, supplemental = nil, spaces_allowed = nil)` becomes `Faker::Hipster.words(number: nil, supplemental: nil, spaces_allowed: nil)`
- `Faker::Internet.domain_name(subdomain = nil)` becomes `Faker::Internet.domain_name(subdomain: nil)`
- `Faker::Internet.email(name = nil, *separators)` becomes `Faker::Internet.email(name: nil, separators: nil)`
- `Faker::Internet.fix_umlauts(string = nil)` becomes `Faker::Internet.fix_umlauts(string: nil)`
- `Faker::Internet.free_email(name = nil)` becomes `Faker::Internet.free_email(name: nil)`
- `Faker::Internet.mac_address(prefix = nil)` becomes `Faker::Internet.mac_address(prefix: nil)`
- `Faker::Internet.password(min_length = nil, max_length = nil, mix_case = nil, special_chars = nil)` becomes `Faker::Internet.password(min_length: nil, max_length: nil, mix_case: nil, special_characters: nil)`
- `Faker::Internet.safe_email(name = nil)` becomes `Faker::Internet.safe_email(name: nil)`
- `Faker::Internet.slug(words = nil, glue = nil)` becomes `Faker::Internet.slug(words: nil, glue: nil)`
- `Faker::Internet.url(host = nil, path = nil, scheme = nil)` becomes `Faker::Internet.url(host: nil, path: nil, scheme: nil)`
- `Faker::Internet.user_agent(vendor = nil)` becomes `Faker::Internet.user_agent(vendor: nil)`
- `Faker::Internet.user_name(specifier = nil, separators = nil)` becomes `Faker::Internet.user_name(specifier: nil, separators: nil)`
- `Faker::Internet.username(specifier = nil, separators = nil)` becomes `Faker::Internet.username(specifier: nil, separators: nil)`
- `Faker::Invoice.amount_between(from = nil, to = nil)` becomes `Faker::Invoice.amount_between(from: nil, to: nil)`
- `Faker::Invoice.creditor_reference(ref = nil)` becomes `Faker::Invoice.creditor_reference(ref: nil)`
- `Faker::Invoice.reference(ref = nil)` becomes `Faker::Invoice.reference(ref: nil)`
- `Faker::Json.add_depth_to_json(json = nil, width = nil, options = nil)` becomes `Faker::Json.add_depth_to_json(json: nil, width: nil, options: nil)`
- `Faker::Json.shallow_json(width = nil, options = nil)` becomes `Faker::Json.shallow_json(width: nil, options: nil)`
- `Faker::Lorem.characters(char_count = nil)` becomes `Faker::Lorem.characters(number: nil)`
- `Faker::Lorem.paragraph(sentence_count = nil, supplemental = nil, random_sentences_to_add = nil)` becomes `Faker::Lorem.paragraph(sentence_count: nil, supplemental: nil, random_sentences_to_add: nil)`
- `Faker::Lorem.paragraph_by_chars(chars = nil, supplemental = nil)` becomes `Faker::Lorem.paragraph_by_chars(number: nil, supplemental: nil)`
- `Faker::Lorem.paragraphs(paragraph_count = nil, supplemental = nil)` becomes `Faker::Lorem.paragraphs(number: nil, supplemental: nil)`
- `Faker::Lorem.question(word_count = nil, supplemental = nil, random_words_to_add = nil)` becomes `Faker::Lorem.question(word_count: nil, supplemental: nil, random_words_to_add: nil)`
- `Faker::Lorem.questions(question_count = nil, supplemental = nil)` becomes `Faker::Lorem.questions(number: nil, supplemental: nil)`
- `Faker::Lorem.sentence(word_count = nil, supplemental = nil, random_words_to_add = nil)` becomes `Faker::Lorem.sentence(word_count: nil, supplemental: nil, random_words_to_add: nil)`
- `Faker::Lorem.sentences(sentence_count = nil, supplemental = nil)` becomes `Faker::Lorem.sentences(number: nil, supplemental: nil)`
- `Faker::Lorem.words(num = nil, supplemental = nil)` becomes `Faker::Lorem.words(number: nil, supplemental: nil)`
- `Faker::LoremFlickr.colorized_image(size = nil, color = nil, search_terms = nil, match_all = nil)` becomes `Faker::LoremFlickr.colorized_image(size: nil, color: nil, search_terms: nil, match_all: nil)`
- `Faker::LoremFlickr.grayscale_image(size = nil, search_terms = nil, match_all = nil)` becomes `Faker::LoremFlickr.grayscale_image(size: nil, search_terms: nil, match_all: nil)`
- `Faker::LoremFlickr.image(size = nil, search_terms = nil, match_all = nil)` becomes `Faker::LoremFlickr.image(size: nil, search_terms: nil, match_all: nil)`
- `Faker::LoremFlickr.pixelated_image(size = nil, search_terms = nil, match_all = nil)` becomes `Faker::LoremFlickr.pixelated_image(size: nil, search_terms: nil, match_all: nil)`
- `Faker::LoremPixel.image(size = nil, is_gray = nil, category = nil, number = nil, text = nil, secure: nil)` becomes `Faker::LoremPixel.image(size: nil, is_gray: nil, category: nil, number: nil, text: nil, secure: nil)`
- `Faker::Markdown.sandwich(sentences = nil, repeat = nil)` becomes `Faker::Markdown.sandwich(sentences: nil, repeat: nil)`
- `Faker::Measurement.height(amount = nil)` becomes `Faker::Measurement.height(amount: nil)`
- `Faker::Measurement.length(amount = nil)` becomes `Faker::Measurement.length(amount: nil)`
- `Faker::Measurement.metric_height(amount = nil)` becomes `Faker::Measurement.metric_height(amount: nil)`
- `Faker::Measurement.metric_length(amount = nil)` becomes `Faker::Measurement.metric_length(amount: nil)`
- `Faker::Measurement.metric_volume(amount = nil)` becomes `Faker::Measurement.metric_volume(amount: nil)`
- `Faker::Measurement.metric_weight(amount = nil)` becomes `Faker::Measurement.metric_weight(amount: nil)`
- `Faker::Measurement.volume(amount = nil)` becomes `Faker::Measurement.volume(amount: nil)`
- `Faker::Measurement.weight(amount = nil)` becomes `Faker::Measurement.weight(amount: nil)`
- `Faker::Name.initials(character_count = nil)` becomes `Faker::Name.initials(number: nil)`
- `Faker::NationalHealthService.check_digit(number = nil)` becomes `Faker::NationalHealthService.check_digit(number: nil)`
- `Faker::Number.between(from = nil, to = nil)` becomes `Faker::Number.between(from: nil, to: nil)`
- `Faker::Number.decimal(l_digits = nil, r_digits = nil)` becomes `Faker::Number.decimal(l_digits: nil, r_digits: nil)`
- `Faker::Number.decimal_part(*args, &block)` becomes `Faker::Number.decimal_part(digits: nil)`
- `Faker::Number.hexadecimal(digits = nil)` becomes `Faker::Number.hexadecimal(digits: nil)`
- `Faker::Number.leading_zero_number(*args, &block)` becomes `Faker::Number.leading_zero_number(digits: nil)`
- `Faker::Number.negative(from = nil, to = nil)` becomes `Faker::Number.negative(from: nil, to: nil)`
- `Faker::Number.normal(mean = nil, standard_deviation = nil)` becomes `Faker::Number.normal(mean: nil, standard_deviation: nil)`
- `Faker::Number.number(digits = nil)` becomes `Faker::Number.number(digits: nil)`
- `Faker::Number.positive(from = nil, to = nil)` becomes `Faker::Number.positive(from: nil, to: nil)`
- `Faker::Number.within(range = nil)` becomes `Faker::Number.within(range: nil)`
- `Faker::PhoneNumber.extension(length = nil)` becomes `Faker::PhoneNumber.extension(length: nil)`
- `Faker::PhoneNumber.subscriber_number(length = nil)` becomes `Faker::PhoneNumber.subscriber_number(length: nil)`
- `Faker::Placeholdit.image(size = nil, format = nil, background_color = nil, text_color = nil, text = nil)` becomes `Faker::Placeholdit.image(size: nil, format: nil, background_color: nil, text_color: nil, text: nil)`
- `Faker::Relationship.familial(connection = nil)` becomes `Faker::Relationship.familial(connection: nil)`
- `Faker::Source.hello_world(lang = nil)` becomes `Faker::Source.hello_world(lang: nil)`
- `Faker::Source.print_1_to_10(lang = nil)` becomes `Faker::Source.print_1_to_10(lang: nil)`
- `Faker::String.random(length = nil)` becomes `Faker::String.random(length: nil)`
- `Faker::Stripe.ccv(card_type = nil)` becomes `Faker::Stripe.ccv(card_type: nil)`
- `Faker::Stripe.invalid_card(card_error = nil)` becomes `Faker::Stripe.invalid_card(card_error: nil)`
- `Faker::Stripe.valid_card(card_type = nil)` becomes `Faker::Stripe.valid_card(card_type: nil)`
- `Faker::Stripe.valid_token(card_type = nil)` becomes `Faker::Stripe.valid_token(card_type: nil)`
- `Faker::Time.backward(days = nil, period = nil, format = nil)` becomes `Faker::Time.backward(days: nil, period: nil, format: nil)`
- `Faker::Time.between(from, to, period = nil, format = nil)` becomes `Faker::Time.between(from:, to:, format: nil)`
- `Faker::Time.forward(days = nil, period = nil, format = nil)` becomes `Faker::Time.forward(days: nil, period: nil, format: nil)`
- `Faker::Types.complex_rb_hash(key_count = nil)` becomes `Faker::Types.complex_rb_hash(number: nil)`
- `Faker::Types.rb_array(len = nil)` becomes `Faker::Types.rb_array(len: nil)`
- `Faker::Types.rb_hash(key_count = nil, type = nil)` becomes `Faker::Types.rb_hash(number: nil, type: nil)`
- `Faker::Types.rb_integer(from = nil, to = nil)` becomes `Faker::Types.rb_integer(from: nil, to: nil)`
- `Faker::Types.rb_string(words = nil)` becomes `Faker::Types.rb_string(words: nil)`
- `Faker::Vehicle.kilometrage(min = nil, max = nil)` becomes `Faker::Vehicle.kilometrage(min: nil, max: nil)`
- `Faker::Vehicle.license_plate(state_abreviation = nil)` becomes `Faker::Vehicle.license_plate(state_abreviation: nil)`
- `Faker::Vehicle.mileage(min = nil, max = nil)` becomes `Faker::Vehicle.mileage(min: nil, max: nil)`
- `Faker::Vehicle.model(make_of_model = nil)` becomes `Faker::Vehicle.model(make_of_model: nil)`
- `Faker::WorldCup.group(group = nil)` becomes `Faker::WorldCup.group(group: nil)`
- `Faker::WorldCup.roster(country = nil, type = nil)` becomes `Faker::WorldCup.roster(country: nil, type: nil)`
- `Faker::Movies::StarWars.quote(character = nil)` becomes `Faker::Movies::StarWars.quote(character: nil)` I've also included the script to generate this, which you can edit to output a different format for this list if you want. I can't say I'm particularly proud of the script, but it works, so meh. Script to generate theseChange the line near the very end of this to change the output. before_classes = [
{
class_name: "Faker::Books::Dune",
methods: [
"def self.character; end",
"def self.planet; end",
"def self.quote(character = nil); end",
"def self.saying(source = nil); end",
"def self.title; end"
]
},
{
class_name: "Faker::Books::Lovecraft",
methods: [
"def self.deity; end",
"def self.fhtagn(number_of = nil); end",
"def self.location; end",
"def self.paragraph(sentence_count = nil, random_sentences_to_add = nil); end",
"def self.paragraph_by_chars(chars = nil); end",
"def self.paragraphs(paragraph_count = nil); end",
"def self.sentence(word_count = nil, random_words_to_add = nil); end",
"def self.sentences(sentence_count = nil); end",
"def self.tome; end",
"def self.word; end",
"def self.words(num = nil, spaces_allowed = nil); end"
]
},
{
class_name: "Faker::Address",
methods: [
"def self.building_number; end",
"def self.city(options = nil); end",
"def self.city_prefix; end",
"def self.city_suffix; end",
"def self.community; end",
"def self.country; end",
"def self.country_by_code(code: nil); end",
"def self.country_code; end",
"def self.country_code_long; end",
"def self.country_name_to_code(name: nil); end",
"def self.full_address; end",
"def self.latitude; end",
"def self.longitude; end",
"def self.postcode(state_abbreviation = nil); end",
"def self.secondary_address; end",
"def self.state; end",
"def self.state_abbr; end",
"def self.street_address(include_secondary = nil); end",
"def self.street_name; end",
"def self.street_suffix; end",
"def self.time_zone; end",
"def self.zip(state_abbreviation = nil); end",
"def self.zip_code(state_abbreviation = nil); end"
]
},
{
class_name: "Faker::Alphanumeric",
methods: [
"def self.alpha(char_count = nil); end",
"def self.alphanumeric(char_count = nil); end"
]
},
{
class_name: "Faker::Avatar",
methods: [
"def self.image(slug = nil, size = nil, format = nil, set = nil, bgset = nil); end"
]
},
{
class_name: "Faker::Bank",
methods: [
"def self.account_number(digits = nil); end",
"def self.checksum(num_string); end",
"def self.compile_fraction(routing_num); end",
"def self.compile_routing_number; end",
"def self.iban(country_code = nil); end",
"def self.iban_checksum(country_code, account); end",
"def self.name; end",
"def self.rand_numstring; end",
"def self.routing_number; end",
"def self.routing_number_with_format; end",
"def self.swift_bic; end",
"def self.valid_routing_number; end"
]
},
{
class_name: "Faker::ChileRut",
methods: [
"def self.check_digit; end",
"def self.dv; end",
"def self.full_rut(min_rut = nil, fixed = nil); end",
"def self.last_rut; end",
"def self.rut(min_rut = nil, fixed = nil); end"
]
},
{
class_name: "Faker::Code",
methods: [
"def self.asin; end",
"def self.ean(base = nil); end",
"def self.generate_base10_isbn; end",
"def self.generate_base13_ean; end",
"def self.generate_base13_isbn; end",
"def self.generate_base8_ean; end",
"def self.generate_imei; end",
"def self.generate_nric_check_alphabet(values, prefix); end",
"def self.generate_sin_check_digit(digits); end",
"def self.imei; end",
"def self.isbn(base = nil); end",
"def self.npi; end",
"def self.nric(min_age = nil, max_age = nil); end",
"def self.rut; end",
"def self.rut_verificator_digit(rut); end",
"def self.sin; end",
"def self.sum(values); end"
]
},
{
class_name: "Faker::Commerce",
methods: [
"def self.categories(num); end",
"def self.color; end",
"def self.department(max = nil, fixed_amount = nil); end",
"def self.material; end",
"def self.merge_categories(categories); end",
"def self.price(range = nil, as_string = nil); end",
"def self.product_name; end",
"def self.promotion_code(digits = nil); end",
]
},
{
class_name: "Faker::Company",
methods: [
"def self.abn_checksum(abn); end",
"def self.australian_business_number; end",
"def self.brazilian_company_number(formatted: nil); end",
"def self.bs; end",
"def self.buzzword; end",
"def self.catch_phrase; end",
"def self.collect_regon_sum(array); end",
"def self.czech_organisation_number; end",
"def self.duns_number; end",
"def self.ein; end",
"def self.french_siren_number; end",
"def self.french_siret_number; end",
"def self.industry; end",
"def self.logo; end",
"def self.luhn_algorithm(number); end",
"def self.mod11(number); end",
"def self.name; end",
"def self.norwegian_organisation_number; end",
"def self.polish_register_of_national_economy(length = nil); end",
"def self.polish_taxpayer_identification_number; end",
"def self.profession; end",
"def self.sic_code; end",
"def self.south_african_close_corporation_registration_number; end",
"def self.south_african_listed_company_registration_number; end",
"def self.south_african_pty_ltd_registration_number; end",
"def self.south_african_trust_registration_number; end",
"def self.spanish_organisation_number; end",
"def self.suffix; end",
"def self.swedish_organisation_number; end",
"def self.type; end",
"def self.weight_sum(array, weights); end"
]
},
{
class_name: "Faker::CryptoCoin",
methods: [
"def self.acronym(coin = nil); end",
"def self.coin_array; end",
"def self.coin_hash; end",
"def self.coin_name(coin = nil); end",
"def self.url_logo(coin = nil); end"
]
},
{
class_name: "Faker::Date",
methods: [
"def self.backward(days = nil); end",
"def self.between(from, to); end",
"def self.between_except(from, to, excepted); end",
"def self.birthday(min_age = nil, max_age = nil); end",
"def self.birthday_date(date, age); end",
"def self.forward(days = nil); end",
"def self.get_date_object(date); end"
]
},
{
class_name: "Faker::Demographic",
methods: [
"def self.demonym; end",
"def self.educational_attainment; end",
"def self.height(unit = nil); end",
"def self.marital_status; end",
"def self.race; end",
"def self.sex; end"
]
},
{
class_name: "Faker::File",
methods: [
"def self.dir(segment_count = nil, root = nil, directory_separator = nil); end",
"def self.extension; end",
"def self.file_name(dir = nil, name = nil, ext = nil, directory_separator = nil); end",
"def self.mime_type; end"
]
},
{
class_name: "Faker::Fillmurray",
methods: [
"def self.image(grayscale = nil, width = nil, height = nil); end"
]
},
{
class_name: "Faker::Finance",
methods: [
"def self.credit_card(*types); end",
"def self.vat_number(country = nil); end",
"def self.vat_number_keys; end"
]
},
{
class_name: "Faker::Hipster",
methods: [
"def self.paragraph(sentence_count = nil, supplemental = nil, random_sentences_to_add = nil); end",
"def self.paragraph_by_chars(chars = nil, supplemental = nil); end",
"def self.paragraphs(paragraph_count = nil, supplemental = nil); end",
"def self.sentence(word_count = nil, supplemental = nil, random_words_to_add = nil); end",
"def self.sentences(sentence_count = nil, supplemental = nil); end",
"def self.word; end",
"def self.words(num = nil, supplemental = nil, spaces_allowed = nil); end"
]
},
{
class_name: "Faker::IDNumber",
methods: [
"def self._translate(key); end",
"def self.brazilian_citizen_number(formatted: nil); end",
"def self.brazilian_citizen_number_checksum_digit(digits); end",
"def self.invalid; end",
"def self.invalid_south_african_id_number; end",
"def self.south_african_id_checksum_digit(id_number); end",
"def self.south_african_id_number; end",
"def self.spanish_citizen_number; end",
"def self.spanish_foreign_citizen_number; end",
"def self.ssn_valid; end",
"def self.valid; end",
"def self.valid_south_african_id_number; end"
]
},
{
class_name: "Faker::Internet",
methods: [
"def self.device_token; end",
"def self.domain_name(subdomain = nil); end",
"def self.domain_suffix; end",
"def self.domain_word; end",
"def self.email(name = nil, *separators); end",
"def self.fix_umlauts(string = nil); end",
"def self.free_email(name = nil); end",
"def self.ip_v4_address; end",
"def self.ip_v4_cidr; end",
"def self.ip_v6_address; end",
"def self.ip_v6_cidr; end",
"def self.mac_address(prefix = nil); end",
"def self.password(min_length = nil, max_length = nil, mix_case = nil, special_chars = nil); end",
"def self.private_ip_v4_address; end",
"def self.private_net_checker; end",
"def self.private_nets_regex; end",
"def self.public_ip_v4_address; end",
"def self.reserved_net_checker; end",
"def self.reserved_nets_regex; end",
"def self.safe_email(name = nil); end",
"def self.slug(words = nil, glue = nil); end",
"def self.url(host = nil, path = nil, scheme = nil); end",
"def self.user_agent(vendor = nil); end",
"def self.user_name(specifier = nil, separators = nil); end",
"def self.username(specifier = nil, separators = nil); end",
"def self.uuid; end"
]
},
{
class_name: "Faker::Invoice",
methods: [
"def self.amount_between(from = nil, to = nil); end",
"def self.calculate_weighted_sum(base, weight_factors); end",
"def self.creditor_reference(ref = nil); end",
"def self.iban_checksum(country_code, account); end",
"def self.kidmod10(base); end",
"def self.method_731(base); end",
"def self.mod10_remainder(number); end",
"def self.reference(ref = nil); end"
]
},
{
class_name: "Faker::Json",
methods: [
"def self.add_depth_to_json(json = nil, width = nil, options = nil); end",
"def self.add_hash(key_array, hash, width, options); end",
"def self.add_hash_to_bottom(hash, key_array, width, options); end",
"def self.build_keys_from_array(key_array); end",
"def self.build_shallow_hash(width, options); end",
"def self.shallow_json(width = nil, options = nil); end"
]
},
{
class_name: "Faker::Lorem",
methods: [
"def self.character; end",
"def self.characters(char_count = nil); end",
"def self.locale_period; end",
"def self.locale_question_mark; end",
"def self.locale_space; end",
"def self.multibyte; end",
"def self.paragraph(sentence_count = nil, supplemental = nil, random_sentences_to_add = nil); end",
"def self.paragraph_by_chars(chars = nil, supplemental = nil); end",
"def self.paragraphs(paragraph_count = nil, supplemental = nil); end",
"def self.question(word_count = nil, supplemental = nil, random_words_to_add = nil); end",
"def self.questions(question_count = nil, supplemental = nil); end",
"def self.sentence(word_count = nil, supplemental = nil, random_words_to_add = nil); end",
"def self.sentences(sentence_count = nil, supplemental = nil); end",
"def self.word; end",
"def self.words(num = nil, supplemental = nil); end"
]
},
{
class_name: "Faker::LoremFlickr",
methods: [
"def self.build_url(size, format, search_terms, match_all); end",
"def self.colorized_image(size = nil, color = nil, search_terms = nil, match_all = nil); end",
"def self.grayscale_image(size = nil, search_terms = nil, match_all = nil); end",
"def self.image(size = nil, search_terms = nil, match_all = nil); end",
"def self.pixelated_image(size = nil, search_terms = nil, match_all = nil); end"
]
},
{
class_name: "Faker::LoremPixel",
methods: [
"def self.image(size = nil, is_gray = nil, category = nil, number = nil, text = nil, secure: nil); end"
]
},
{
class_name: "Faker::Markdown",
methods: [
"def self.available_methods; end",
"def self.block_code; end",
"def self.emphasis; end",
"def self.headers; end",
"def self.inline_code; end",
"def self.ordered_list; end",
"def self.random(*args); end",
"def self.sandwich(sentences = nil, repeat = nil); end",
"def self.table; end",
"def self.unordered_list; end"
]
},
{
class_name: "Faker::Measurement",
methods: [
"def self.check_for_plural(text, number); end",
"def self.define_measurement_locale(amount, locale); end",
"def self.ensure_valid_amount(amount); end",
"def self.height(amount = nil); end",
"def self.length(amount = nil); end",
"def self.make_plural(text); end",
"def self.metric_height(amount = nil); end",
"def self.metric_length(amount = nil); end",
"def self.metric_volume(amount = nil); end",
"def self.metric_weight(amount = nil); end",
"def self.volume(amount = nil); end",
"def self.weight(amount = nil); end"
]
},
{
class_name: "Faker::Name",
methods: [
"def self.female_first_name; end",
"def self.feminine_name; end",
"def self.first_name; end",
"def self.first_name_men; end",
"def self.first_name_women; end",
"def self.initials(character_count = nil); end",
"def self.last_name; end",
"def self.male_first_name; end",
"def self.masculine_name; end",
"def self.middle_name; end",
"def self.name; end",
"def self.name_with_middle; end",
"def self.prefix; end",
"def self.suffix; end"
]
},
{
class_name: "Faker::NationalHealthService",
methods: [
"def self.british_number; end",
"def self.check_digit(number = nil); end"
]
},
{
class_name: "Faker::Number",
methods: [
"def self.between(from = nil, to = nil); end",
"def self.decimal(l_digits = nil, r_digits = nil); end",
"def self.decimal_part(*args, &block); end",
"def self.digit; end",
"def self.greater_than_zero(number); end",
"def self.hexadecimal(digits = nil); end",
"def self.leading_zero_number(*args, &block); end",
"def self.less_than_zero(number); end",
"def self.negative(from = nil, to = nil); end",
"def self.non_zero_digit; end",
"def self.normal(mean = nil, standard_deviation = nil); end",
"def self.number(digits = nil); end",
"def self.positive(from = nil, to = nil); end",
"def self.should_be(number, method_to_compare); end",
"def self.within(range = nil); end"
]
},
{
class_name: "Faker::Omniauth",
methods: [
"def email; end",
"def first_name; end",
"def initialize(name: nil, email: nil); end",
"def last_name; end",
"def name; end",
"def self.city_state; end",
"def self.facebook(name: nil, email: nil, username: nil, uid: nil); end",
"def self.gender; end",
"def self.github(name: nil, email: nil, uid: nil); end",
"def self.google(name: nil, email: nil, uid: nil); end",
"def self.image; end",
"def self.linkedin(name: nil, email: nil, uid: nil); end",
"def self.random_boolean; end",
"def self.random_number_from_range(range); end",
"def self.timezone; end",
"def self.twitter(name: nil, nickname: nil, uid: nil); end"
]
},
{
class_name: "Faker::PhoneNumber",
methods: [
"def self.area_code; end",
"def self.cell_phone; end",
"def self.cell_phone_with_country_code; end",
"def self.country_code; end",
"def self.exchange_code; end",
"def self.extension(length = nil); end",
"def self.phone_number; end",
"def self.phone_number_with_country_code; end",
"def self.subscriber_number(length = nil); end"
]
},
{
class_name: "Faker::Placeholdit",
methods: [
"def self.generate_color; end",
"def self.image(size = nil, format = nil, background_color = nil, text_color = nil, text = nil); end"
]
},
{
class_name: "Faker::Relationship",
methods: [
"def self.familial(connection = nil); end",
"def self.in_law; end",
"def self.parent; end",
"def self.sibling; end",
"def self.spouse; end"
]
},
{
class_name: "Faker::Source",
methods: [
"def self.hello_world(lang = nil); end",
"def self.print(str: nil, lang: nil); end",
"def self.print_1_to_10(lang = nil); end"
]
},
{
class_name: "Faker::String",
methods: [
"def self.char_space_ratio; end",
"def self.random(length = nil); end",
"def self.select_a(length); end",
"def self.space_or_utf8_char(ratio); end",
"def self.utf8character; end",
"def self.utf8string(length); end"
]
},
{
class_name: "Faker::Stripe",
methods: [
"def self.ccv(card_type = nil); end",
"def self.invalid_card(card_error = nil); end",
"def self.month; end",
"def self.valid_card(card_type = nil); end",
"def self.valid_token(card_type = nil); end",
"def self.year; end"
]
},
{
class_name: "Faker::Time",
methods: [
"def self.backward(days = nil, period = nil, format = nil); end",
"def self.between(from, to, period = nil, format = nil); end",
"def self.date_with_random_time(date, period); end",
"def self.forward(days = nil, period = nil, format = nil); end",
"def self.hours(period); end",
"def self.minutes; end",
"def self.seconds; end",
"def self.time_with_format(time, format); end"
]
},
{
class_name: "Faker::Twitter",
methods: [
"def self.created_at; end",
"def self.id; end",
"def self.photo_entity; end",
"def self.screen_name; end",
"def self.status(include_user: nil, include_photo: nil); end",
"def self.status_entities(include_photo: nil); end",
"def self.user(include_status: nil, include_email: nil); end",
"def self.user_entities; end",
"def self.utc_offset; end",
]
},
{
class_name: "Faker::Types",
methods: [
"def self.character; end",
"def self.complex_rb_hash(key_count = nil); end",
"def self.random_complex_type; end",
"def self.random_type; end",
"def self.rb_array(len = nil); end",
"def self.rb_hash(key_count = nil, type = nil); end",
"def self.rb_integer(from = nil, to = nil); end",
"def self.rb_string(words = nil); end",
"def self.titleize(word); end"
]
},
{
class_name: "Faker::Vehicle",
methods: [
"def self.calculate_vin_check_digit(vin); end",
"def self.car_options; end",
"def self.car_type; end",
"def self.color; end",
"def self.door_count; end",
"def self.doors; end",
"def self.drive_type; end",
"def self.engine; end",
"def self.engine_size; end",
"def self.first_eight(number); end",
"def self.fuel_type; end",
"def self.kilometrage(min = nil, max = nil); end",
"def self.last_eight(number); end",
"def self.license_plate(state_abreviation = nil); end",
"def self.make; end",
"def self.make_and_model; end",
"def self.manufacture; end",
"def self.mileage(min = nil, max = nil); end",
"def self.model(make_of_model = nil); end",
"def self.singapore_checksum(plate_number); end",
"def self.singapore_license_plate; end",
"def self.standard_specs; end",
"def self.style; end",
"def self.transmission; end",
"def self.vin; end",
"def self.vin_char_to_number(char); end",
"def self.year; end"
]
},
{
class_name: "Faker::WorldCup",
methods: [
"def self.city; end",
"def self.group(group = nil); end",
"def self.roster(country = nil, type = nil); end",
"def self.stadium; end",
"def self.team; end"
]
},
{
class_name: "Faker::Movies::StarWars",
methods: [
"def self.quote(character = nil); end"
]
}
]
after_classes = [
{
class_name: "Faker::Books::Dune",
methods: [
"def self.character; end",
"def self.planet; end",
"def self.quote(character: nil); end",
"def self.saying(source: nil); end",
"def self.title; end"
]
},
{
class_name: "Faker::Books::Lovecraft",
methods: [
"def self.deity; end",
"def self.fhtagn(number: nil); end",
"def self.location; end",
"def self.paragraph(sentence_count: nil, random_sentences_to_add: nil); end",
"def self.paragraph_by_chars(characters: nil); end",
"def self.paragraphs(number: nil); end",
"def self.sentence(word_count: nil, random_words_to_add: nil); end",
"def self.sentences(number: nil); end",
"def self.tome; end",
"def self.word; end",
"def self.words(number: nil, spaces_allowed: nil); end"
]
},
{
class_name: "Faker::Address",
methods: [
"def self.building_number; end",
"def self.city(options: nil); end",
"def self.city_prefix; end",
"def self.city_suffix; end",
"def self.community; end",
"def self.country; end",
"def self.country_by_code(code: nil); end",
"def self.country_code; end",
"def self.country_code_long; end",
"def self.country_name_to_code(name: nil); end",
"def self.full_address; end",
"def self.latitude; end",
"def self.longitude; end",
"def self.postcode(state_abbreviation: nil); end",
"def self.secondary_address; end",
"def self.state; end",
"def self.state_abbr; end",
"def self.street_address(include_secondary: nil); end",
"def self.street_name; end",
"def self.street_suffix; end",
"def self.time_zone; end",
"def self.zip(state_abbreviation: nil); end",
"def self.zip_code(state_abbreviation: nil); end"
]
},
{
class_name: "Faker::Alphanumeric",
methods: [
"def self.alpha(number: nil); end",
"def self.alphanumeric(number: nil); end"
]
},
{
class_name: "Faker::Avatar",
methods: [
"def self.image(slug: nil, size: nil, format: nil, set: nil, bgset: nil); end"
]
},
{
class_name: "Faker::Bank",
methods: [
"def self.account_number(digits: nil); end",
"def self.checksum(num_string); end",
"def self.compile_fraction(routing_num); end",
"def self.compile_routing_number; end",
"def self.iban(country_code: nil); end",
"def self.iban_checksum(country_code, account); end",
"def self.name; end",
"def self.rand_numstring; end",
"def self.routing_number; end",
"def self.routing_number_with_format; end",
"def self.swift_bic; end",
"def self.valid_routing_number; end"
]
},
{
class_name: "Faker::ChileRut",
methods: [
"def self.check_digit; end",
"def self.dv; end",
"def self.full_rut(min_rut: nil, fixed: nil); end",
"def self.last_rut; end",
"def self.rut(min_rut: nil, fixed: nil); end"
]
},
{
class_name: "Faker::Code",
methods: [
"def self.asin; end",
"def self.ean(base: nil); end",
"def self.generate_base10_isbn; end",
"def self.generate_base13_ean; end",
"def self.generate_base13_isbn; end",
"def self.generate_base8_ean; end",
"def self.generate_imei; end",
"def self.generate_nric_check_alphabet(values, prefix); end",
"def self.generate_sin_check_digit(digits); end",
"def self.imei; end",
"def self.isbn(base: nil); end",
"def self.npi; end",
"def self.nric(min_age: nil, max_age: nil); end",
"def self.rut; end",
"def self.rut_verificator_digit(rut); end",
"def self.sin; end",
"def self.sum(values); end"
]
},
{
class_name: "Faker::Commerce",
methods: [
"def self.categories(num); end",
"def self.color; end",
"def self.department(max: nil, fixed_amount: nil); end",
"def self.material; end",
"def self.merge_categories(categories); end",
"def self.price(range: nil, as_string: nil); end",
"def self.product_name; end",
"def self.promotion_code(digits: nil); end"
]
},
{
class_name: "Faker::Company",
methods: [
"def self.abn_checksum(abn); end",
"def self.australian_business_number; end",
"def self.brazilian_company_number(formatted: nil); end",
"def self.bs; end",
"def self.buzzword; end",
"def self.catch_phrase; end",
"def self.collect_regon_sum(array); end",
"def self.czech_organisation_number; end",
"def self.duns_number; end",
"def self.ein; end",
"def self.french_siren_number; end",
"def self.french_siret_number; end",
"def self.industry; end",
"def self.logo; end",
"def self.luhn_algorithm(number); end",
"def self.mod11(number); end",
"def self.name; end",
"def self.norwegian_organisation_number; end",
"def self.polish_register_of_national_economy(length: nil); end",
"def self.polish_taxpayer_identification_number; end",
"def self.profession; end",
"def self.sic_code; end",
"def self.south_african_close_corporation_registration_number; end",
"def self.south_african_listed_company_registration_number; end",
"def self.south_african_pty_ltd_registration_number; end",
"def self.south_african_trust_registration_number; end",
"def self.spanish_organisation_number; end",
"def self.suffix; end",
"def self.swedish_organisation_number; end",
"def self.type; end",
"def self.weight_sum(array, weights); end"
]
},
{
class_name: "Faker::CryptoCoin",
methods: [
"def self.acronym(coin: nil); end",
"def self.coin_array; end",
"def self.coin_hash; end",
"def self.coin_name(coin: nil); end",
"def self.url_logo(coin: nil); end"
]
},
{
class_name: "Faker::Date",
methods: [
"def self.backward(days: nil); end",
"def self.between(from:, to:); end",
"def self.between_except(from:, to:, excepted:); end",
"def self.birthday(min_age: nil, max_age: nil); end",
"def self.birthday_date(date, age); end",
"def self.forward(days: nil); end",
"def self.get_date_object(date); end"
]
},
{
class_name: "Faker::Demographic",
methods: [
"def self.demonym; end",
"def self.educational_attainment; end",
"def self.height(unit: nil); end",
"def self.marital_status; end",
"def self.race; end",
"def self.sex; end"
]
},
{
class_name: "Faker::File",
methods: [
"def self.dir(segment_count: nil, root: nil, directory_separator: nil); end",
"def self.extension; end",
"def self.file_name(dir: nil, name: nil, ext: nil, directory_separator: nil); end",
"def self.mime_type; end"
]
},
{
class_name: "Faker::Fillmurray",
methods: [
"def self.image(grayscale: nil, width: nil, height: nil); end"
]
},
{
class_name: "Faker::Finance",
methods: [
"def self.credit_card(*types); end",
"def self.vat_number(country: nil); end",
"def self.vat_number_keys; end",
]
},
{
class_name: "Faker::Hipster",
methods: [
"def self.paragraph(sentence_count: nil, supplemental: nil, random_sentences_to_add: nil); end",
"def self.paragraph_by_chars(characters: nil, supplemental: nil); end",
"def self.paragraphs(number: nil, supplemental: nil); end",
"def self.sentence(word_count: nil, supplemental: nil, random_words_to_add: nil); end",
"def self.sentences(number: nil, supplemental: nil); end",
"def self.word; end",
"def self.words(number: nil, supplemental: nil, spaces_allowed: nil); end"
]
},
{
class_name: "Faker::IDNumber",
methods: [
"def self._translate(key); end",
"def self.brazilian_citizen_number(formatted: nil); end",
"def self.brazilian_citizen_number_checksum_digit(digits); end",
"def self.invalid; end",
"def self.invalid_south_african_id_number; end",
"def self.south_african_id_checksum_digit(id_number); end",
"def self.south_african_id_number; end",
"def self.spanish_citizen_number; end",
"def self.spanish_foreign_citizen_number; end",
"def self.ssn_valid; end",
"def self.valid; end",
"def self.valid_south_african_id_number; end"
]
},
{
class_name: "Faker::Internet",
methods: [
"def self.device_token; end",
"def self.domain_name(subdomain: nil); end",
"def self.domain_suffix; end",
"def self.domain_word; end",
"def self.email(name: nil, separators: nil); end",
"def self.fix_umlauts(string: nil); end",
"def self.free_email(name: nil); end",
"def self.ip_v4_address; end",
"def self.ip_v4_cidr; end",
"def self.ip_v6_address; end",
"def self.ip_v6_cidr; end",
"def self.mac_address(prefix: nil); end",
"def self.password(min_length: nil, max_length: nil, mix_case: nil, special_characters: nil); end",
"def self.private_ip_v4_address; end",
"def self.private_net_checker; end",
"def self.private_nets_regex; end",
"def self.public_ip_v4_address; end",
"def self.reserved_net_checker; end",
"def self.reserved_nets_regex; end",
"def self.safe_email(name: nil); end",
"def self.slug(words: nil, glue: nil); end",
"def self.url(host: nil, path: nil, scheme: nil); end",
"def self.user_agent(vendor: nil); end",
"def self.user_name(specifier: nil, separators: nil); end",
"def self.username(specifier: nil, separators: nil); end",
"def self.uuid; end"
]
},
{
class_name: "Faker::Invoice",
methods: [
"def self.amount_between(from: nil, to: nil); end",
"def self.calculate_weighted_sum(base, weight_factors); end",
"def self.creditor_reference(ref: nil); end",
"def self.iban_checksum(country_code, account); end",
"def self.kidmod10(base); end",
"def self.method_731(base); end",
"def self.mod10_remainder(number); end",
"def self.reference(ref: nil); end"
]
},
{
class_name: "Faker::Json",
methods: [
"def self.add_depth_to_json(json: nil, width: nil, options: nil); end",
"def self.add_hash(key_array, hash, width, options); end",
"def self.add_hash_to_bottom(hash, key_array, width, options); end",
"def self.build_keys_from_array(key_array); end",
"def self.build_shallow_hash(width, options); end",
"def self.shallow_json(width: nil, options: nil); end"
]
},
{
class_name: "Faker::Lorem",
methods: [
"def self.character; end",
"def self.characters(number: nil); end",
"def self.locale_period; end",
"def self.locale_question_mark; end",
"def self.locale_space; end",
"def self.multibyte; end",
"def self.paragraph(sentence_count: nil, supplemental: nil, random_sentences_to_add: nil); end",
"def self.paragraph_by_chars(number: nil, supplemental: nil); end",
"def self.paragraphs(number: nil, supplemental: nil); end",
"def self.question(word_count: nil, supplemental: nil, random_words_to_add: nil); end",
"def self.questions(number: nil, supplemental: nil); end",
"def self.sentence(word_count: nil, supplemental: nil, random_words_to_add: nil); end",
"def self.sentences(number: nil, supplemental: nil); end",
"def self.word; end",
"def self.words(number: nil, supplemental: nil); end"
]
},
{
class_name: "Faker::LoremFlickr",
methods: [
"def self.build_url(size, format, search_terms, match_all); end",
"def self.colorized_image(size: nil, color: nil, search_terms: nil, match_all: nil); end",
"def self.grayscale_image(size: nil, search_terms: nil, match_all: nil); end",
"def self.image(size: nil, search_terms: nil, match_all: nil); end",
"def self.pixelated_image(size: nil, search_terms: nil, match_all: nil); end"
]
},
{
class_name: "Faker::LoremPixel",
methods: [
"def self.image(size: nil, is_gray: nil, category: nil, number: nil, text: nil, secure: nil); end"
]
},
{
class_name: "Faker::Markdown",
methods: [
"def self.available_methods; end",
"def self.block_code; end",
"def self.emphasis; end",
"def self.headers; end",
"def self.inline_code; end",
"def self.ordered_list; end",
"def self.random(*args); end",
"def self.sandwich(sentences: nil, repeat: nil); end",
"def self.table; end",
"def self.unordered_list; end"
]
},
{
class_name: "Faker::Measurement",
methods: [
"def self.check_for_plural(text, number); end",
"def self.define_measurement_locale(amount, locale); end",
"def self.ensure_valid_amount(amount); end",
"def self.height(amount: nil); end",
"def self.length(amount: nil); end",
"def self.make_plural(text); end",
"def self.metric_height(amount: nil); end",
"def self.metric_length(amount: nil); end",
"def self.metric_volume(amount: nil); end",
"def self.metric_weight(amount: nil); end",
"def self.volume(amount: nil); end",
"def self.weight(amount: nil); end"
]
},
{
class_name: "Faker::Name",
methods: [
"def self.female_first_name; end",
"def self.feminine_name; end",
"def self.first_name; end",
"def self.first_name_men; end",
"def self.first_name_women; end",
"def self.initials(number: nil); end",
"def self.last_name; end",
"def self.male_first_name; end",
"def self.masculine_name; end",
"def self.middle_name; end",
"def self.name; end",
"def self.name_with_middle; end",
"def self.prefix; end",
"def self.suffix; end"
]
},
{
class_name: "Faker::NationalHealthService",
methods: [
"def self.british_number; end",
"def self.check_digit(number: nil); end"
]
},
{
class_name: "Faker::Number",
methods: [
"def self.between(from: nil, to: nil); end",
"def self.decimal(l_digits: nil, r_digits: nil); end",
"def self.decimal_part(digits: nil); end",
"def self.digit; end",
"def self.greater_than_zero(number); end",
"def self.hexadecimal(digits: nil); end",
"def self.leading_zero_number(digits: nil); end",
"def self.less_than_zero(number); end",
"def self.negative(from: nil, to: nil); end",
"def self.non_zero_digit; end",
"def self.normal(mean: nil, standard_deviation: nil); end",
"def self.number(digits: nil); end",
"def self.positive(from: nil, to: nil); end",
"def self.should_be(number, method_to_compare); end",
"def self.within(range: nil); end"
]
},
{
class_name: "Faker::Omniauth",
methods: [
"def email; end",
"def first_name; end",
"def initialize(name: nil, email: nil); end",
"def last_name; end",
"def name; end",
"def self.city_state; end",
"def self.facebook(name: nil, email: nil, username: nil, uid: nil); end",
"def self.gender; end",
"def self.github(name: nil, email: nil, uid: nil); end",
"def self.google(name: nil, email: nil, uid: nil); end",
"def self.image; end",
"def self.linkedin(name: nil, email: nil, uid: nil); end",
"def self.random_boolean; end",
"def self.random_number_from_range(range); end",
"def self.timezone; end",
"def self.twitter(name: nil, nickname: nil, uid: nil); end"
]
},
{
class_name: "Faker::PhoneNumber",
methods: [
"def self.area_code; end",
"def self.cell_phone; end",
"def self.cell_phone_with_country_code; end",
"def self.country_code; end",
"def self.exchange_code; end",
"def self.extension(length: nil); end",
"def self.phone_number; end",
"def self.phone_number_with_country_code; end",
"def self.subscriber_number(length: nil); end"
]
},
{
class_name: "Faker::Placeholdit",
methods: [
"def self.generate_color; end",
"def self.image(size: nil, format: nil, background_color: nil, text_color: nil, text: nil); end"
]
},
{
class_name: "Faker::Relationship",
methods: [
"def self.familial(connection: nil); end",
"def self.in_law; end",
"def self.parent; end",
"def self.sibling; end",
"def self.spouse; end"
]
},
{
class_name: "Faker::Source",
methods: [
"def self.hello_world(lang: nil); end",
"def self.print(str: nil, lang: nil); end",
"def self.print_1_to_10(lang: nil); end"
]
},
{
class_name: "Faker::String",
methods: [
"def self.char_space_ratio; end",
"def self.random(length: nil); end",
"def self.select_a(length); end",
"def self.space_or_utf8_char(ratio); end",
"def self.utf8character; end",
"def self.utf8string(length); end"
]
},
{
class_name: "Faker::Stripe",
methods: [
"def self.ccv(card_type: nil); end",
"def self.invalid_card(card_error: nil); end",
"def self.month; end",
"def self.valid_card(card_type: nil); end",
"def self.valid_token(card_type: nil); end",
"def self.year; end"
]
},
{
class_name: "Faker::Time",
methods: [
"def self.backward(days: nil, period: nil, format: nil); end",
"def self.between(from:, to:, format: nil); end",
"def self.date_with_random_time(date, period); end",
"def self.forward(days: nil, period: nil, format: nil); end",
"def self.hours(period); end",
"def self.minutes; end",
"def self.seconds; end",
"def self.time_with_format(time, format); end"
]
},
{
class_name: "Faker::Twitter",
methods: [
"def self.created_at; end",
"def self.id; end",
"def self.photo_entity; end",
"def self.screen_name; end",
"def self.status(include_user: nil, include_photo: nil); end",
"def self.status_entities(include_photo: nil); end",
"def self.user(include_status: nil, include_email: nil); end",
"def self.user_entities; end",
"def self.utc_offset; end"
]
},
{
class_name: "Faker::Types",
methods: [
"def self.character; end",
"def self.complex_rb_hash(number: nil); end",
"def self.random_complex_type; end",
"def self.random_type; end",
"def self.rb_array(len: nil); end",
"def self.rb_hash(number: nil, type: nil); end",
"def self.rb_integer(from: nil, to: nil); end",
"def self.rb_string(words: nil); end",
"def self.titleize(word); end"
]
},
{
class_name: "Faker::Vehicle",
methods: [
"def self.calculate_vin_check_digit(vin); end",
"def self.car_options; end",
"def self.car_type; end",
"def self.color; end",
"def self.door_count; end",
"def self.doors; end",
"def self.drive_type; end",
"def self.engine; end",
"def self.engine_size; end",
"def self.first_eight(number); end",
"def self.fuel_type; end",
"def self.kilometrage(min: nil, max: nil); end",
"def self.last_eight(number); end",
"def self.license_plate(state_abreviation: nil); end",
"def self.make; end",
"def self.make_and_model; end",
"def self.manufacture; end",
"def self.mileage(min: nil, max: nil); end",
"def self.model(make_of_model: nil); end",
"def self.singapore_checksum(plate_number); end",
"def self.singapore_license_plate; end",
"def self.standard_specs; end",
"def self.style; end",
"def self.transmission; end",
"def self.vin; end",
"def self.vin_char_to_number(char); end",
"def self.year; end"
]
},
{
class_name: "Faker::WorldCup",
methods: [
"def self.city; end",
"def self.group(group: nil); end",
"def self.roster(country: nil, type: nil); end",
"def self.stadium; end",
"def self.team; end"
]
},
{
class_name: "Faker::Movies::StarWars",
methods: [
"def self.quote(character: nil); end"
]
}
]
raise 'Array sizes should be the same' if before_classes.length != after_classes.length
before_methods = []
after_methods = []
before_classes.each do |klass|
klass_name = klass[:class_name]
klass[:methods].each do |meth|
a = meth.slice!('def self')
a = meth.slice!('; end')
before_methods << "#{klass_name}#{meth}"
end
end
after_classes.each do |klass|
klass_name = klass[:class_name]
klass[:methods].each do |meth|
a = meth.slice!('def self')
a = meth.slice!('; end')
after_methods << "#{klass_name}#{meth}"
end
end
puts "before: #{before_methods.length}, after: #{after_methods.length}"
after_classes.each_with_index do |klass, index|
next if klass[:methods].length == before_classes[index][:methods].length
puts 'something is messed up'
end
raise 'Method arrays much have the same length' if before_methods.length != after_methods.length
same_counter = 0
before_methods.length.times do |index|
if before_methods[index] == after_methods[index]
same_counter += 1
next
end
# !!!!! EDIT THIS LINE !!!!!
puts "- `#{before_methods[index]}` becomes `#{after_methods[index]}`"
end
# puts "#{same_counter} unchanged methods" |
Nice work! Thanks! @connorshea |
Preparing for v2
Issues
Closes #1356
Closes #1655
Closes #1610
Closes #1657
General changes and PRs:
Faker::Number
return integers and floats instead of strings (Make Faker::Number return integers and floats instead of strings #510)decimal_part
return floatFaker::Time::between
(Rework Faker::Time::between #1417)