Skip to content
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

Merged
merged 41 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5e124f3
Merge branch 'master' into v2
vbrazo Oct 16, 2018
cbd908f
Merge branch 'master' into v2
vbrazo Dec 9, 2018
60fd3c9
Make Faker::Number return integers and floats instead of strings (#510)
tejasbubane Jan 27, 2019
076d53d
Merge branch 'master' into v2
vbrazo Jan 27, 2019
3d3ac61
Merge branch 'master' into v2
vbrazo Jul 7, 2019
5f3c1af
Fix CI
vbrazo Jul 7, 2019
bddbd61
Deprecate warnings should be removed in v2
vbrazo Jul 10, 2019
05bca59
Remove unreleased docs
vbrazo Jul 10, 2019
a9ea821
Readd decimal_part() and leading_zero_number() returning strings
vbrazo Jul 10, 2019
90bef7e
Merge branch 'master' into v2
vbrazo Jul 10, 2019
57ccfbc
Merge branch 'master' into v2
vbrazo Jul 22, 2019
748adef
Update FillMurray Links To Include www (#1660)
RaymondFallon Jul 24, 2019
cfd730e
Replace positional arguments with keyword arguments (#1664)
vbrazo Jul 24, 2019
d9a22c6
Remove unused file
vbrazo Jul 24, 2019
366a7a4
Remove deprecation skip
vbrazo Jul 24, 2019
ac22c11
Numbers keyword arguments should be standard. The default is characters
vbrazo Jul 26, 2019
2c1ada4
More renaming
vbrazo Jul 26, 2019
6500432
Renaming Faker::Lorem.word keyword argument
vbrazo Jul 26, 2019
86c8e6e
Renaming..
vbrazo Jul 26, 2019
d9124be
Rename Faker::Alphanumeric keyword argument
vbrazo Jul 26, 2019
6cc15b4
Merge branch 'master' into v2
vbrazo Jul 26, 2019
12dd08d
Remove unnecessary namespace modules
vbrazo Jul 26, 2019
cb30465
Add keyword arguments for Faker::Internet.email
vbrazo Jul 26, 2019
bf1f690
.paragraphs() and .sentences() should have a number: keyword argument
vbrazo Jul 26, 2019
ba9b869
It should be generate(r_digits)
vbrazo Jul 28, 2019
d4be786
Update changelog
vbrazo Jul 28, 2019
40ddc88
Rework Faker::Time::between (#1417)
pjohnmeyer Jul 28, 2019
d527fbe
Corrected other occurrences of spelling vehicle spelling error, depre…
Siyanda Jul 28, 2019
d80e503
Update changelog
vbrazo Jul 28, 2019
7f8cabf
Keep docs consistent
vbrazo Jul 28, 2019
ffeded0
We dont need this
vbrazo Jul 28, 2019
1977088
Some Faker::Time fixes
vbrazo Jul 29, 2019
9523b7a
Remove this suggestion
vbrazo Jul 29, 2019
44e2ecc
Fix typo in file.md
vbrazo Jul 29, 2019
1012ec7
Double check /docs and fix issues
vbrazo Jul 29, 2019
d52d95b
Fix docs again
vbrazo Jul 29, 2019
d5f744a
Minor fixes after my own review
vbrazo Jul 29, 2019
f0fdecd
Add missing docs and make them similar
vbrazo Jul 29, 2019
da63e3a
Use number: instead of characters: to preserve consistency among argu…
vbrazo Jul 29, 2019
955dff1
Update CHANGELOG.md
vbrazo Jul 30, 2019
2dd4cc6
CHANGELOG - add changed methods list
vbrazo Jul 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@
### Chores
### Deprecation
### Documentation

- [PR #1653](https://github.com/stympy/faker/pull/1653) Add /faker-ruby/faker-bot to README [@vbrazo](https://github.com/vbrazo)

### Feature Request

- [PR #1664](https://github.com/stympy/faker/pull/1664) Replace positional arguments with keyword arguments [@vbrazo](https://github.com/vbrazo)

### Update/add locales

- [PR #1658](https://github.com/stympy/faker/pull/1658) Update Faker::Games::SuperSmashBros entries [@boardfish](https://github.com/boardfish)
- [PR #1649](https://github.com/stympy/faker/pull/1649) Remove mexicoMX [@vbrazo](https://github.com/vbrazo)

------------------------------------------------------------------------------

## [v1.9.6](https://github.com/stympy/faker/tree/1.9.6) (2019-07-05)
Expand Down
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@

source 'https://rubygems.org'

# Remove Rubygems deprecation warnings
Deprecate.skip = true if defined?(Deprecate.skip)
Gem::Deprecate.skip = true if defined?(Gem::Deprecate.skip)

# Specify your gem's dependencies in faker.gemspec
gemspec
4 changes: 2 additions & 2 deletions doc/books/dune.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Faker::Books::Dune.planet #=> "Caladan"

Faker::Books::Dune.quote #=> "A dead man, surely, no longer requires that water."

Faker::Books::Dune.quote("baron_harkonnen") #=> "He who controls the spice, controls the universe!"
Faker::Books::Dune.quote(character: "baron_harkonnen") #=> "He who controls the spice, controls the universe!"

Faker::Books::Dune.saying #=> "You do not beg the sun for mercy."

Faker::Books::Dune.saying("fremen") #=> "May thy knife chip and shatter."
Faker::Books::Dune.saying(source: "fremen") #=> "May thy knife chip and shatter."
```
20 changes: 10 additions & 10 deletions doc/books/lovecraft.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```ruby
Faker::Books::Lovecraft.fhtagn #=> "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn"
Faker::Books::Lovecraft.fhtagn(3) #=> "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn. Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn. Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn"
Faker::Books::Lovecraft.fhtagn(number: 3) #=> "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn. Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn. Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn"

Faker::Books::Lovecraft.deity #=> "Shub-Niggurath"

Expand All @@ -14,28 +14,28 @@ Faker::Books::Lovecraft.word #=> "furtive"

# Optional arguments: word_count=4, random_words_to_add=6
Faker::Books::Lovecraft.sentence #=> "Furtive antiquarian squamous dank cat loathsome amorphous lurk."
Faker::Books::Lovecraft.sentence(3) #=> "Daemoniac antediluvian fainted squamous comprehension gambrel nameless singular."
Faker::Books::Lovecraft.sentence(3, 1) #=> "Amorphous indescribable tenebrous."
Faker::Books::Lovecraft.sentence(word_count: 3) #=> "Daemoniac antediluvian fainted squamous comprehension gambrel nameless singular."
Faker::Books::Lovecraft.sentence(word_count: 3, random_words_to_add: 1) #=> "Amorphous indescribable tenebrous."

# Optional arguments: num=3, spaces_allowed = false
Faker::Books::Lovecraft.words #=> ["manuscript", "abnormal", "singular"]
Faker::Books::Lovecraft.words(2) #=> ["daemoniac", "cat"]
Faker::Books::Lovecraft.words(2, true) #=> ["lurk", "charnel"]
Faker::Books::Lovecraft.words(number: 2) #=> ["daemoniac", "cat"]
Faker::Books::Lovecraft.words(number: 2, spaces_allowed: true) #=> ["lurk", "charnel"]

# Optional arguments: sentence_count=3
Faker::Books::Lovecraft.sentences #=> ["Nameless loathsome decadent gambrel.", "Ululate swarthy immemorial cat madness gibbous unmentionable unnamable.", "Decadent antediluvian non-euclidean tentacles amorphous tenebrous."]
Faker::Books::Lovecraft.sentences(2) #=> ["Antediluvian amorphous unmentionable singular accursed squamous immemorial.", "Gambrel daemoniac gibbous stygian shunned ululate iridescence abnormal."]
Faker::Books::Lovecraft.sentences(number: 2) #=> ["Antediluvian amorphous unmentionable singular accursed squamous immemorial.", "Gambrel daemoniac gibbous stygian shunned ululate iridescence abnormal."]

# Optional arguments: sentence_count=3, random_sentences_to_add=3
Faker::Books::Lovecraft.paragraph #=> "Squamous nameless daemoniac fungus ululate. Cyclopean stygian decadent loathsome manuscript tenebrous. Foetid abnormal stench. Dank non-euclidean comprehension eldritch. Charnel singular shunned lurk effulgence fungus."
Faker::Books::Lovecraft.paragraph(2) #=> "Decadent lurk tenebrous loathsome furtive spectral amorphous gibbous. Gambrel eldritch daemoniac cat madness comprehension stygian effulgence."
Faker::Books::Lovecraft.paragraph(2, 1) #=> "Stench cyclopean fainted antiquarian nameless. Antiquarian ululate tenebrous non-euclidean effulgence."
Faker::Books::Lovecraft.paragraph(sentence_count: 2) #=> "Decadent lurk tenebrous loathsome furtive spectral amorphous gibbous. Gambrel eldritch daemoniac cat madness comprehension stygian effulgence."
Faker::Books::Lovecraft.paragraph(sentence_count: 2, random_sentences_to_add: 1) #=> "Stench cyclopean fainted antiquarian nameless. Antiquarian ululate tenebrous non-euclidean effulgence."

# Optional arguments: paragraph_count=3
Faker::Books::Lovecraft.paragraphs #=> ["Noisome daemoniac gibbous abnormal antediluvian. Unutterable fungus accursed stench noisome lurk madness indescribable. Antiquarian fungus gibbering lurk dank fainted. Hideous loathsome manuscript daemoniac lurk charnel foetid.", "Non-euclidean immemorial indescribable accursed furtive. Dank unnamable cyclopean tenebrous stench immemorial. Eldritch abnormal gibbering tenebrous. Singular accursed lurk.", "Charnel antediluvian unnamable cat blasphemous comprehension tenebrous. Nameless accursed amorphous unnamable stench. Squamous unnamable mortal accursed manuscript spectral gambrel amorphous. Shunned stygian charnel unutterable. Tenebrous ululate lurk amorphous unnamable."]
Faker::Books::Lovecraft.paragraphs(2) #=> ["Hideous amorphous manuscript antediluvian non-euclidean cat eldritch foetid. Stench squamous manuscript amorphous gibbering fainted gibbous. Accursed loathsome blasphemous iridescence antediluvian abnormal ululate manuscript. Singular manuscript gibbering decadent accursed indescribable.", "Tenebrous unnamable comprehension antediluvian lurk. Lurk spectral noisome gibbering. Furtive manuscript madness tenebrous daemoniac."]
Faker::Books::Lovecraft.paragraphs(number: 2) #=> ["Hideous amorphous manuscript antediluvian non-euclidean cat eldritch foetid. Stench squamous manuscript amorphous gibbering fainted gibbous. Accursed loathsome blasphemous iridescence antediluvian abnormal ululate manuscript. Singular manuscript gibbering decadent accursed indescribable.", "Tenebrous unnamable comprehension antediluvian lurk. Lurk spectral noisome gibbering. Furtive manuscript madness tenebrous daemoniac."]

# Optional arguments: chars=3, supplemental=false
Faker::Books::Lovecraft.paragraph_by_chars #=> "Truffaut stumptown trust fund 8-bit messenger bag portland. Meh kombucha selvage swag biodiesel. Lomo kinfolk jean shorts asymmetrical diy. Wayfarers portland twee stumptown. Wes anderson biodiesel retro 90's pabst. Diy echo 90's mixtape semiotics. Cornho."
Faker::Books::Lovecraft.paragraph_by_chars(256) #=> "Hella kogi blog narwhal sartorial selfies mustache schlitz. Bespoke normcore kitsch cred hella fixie. Park aesthetic fixie migas twee. Cliche mustache brunch tumblr fixie godard. Drinking pop-up synth hoodie dreamcatcher typewriter. Kitsch biodiesel green."
Faker::Books::Lovecraft.paragraph_by_chars(characters: 256) #=> "Hella kogi blog narwhal sartorial selfies mustache schlitz. Bespoke normcore kitsch cred hella fixie. Park aesthetic fixie migas twee. Cliche mustache brunch tumblr fixie godard. Drinking pop-up synth hoodie dreamcatcher typewriter. Kitsch biodiesel green."
```
4 changes: 2 additions & 2 deletions doc/default/alphanumeric.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
It might be available in the next version.

```ruby
Faker::Alphanumeric.alpha 10 #=> "zlvubkrwga"
Faker::Alphanumeric.alpha(characters: 10) #=> "zlvubkrwga"

Faker::Alphanumeric.alphanumeric 10 #=> "3yfq2phxtb"
Faker::Alphanumeric.alphanumeric(characters: 10) #=> "3yfq2phxtb"
```
10 changes: 5 additions & 5 deletions doc/default/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
```ruby
Faker::Avatar.image #=> "https://robohash.org/sitsequiquia.png?size=300x300&set=set1"

Faker::Avatar.image("my-own-slug") #=> "https://robohash.org/my-own-slug.png?size=300x300&set=set1"
Faker::Avatar.image(slug: "my-own-slug") #=> "https://robohash.org/my-own-slug.png?size=300x300&set=set1"

Faker::Avatar.image("my-own-slug", "50x50") #=> "https://robohash.org/my-own-slug.png?size=50x50&set=set1"
Faker::Avatar.image(slug: "my-own-slug", size: "50x50") #=> "https://robohash.org/my-own-slug.png?size=50x50&set=set1"

Faker::Avatar.image("my-own-slug", "50x50", "jpg") #=> "https://robohash.org/my-own-slug.jpg?size=50x50&set=set1"
Faker::Avatar.image(slug: "my-own-slug", size: "50x50", format: "jpg") #=> "https://robohash.org/my-own-slug.jpg?size=50x50&set=set1"

Faker::Avatar.image("my-own-slug", "50x50", "bmp") #=> "https://robohash.org/my-own-slug.bmp?size=50x50&set=set1"
Faker::Avatar.image(slug: "my-own-slug", size: "50x50", format: "bmp") #=> "https://robohash.org/my-own-slug.bmp?size=50x50&set=set1"

Faker::Avatar.image("my-own-slug", "50x50", "bmp", "set1", "bg1") #=> "https://robohash.org/my-own-slug.bmp?size=50x50&set=set1&bgset=bg1"
Faker::Avatar.image(slug: "my-own-slug", size: "50x50", format: "bmp", set: "set1", bgset: "bg1") #=> "https://robohash.org/my-own-slug.bmp?size=50x50&set=set1&bgset=bg1"
```
6 changes: 2 additions & 4 deletions doc/default/bank.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@

Faker::Bank.account_number #=> 6738582379

Faker::Bank.account_number(13) #=> 673858237902
Faker::Bank.account_number(digits: 13) #=> 673858237902

Faker::Bank.iban #=> "GB76DZJM33188515981979"

# Optional argument bank_country_code
# All countries should be supported
Faker::Bank.iban("be") #=> "BE6375388567752043"
Faker::Bank.iban(country_code: "be") #=> "BE6375388567752043"

Faker::Bank.name #=> "ABN AMRO CORPORATE FINANCE LIMITED"

Faker::Bank.routing_number #=> "729343831"

Faker::Bank.routing_number(true) #=> "22-3833/64805"

Faker::Bank.swift_bic #=> "AAFMGB21"
```
2 changes: 1 addition & 1 deletion doc/default/boolean.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Available since version 1.6.2.
# Optional parameter: true_ratio=0.5
Faker::Boolean.boolean #=> true

Faker::Boolean.boolean(0.2) #=> false
Faker::Boolean.boolean(true_ratio: 0.2) #=> false
```
2 changes: 1 addition & 1 deletion doc/default/chile_rut.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Faker::ChileRut.full_rut #=> "30686957-4"
Faker::ChileRut.rut #=> 11235813

# Returns rut between passed minimum rut and 99999999
Faker::ChileRut.rut(20_890_156) #=> 31853211
Faker::ChileRut.rut(min_rut: 20_890_156) #=> 31853211

# Every call to rut or full_rut generates a new random rut, so last_rut and dv
# allows you to get the separated parts of the full rut without losing the already generated rut
Expand Down
2 changes: 1 addition & 1 deletion doc/default/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Faker::Code.rut #=> "91389184-8"

Faker::Code.nric #=> "S5589083H"

Faker::Code.nric(27, 34) #=> S8505970Z
Faker::Code.nric(min_age: 27, max_age: 34) #=> S8505970Z

Faker::Code.imei #= "546327785982623"

Expand Down
10 changes: 5 additions & 5 deletions doc/default/commerce.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ Faker::Commerce.color #=> "lavender"

# Optional arguments max=3, fixed_amount=false
Faker::Commerce.department #=> "Grocery, Health & Beauty"
Faker::Commerce.department(5) #=> "Grocery, Books, Health & Beauty"
Faker::Commerce.department(2, true) #=> "Books & Tools"
Faker::Commerce.department(max: 5) #=> "Grocery, Books, Health & Beauty"
Faker::Commerce.department(max: 2, fixed_amount: true) #=> "Books & Tools"

Faker::Commerce.material #=> "Steel"

Faker::Commerce.product_name #=> "Practical Granite Shirt"

# Produces a Float by default
Faker::Commerce.price #=> 44.6
Faker::Commerce.price(range = 0..10.0, as_string = true) #=> "2.18"
Faker::Commerce.price #=> 44.6
Faker::Commerce.price(range: 0..10.0, as_string: true) #=> "2.18"

# Generate a random promotion code.
# Optional argument digits = 6 for number of random digits in suffix
Faker::Commerce.promotion_code #=> "AmazingDeal829102"
Faker::Commerce.promotion_code(digits = 2) #=> "AmazingPrice57"
Faker::Commerce.promotion_code(digits: 2) #=> "AmazingPrice57"

Faker::Commerce.material #=> "Plastic"
```
6 changes: 3 additions & 3 deletions doc/default/date.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Faker::Date.between(2.days.ago, Date.today) #=> "Wed, 24 Sep 2014"
Faker::Date.between_except(1.year.ago, 1.year.from_now, Date.today) #=> "Wed, 24 Sep 2014"

# Random date in the future (up to maximum of N days)
Faker::Date.forward(23) # => "Fri, 03 Oct 2014"
Faker::Date.forward(days: 23) # => "Fri, 03 Oct 2014"

# Random date in the past (up to maximum of N days)
Faker::Date.backward(14) #=> "Fri, 19 Sep 2014"
Faker::Date.backward(days: 14) #=> "Fri, 19 Sep 2014"

# Random birthday date (maximum age between 18 and 65)
Faker::Date.birthday(18, 65) #=> "Mar, 28 Mar 1986"
Faker::Date.birthday(min_age: 18, max_age: 65) #=> "Mar, 28 Mar 1986"
```
2 changes: 1 addition & 1 deletion doc/default/demographic.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Faker::Demographic.sex #=> "Female"

Faker::Demographic.height #=> "1.61"

Faker::Demographic.height(:imperial) #=> "6 ft, 2 in"
Faker::Demographic.height(unit: :imperial) #=> "6 ft, 2 in"
```
14 changes: 7 additions & 7 deletions doc/default/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Faker::File.extension #=> "mp3"
Faker::File.mime_type #=> "application/pdf"

# Optional arguments: dir, name, extension, directory_separator
Faker::File.file_name('path/to') #=> "path/to/something_random.jpg"
Faker::File.file_name('foo/bar', 'baz') #=> "foo/bar/baz.zip"
Faker::File.file_name('foo/bar', 'baz', 'doc') #=> "foo/bar/baz.doc"
Faker::File.file_name('foo/bar', 'baz', 'mp3', '\\') #=> "foo\bar\baz.mp3"
Faker::File.file_name(dir: 'path/to') #=> "path/to/something_random.jpg"
Faker::File.file_name(dir: 'foo/bar', name: 'baz') #=> "foo/bar/baz.zip"
Faker::File.file_name(dir: 'foo/bar', name: 'baz', ext: 'doc') #=> "foo/bar/baz.doc"
Faker::File.file_name(dir: 'foo/bar', name: 'baz', ext: 'mp3', directory_separator: '\\') #=> "foo\bar\baz.mp3"

# Optional arguments: segment_count, root, directory_separator
Faker::File.dir #=> "path/to/something_random"
Faker::File.dir(2) #=> "foo/bar"
Faker::File.dir(3, '/') #=> "/foo/bar/baz"
Faker::File.dir(3, nil, '\\') #=> "foo\bar\baz"
Faker::File.dir(segment_count: 2) #=> "foo/bar"
Faker::File.dir(segment_count: 3, root: directory_separator: '/') #=> "/foo/bar/baz"
Faker::File.dir(segment_count: 3, root: nil, directory_separator: '\\') #=> "foo\bar\baz"
```
6 changes: 3 additions & 3 deletions doc/default/fillmurray.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Available since version 1.7.1.

```ruby
Faker::Fillmurray.image #=> "http://fillmurray.com/300/300"
Faker::Fillmurray.image #=> "http://www.fillmurray.com/300/300"

Faker::Fillmurray.image(true) #=> "http://fillmurray.com/g/300/300"
Faker::Fillmurray.image(grayscale: true) #=> "http://fillmurray.com/g/300/300"

Faker::Fillmurray.image(false, 200, 400) #=> "http://fillmurray.com/200/400"
Faker::Fillmurray.image(grayscale: false, width: 200, height: 400) #=> "http://fillmurray.com/200/400"
```
4 changes: 2 additions & 2 deletions doc/default/finance.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Faker::Finance.credit_card(:mastercard, :visa) #=> "4448-8934-1277-7195"

# Random vat_number
Faker::Finance.vat_number #=> "BR38.395.329/2471-83"
Faker::Finance.vat_number('DE') #=> "DE593306671"
Faker::Finance.vat_number('ZA') #=> "ZA79494416181"
Faker::Finance.vat_number(country: 'DE') #=> "DE593306671"
Faker::Finance.vat_number(country: 'ZA') #=> "ZA79494416181"
```
Loading