Skip to content

Commit 6dc25bd

Browse files
Merge branch 'main' into sb-deprecate-twitter-generator
2 parents 82def71 + 94adefd commit 6dc25bd

34 files changed

+1854
-233
lines changed

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ source 'https://rubygems.org'
66
gemspec
77

88
gem 'benchmark'
9-
gem 'minitest', '5.25.5'
9+
gem 'minitest', '5.26.1'
1010
gem 'pry', '0.15.2'
1111
gem 'rake', '13.3.1'
12-
gem 'rubocop', '1.75.4'
13-
gem 'rubocop-minitest', '0.38.1'
12+
gem 'rubocop', '1.81.7'
13+
gem 'rubocop-minitest', '0.38.2'
1414
gem 'rubocop-rake', '0.7.1'
1515
gem 'simplecov', '0.22.0'
16-
gem 'test-unit', '3.7.0'
16+
gem 'test-unit', '3.7.1'
1717
gem 'timecop', '0.9.10'
1818
gem 'yard', '0.9.37'

Gemfile.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,39 @@ GEM
1414
docile (1.4.1)
1515
i18n (1.14.7)
1616
concurrent-ruby (~> 1.0)
17-
json (2.12.2)
17+
json (2.16.0)
1818
language_server-protocol (3.17.0.5)
1919
lint_roller (1.1.0)
2020
method_source (1.1.0)
21-
minitest (5.25.5)
21+
minitest (5.26.1)
2222
parallel (1.27.0)
23-
parser (3.3.8.0)
23+
parser (3.3.10.0)
2424
ast (~> 2.4.1)
2525
racc
26-
power_assert (2.0.5)
27-
prism (1.4.0)
26+
power_assert (3.0.1)
27+
prism (1.6.0)
2828
pry (0.15.2)
2929
coderay (~> 1.1)
3030
method_source (~> 1.0)
3131
racc (1.8.1)
3232
rainbow (3.1.1)
3333
rake (13.3.1)
34-
regexp_parser (2.10.0)
35-
rubocop (1.75.4)
34+
regexp_parser (2.11.3)
35+
rubocop (1.81.7)
3636
json (~> 2.3)
3737
language_server-protocol (~> 3.17.0.2)
3838
lint_roller (~> 1.1.0)
3939
parallel (~> 1.10)
4040
parser (>= 3.3.0.2)
4141
rainbow (>= 2.2.2, < 4.0)
4242
regexp_parser (>= 2.9.3, < 3.0)
43-
rubocop-ast (>= 1.44.0, < 2.0)
43+
rubocop-ast (>= 1.47.1, < 2.0)
4444
ruby-progressbar (~> 1.7)
4545
unicode-display_width (>= 2.4.0, < 4.0)
46-
rubocop-ast (1.45.1)
46+
rubocop-ast (1.48.0)
4747
parser (>= 3.3.7.2)
4848
prism (~> 1.4)
49-
rubocop-minitest (0.38.1)
49+
rubocop-minitest (0.38.2)
5050
lint_roller (~> 1.1)
5151
rubocop (>= 1.75.0, < 2.0)
5252
rubocop-ast (>= 1.38.0, < 2.0)
@@ -58,14 +58,14 @@ GEM
5858
docile (~> 1.1)
5959
simplecov-html (~> 0.11)
6060
simplecov_json_formatter (~> 0.1)
61-
simplecov-html (0.13.1)
61+
simplecov-html (0.13.2)
6262
simplecov_json_formatter (0.1.4)
63-
test-unit (3.7.0)
63+
test-unit (3.7.1)
6464
power_assert
6565
timecop (0.9.10)
66-
unicode-display_width (3.1.4)
67-
unicode-emoji (~> 4.0, >= 4.0.4)
68-
unicode-emoji (4.0.4)
66+
unicode-display_width (3.2.0)
67+
unicode-emoji (~> 4.1)
68+
unicode-emoji (4.1.0)
6969
yard (0.9.37)
7070

