Skip to content

Commit fcf41f1

Browse files
keshavbiswadependabot[bot]AndrewNduatiJamal-A-MohamedThe-ends-of-invention
authored
Update Faker::Australia to Faker::Locations::Australia (#2869)
* update Faker::Australia to Faker::Locations::Australia * Bump minitest from 5.21.1 to 5.21.2 (#2894) Bumps [minitest](https://github.com/minitest/minitest) from 5.21.1 to 5.21.2. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](minitest/minitest@v5.21.1...v5.21.2) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rubocop from 1.59.0 to 1.60.2 (#2896) Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.59.0 to 1.60.2. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](rubocop/rubocop@v1.59.0...v1.60.2) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add Kenya to supported countries (#2871) * Add Kenya to supported countries * Add tests for locale * clan up pull request * Add landline telephone numbers and cell phone formats * Bump minitest from 5.21.2 to 5.22.2 (#2902) Bumps [minitest](https://github.com/minitest/minitest) from 5.21.2 to 5.22.2. - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](minitest/minitest@v5.21.2...v5.22.2) --- updated-dependencies: - dependency-name: minitest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump test-unit from 3.6.1 to 3.6.2 (#2906) Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.6.1 to 3.6.2. - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](test-unit/test-unit@3.6.1...3.6.2) --- updated-dependencies: - dependency-name: test-unit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Refactor `Faker::IDNumber` to `Faker::IdNumber` to be more consistent with other generator's naming convention. (#2858) * Deprecate IDNumber to IdNumber per issue#2787 * wip * Add a Faker::Deprecator module Co-authored-by: Thiago Araujo <[email protected]> * Add more specs and improve warning message --------- Co-authored-by: jamal.mohamed <[email protected]> Co-authored-by: Stefanni Brasil <[email protected]> Co-authored-by: Thiago Araujo <[email protected]> * Fix/Deprecate FmaBrotherhood Generator (#2856) * Favor 'The Room' instead of 'Room' This commit will rename instances of room to the_room including the locales. Originally the `room.md` had a typo that referenced ::Room and not ::TheRoom which is also fixed here. Ref: - #2787 Co-authored-by: Jamal-A-Mohamed <[email protected]> Co-authored-by: Salvador <[email protected]> * Fix/Deprecate FmaBrotherhood Generator This commit fixes the naming discrpencies with the FmaBrotherhood (now FullmetalAlchemistBrotherhood) class and its filename. This adds deprecation warnings for the old FmaBrotherhood class and also makes the new FullmetalAlchemistBrotherhood class. Fix: - #2853 * Refactor deprecation for `FmaBrotherhood` This commit will refactor the changes from `FmaBrotherhood` to `FullmetalAlchemistBrotherhood` and use `Faker::Deprecator`. --------- Co-authored-by: Jamal-A-Mohamed <[email protected]> Co-authored-by: Salvador <[email protected]> Co-authored-by: Stefanni Brasil <[email protected]> * Bump i18n from 1.14.1 to 1.14.4 (#2913) Bumps [i18n](https://github.com/ruby-i18n/i18n) from 1.14.1 to 1.14.4. - [Release notes](https://github.com/ruby-i18n/i18n/releases) - [Changelog](https://github.com/ruby-i18n/i18n/blob/master/CHANGELOG.md) - [Commits](ruby-i18n/i18n@v1.14.1...v1.14.4) --- updated-dependencies: - dependency-name: i18n dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Remove duplicates in doc file (#2914) * Bump rubocop from 1.60.2 to 1.62.1 (#2916) Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.60.2 to 1.62.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](rubocop/rubocop@v1.60.2...v1.62.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump yard from 0.9.34 to 0.9.36 (#2909) Bumps [yard](https://github.com/lsegal/yard) from 0.9.34 to 0.9.36. - [Release notes](https://github.com/lsegal/yard/releases) - [Changelog](https://github.com/lsegal/yard/blob/main/CHANGELOG.md) - [Commits](lsegal/yard@v0.9.34...v0.9.36) --- updated-dependencies: - dependency-name: yard dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Deprecated Faker::Australia * Added Docs for Australia * Updated Readme to include Locations * Updated locales path for australia * updated test to differentiate deprecated methods * Removed whitespaces from australia.yml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Nduati <[email protected]> Co-authored-by: Jamal-A-Mohamed <[email protected]> Co-authored-by: jamal.mohamed <[email protected]> Co-authored-by: Stefanni Brasil <[email protected]> Co-authored-by: Thiago Araujo <[email protected]> Co-authored-by: Kirk Wang <[email protected]> Co-authored-by: Jamal-A-Mohamed <[email protected]> Co-authored-by: Salvador <[email protected]> Co-authored-by: Michael Marusyk <[email protected]>
1 parent e89579a commit fcf41f1

File tree

7 files changed

+196
-164
lines changed

7 files changed

+196
-164
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,12 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
477477
- [Faker::TvShows::VentureBros](doc/tv_shows/venture_bros.md)
478478
</details>
479479

480+
<details>
481+
<summary>Locations</summary>
482+
483+
- [Faker::Locations::Australia](doc/locations/australia.md)
484+
</details>
485+
480486
## Contributing
481487

482488
**Note**: We are not accepting proposals for new generators and locales. The [Contributing](CONTRIBUTING.md) guide has a few notes about this decision.

doc/locations/australia.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Faker::Locations::Australia
2+
3+
```ruby
4+
Faker::Locations::Australia.location # => "Sydney"
5+
6+
Faker::Locations::Australia.animal # => "Kangaroo"
7+
8+
Faker::Locations::Australia.state # => "New South Wales"
9+
```

lib/faker/locations/australia.rb

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,52 @@
11
# frozen_string_literal: true
22

33
module Faker
4-
class Australia < Base
5-
class << self
6-
##
7-
# Produces a location in Australia
8-
#
9-
# @return [String]
10-
#
11-
# @example
12-
# Faker::Australia.location
13-
# #=> "Sydney"
14-
#
15-
# @faker.version next
16-
def location
17-
fetch('australia.locations')
18-
end
4+
extend Deprecator
195

20-
# Produces an Australian animal
21-
#
22-
# @return [String]
23-
#
24-
# @example
25-
# Faker::Australia.animal
26-
# #=> "Dingo"
27-
#
28-
# @faker.version next
29-
def animal
30-
fetch('australia.animals')
31-
end
6+
class Locations
7+
class Australia < Base
8+
class << self
9+
##
10+
# Produces a location in Australia
11+
#
12+
# @return [String]
13+
#
14+
# @example
15+
# Faker::Locations::Australia.location
16+
# #=> "Sydney"
17+
#
18+
# @faker.version next
19+
def location
20+
fetch('locations.australia.locations')
21+
end
22+
23+
# Produces an Australian animal
24+
#
25+
# @return [String]
26+
#
27+
# @example
28+
# Faker::Locations::Australia.animal
29+
# #=> "Dingo"
30+
#
31+
# @faker.version next
32+
def animal
33+
fetch('locations.australia.animals')
34+
end
3235

33-
# Produces an Australian State or Territory
34-
#
35-
# @return [String]
36-
#
37-
# @example
38-
# Faker::Australia.state
39-
# #=> "New South Wales"
40-
#
41-
# @faker.version next
42-
def state
43-
fetch('australia.states')
36+
# Produces an Australian State or Territory
37+
#
38+
# @return [String]
39+
#
40+
# @example
41+
# Faker::Locations::Australia.state
42+
# #=> "New South Wales"
43+
#
44+
# @faker.version next
45+
def state
46+
fetch('locations.australia.states')
47+
end
4448
end
4549
end
4650
end
51+
deprecate_generator('Australia', Locations::Australia)
4752
end

lib/locales/en/australia.yml

Lines changed: 106 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,108 @@
11
en:
22
faker:
3-
australia:
4-
locations:
5-
- Brisbane
6-
- Sydney
7-
- Melbourne
8-
- Perth
9-
- Adelaide
10-
- Gold Coast
11-
- Newcastle
12-
- Canberra
13-
- Central Coast
14-
- Sunshine Coast
15-
- Wollongong
16-
- Geelong
17-
- Hobart
18-
- Townsville
19-
- Cairns
20-
- Toowoomba
21-
- Darwin
22-
- Ballarat
23-
- Bendigo
24-
- Albury
25-
- Launceston
26-
- Mackay
27-
- Rockhampton
28-
- Bunbury
29-
- Coffs Harbour
30-
- Bundaberg
31-
- Melton
32-
- Wagga Wagga
33-
- Hervey Bay
34-
- Mildura – Wentworth
35-
- Shepparton – Mooroopna
36-
- Port Macquarie
37-
- Gladstone – Tannum Sands
38-
- Tamworth
39-
- Traralgon – Morwell
40-
- Orange
41-
- Bowral – Mittagong
42-
- Busselton
43-
- Geraldton
44-
- Dubbo
45-
- Nowra – Bomaderry
46-
- Warragul – Drouin
47-
- Bathurst
48-
- Warrnambool
49-
- Albany
50-
- Kalgoorlie
51-
- Devonport
52-
- Mount Gambier
53-
- Lismore
54-
- Nelson Bay
55-
animals:
56-
- Koala
57-
- Humpback Whale
58-
- Australian Fur Seal
59-
- Wallaby
60-
- Platypus
61-
- Kangaroo
62-
- Wombat
63-
- Sugar Glider
64-
- Flying Fox
65-
- Tasmanian Devil
66-
- Quokka
67-
- Dugong
68-
- Luaner
69-
- Echidna
70-
- Magpie
71-
- Cockatoo
72-
- Tawny Frogmouth
73-
- Galah
74-
- Lorikeet
75-
- Pelican
76-
- Cassowary
77-
- Kookaburra
78-
- Emu
79-
- Lyrebird
80-
- Barramundi
81-
- Grouper
82-
- Murray Cod
83-
- Green Tree Frog
84-
- Cane Toad
85-
- Redback Spider
86-
- Funnel Web Spider
87-
- Blue Ringed Octopus
88-
- Fresh Water Crocodile
89-
- Skink
90-
- Thorny Devil
91-
- King Brown Snake
92-
- Carpet Python
93-
- Tiger Snake
94-
- Red Bellied Black Snake
95-
- Blue Tongue Lizard
96-
- Frilled Neck Lizard
97-
- Saltwater Crocodile
98-
- Eastern Brown Snake
99-
states:
100-
- New South Wales
101-
- Queensland
102-
- Western Australia
103-
- Northern Territory
104-
- South Australia
105-
- Australian Capital Territory
106-
- Victoria
107-
- Tasmania
3+
locations:
4+
australia:
5+
locations:
6+
- Brisbane
7+
- Sydney
8+
- Melbourne
9+
- Perth
10+
- Adelaide
11+
- Gold Coast
12+
- Newcastle
13+
- Canberra
14+
- Central Coast
15+
- Sunshine Coast
16+
- Wollongong
17+
- Geelong
18+
- Hobart
19+
- Townsville
20+
- Cairns
21+
- Toowoomba
22+
- Darwin
23+
- Ballarat
24+
- Bendigo
25+
- Albury
26+
- Launceston
27+
- Mackay
28+
- Rockhampton
29+
- Bunbury
30+
- Coffs Harbour
31+
- Bundaberg
32+
- Melton
33+
- Wagga Wagga
34+
- Hervey Bay
35+
- Mildura – Wentworth
36+
- Shepparton – Mooroopna
37+
- Port Macquarie
38+
- Gladstone – Tannum Sands
39+
- Tamworth
40+
- Traralgon – Morwell
41+
- Orange
42+
- Bowral – Mittagong
43+
- Busselton
44+
- Geraldton
45+
- Dubbo
46+
- Nowra – Bomaderry
47+
- Warragul – Drouin
48+
- Bathurst
49+
- Warrnambool
50+
- Albany
51+
- Kalgoorlie
52+
- Devonport
53+
- Mount Gambier
54+
- Lismore
55+
- Nelson Bay
56+
animals:
57+
- Koala
58+
- Humpback Whale
59+
- Australian Fur Seal
60+
- Wallaby
61+
- Platypus
62+
- Kangaroo
63+
- Wombat
64+
- Sugar Glider
65+
- Flying Fox
66+
- Tasmanian Devil
67+
- Quokka
68+
- Dugong
69+
- Luaner
70+
- Echidna
71+
- Magpie
72+
- Cockatoo
73+
- Tawny Frogmouth
74+
- Galah
75+
- Lorikeet
76+
- Pelican
77+
- Cassowary
78+
- Kookaburra
79+
- Emu
80+
- Lyrebird
81+
- Barramundi
82+
- Grouper
83+
- Murray Cod
84+
- Green Tree Frog
85+
- Cane Toad
86+
- Redback Spider
87+
- Funnel Web Spider
88+
- Blue Ringed Octopus
89+
- Fresh Water Crocodile
90+
- Skink
91+
- Thorny Devil
92+
- King Brown Snake
93+
- Carpet Python
94+
- Tiger Snake
95+
- Red Bellied Black Snake
96+
- Blue Tongue Lizard
97+
- Frilled Neck Lizard
98+
- Saltwater Crocodile
99+
- Eastern Brown Snake
100+
states:
101+
- New South Wales
102+
- Queensland
103+
- Western Australia
104+
- Northern Territory
105+
- South Australia
106+
- Australian Capital Territory
107+
- Victoria
108+
- Tasmania

test/faker/location/test_faker_australia.rb

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# frozen_string_literal: true
2+
3+
require_relative '../../test_helper'
4+
5+
class TestFakerLocationsAustralia < Test::Unit::TestCase
6+
def test_location
7+
assert_match(/\w+/, Faker::Locations::Australia.location)
8+
end
9+
10+
def test_animal
11+
assert_match(/\w+/, Faker::Locations::Australia.animal)
12+
end
13+
14+
def test_state
15+
assert_match(/\w+/, Faker::Locations::Australia.state)
16+
end
17+
end
18+
19+
class TestFakerAustralia < Test::Unit::TestCase
20+
def test_deprecated_location
21+
assert_match(/\w+/, Faker::Australia.location)
22+
end
23+
24+
def test_deprecated_animal
25+
assert_match(/\w+/, Faker::Australia.animal)
26+
end
27+
28+
def test_state
29+
assert_match(/\w+/, Faker::Australia.state)
30+
end
31+
end

test/test_determinism.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def skipped_classes
102102
Internet
103103
JapaneseMedia
104104
LeagueOfLegends
105+
Locations
105106
Movies
106107
Myst
107108
Overwatch

0 commit comments

Comments
 (0)