7171
PLATFORMS
@@ -75,14 +75,14 @@ PLATFORMS
7575
DEPENDENCIES
7676
benchmark
7777
faker!
78-
minitest (= 5.25.5)
78+
minitest (= 5.26.1)
7979
pry (= 0.15.2)
8080
rake (= 13.3.1)
81-
rubocop (= 1.75.4)
82-
rubocop-minitest (= 0.38.1)
81+
rubocop (= 1.81.7)
82+
rubocop-minitest (= 0.38.2)
8383
rubocop-rake (= 0.7.1)
8484
simplecov (= 0.22.0)
85-
test-unit (= 3.7.0)
85+
test-unit (= 3.7.1)
8686
timecop (= 0.9.10)
8787
yard (= 0.9.37)
8888

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
215215
- [Faker::Beer](doc/default/beer.md)
216216
- [Faker::Blood](doc/default/blood.md)
217217
- [Faker::Boolean](doc/default/boolean.md)
218-
- [Faker::BossaNova](doc/default/bossa_nova.md)
219218
- [Faker::Business](doc/default/business.md)
220219
- [Faker::Camera](doc/default/camera.md)
221220
- [Faker::Cannabis](doc/default/cannabis.md)
@@ -421,6 +420,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
421420
- [Faker::Music::Rush](doc/music/rush.md)
422421
- [Faker::Music::SmashingPumpkins](doc/music/smashing_pumpkins.md)
423422
- [Faker::Music::UmphreysMcgee](doc/music/umphreys_mcgee.md)
423+
- [Faker::Music::BossaNova](doc/music/bossa_nova.md)
424424
</details>
425425

426426
<details>

doc/default/bossa_nova.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

doc/default/id_number.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,24 @@ Faker::IdNumber.danish_id_number(gender: :female) #=> "050390-9980"
5050
# Generate a valid French Social Security number (INSEE number)
5151
Faker::IdNumber.french_insee_number #=> "22510589696868"
5252
```
53+
54+
## ID Number and Locales
55+
56+
Besides the default ID numbers, faker supports localized `.valid` and `.invalid` values:
57+
58+
```ruby
59+
Faker::Config.locale = 'fr-FR'
60+
Faker::IdNumber.valid #=> "22510589696868"
61+
```
62+
63+
Locales with specific intricacies are as such:
64+
65+
### en-GB
66+
67+
When the locale is set to British English, unformatted [National Insurance](https://www.gov.uk/national-insurance/your-national-insurance-number) numbers are generated:
68+
69+
```ruby
70+
Faker::Config.locale = 'en-GB'
71+
Faker::IdNumber.valid #=> "AJ405924A"
72+
Faker::IdNumber.invalid #=> "BG316764W"
73+

doc/music/bossa_nova.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Faker::Music::BossaNova
2+
3+
```ruby
4+
Faker::Music::BossaNova.artist #=> "Tom Jobim"
5+
6+
Faker::Music::BossaNova.song #=> "Chega de Saudade"
7+
```

lib/faker/books/lovecraft.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def paragraph_by_chars(characters: 256)
240240

241241
paragraph += " #{paragraph(sentence_count: 3)}" while paragraph.length < characters
242242

243-
"#{paragraph[0...characters - 1]}."
243+
"#{paragraph[0...(characters - 1)]}."
244244
end
245245
end
246246
end

lib/faker/default/boolean.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class << self
1515
# Faker::Boolean.boolean(true_ratio: 0.2) #=> false
1616
#
1717
# @faker.version 1.6.2
18-
def boolean(true_ratio: 0.5)
18+
#
19+
def boolean(true_ratio: 0.5) # rubocop:disable Naming/PredicateMethod
1920
(rand < true_ratio)
2021
end
2122
end

lib/faker/default/bossa_nova.rb

Lines changed: 0 additions & 33 deletions
This file was deleted.

lib/faker/default/company.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def collect_regon_sum(array)
591591

592592
def weight_sum(array, weights)
593593
sum = 0
594-
(0..weights.size - 1).each do |index|
594+
(0..(weights.size - 1)).each do |index|
595595
sum += (array[index] * weights[index])
596596
end
597597
sum

0 commit comments

Comments
 (0)