Skip to content

Commit

Permalink
Update Faker::Australia to Faker::Locations::Australia (#2869)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
11 people authored Mar 19, 2024
1 parent e89579a commit fcf41f1
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 164 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
- [Faker::TvShows::VentureBros](doc/tv_shows/venture_bros.md)
</details>

<details>
<summary>Locations</summary>

- [Faker::Locations::Australia](doc/locations/australia.md)
</details>

## Contributing

**Note**: We are not accepting proposals for new generators and locales. The [Contributing](CONTRIBUTING.md) guide has a few notes about this decision.
Expand Down
9 changes: 9 additions & 0 deletions doc/locations/australia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Faker::Locations::Australia

```ruby
Faker::Locations::Australia.location # => "Sydney"

Faker::Locations::Australia.animal # => "Kangaroo"

Faker::Locations::Australia.state # => "New South Wales"
```
81 changes: 43 additions & 38 deletions lib/faker/locations/australia.rb
Original file line number Diff line number Diff line change
@@ -1,47 +1,52 @@
# frozen_string_literal: true

module Faker
class Australia < Base
class << self
##
# Produces a location in Australia
#
# @return [String]
#
# @example
# Faker::Australia.location
# #=> "Sydney"
#
# @faker.version next
def location
fetch('australia.locations')
end
extend Deprecator

# Produces an Australian animal
#
# @return [String]
#
# @example
# Faker::Australia.animal
# #=> "Dingo"
#
# @faker.version next
def animal
fetch('australia.animals')
end
class Locations
class Australia < Base
class << self
##
# Produces a location in Australia
#
# @return [String]
#
# @example
# Faker::Locations::Australia.location
# #=> "Sydney"
#
# @faker.version next
def location
fetch('locations.australia.locations')
end

# Produces an Australian animal
#
# @return [String]
#
# @example
# Faker::Locations::Australia.animal
# #=> "Dingo"
#
# @faker.version next
def animal
fetch('locations.australia.animals')
end

# Produces an Australian State or Territory
#
# @return [String]
#
# @example
# Faker::Australia.state
# #=> "New South Wales"
#
# @faker.version next
def state
fetch('australia.states')
# Produces an Australian State or Territory
#
# @return [String]
#
# @example
# Faker::Locations::Australia.state
# #=> "New South Wales"
#
# @faker.version next
def state
fetch('locations.australia.states')
end
end
end
end
deprecate_generator('Australia', Locations::Australia)
end
211 changes: 106 additions & 105 deletions lib/locales/en/australia.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,108 @@
en:
faker:
australia:
locations:
- Brisbane
- Sydney
- Melbourne
- Perth
- Adelaide
- Gold Coast
- Newcastle
- Canberra
- Central Coast
- Sunshine Coast
- Wollongong
- Geelong
- Hobart
- Townsville
- Cairns
- Toowoomba
- Darwin
- Ballarat
- Bendigo
- Albury
- Launceston
- Mackay
- Rockhampton
- Bunbury
- Coffs Harbour
- Bundaberg
- Melton
- Wagga Wagga
- Hervey Bay
- Mildura – Wentworth
- Shepparton – Mooroopna
- Port Macquarie
- Gladstone – Tannum Sands
- Tamworth
- Traralgon – Morwell
- Orange
- Bowral – Mittagong
- Busselton
- Geraldton
- Dubbo
- Nowra – Bomaderry
- Warragul – Drouin
- Bathurst
- Warrnambool
- Albany
- Kalgoorlie
- Devonport
- Mount Gambier
- Lismore
- Nelson Bay
animals:
- Koala
- Humpback Whale
- Australian Fur Seal
- Wallaby
- Platypus
- Kangaroo
- Wombat
- Sugar Glider
- Flying Fox
- Tasmanian Devil
- Quokka
- Dugong
- Luaner
- Echidna
- Magpie
- Cockatoo
- Tawny Frogmouth
- Galah
- Lorikeet
- Pelican
- Cassowary
- Kookaburra
- Emu
- Lyrebird
- Barramundi
- Grouper
- Murray Cod
- Green Tree Frog
- Cane Toad
- Redback Spider
- Funnel Web Spider
- Blue Ringed Octopus
- Fresh Water Crocodile
- Skink
- Thorny Devil
- King Brown Snake
- Carpet Python
- Tiger Snake
- Red Bellied Black Snake
- Blue Tongue Lizard
- Frilled Neck Lizard
- Saltwater Crocodile
- Eastern Brown Snake
states:
- New South Wales
- Queensland
- Western Australia
- Northern Territory
- South Australia
- Australian Capital Territory
- Victoria
- Tasmania
locations:
australia:
locations:
- Brisbane
- Sydney
- Melbourne
- Perth
- Adelaide
- Gold Coast
- Newcastle
- Canberra
- Central Coast
- Sunshine Coast
- Wollongong
- Geelong
- Hobart
- Townsville
- Cairns
- Toowoomba
- Darwin
- Ballarat
- Bendigo
- Albury
- Launceston
- Mackay
- Rockhampton
- Bunbury
- Coffs Harbour
- Bundaberg
- Melton
- Wagga Wagga
- Hervey Bay
- Mildura – Wentworth
- Shepparton – Mooroopna
- Port Macquarie
- Gladstone – Tannum Sands
- Tamworth
- Traralgon – Morwell
- Orange
- Bowral – Mittagong
- Busselton
- Geraldton
- Dubbo
- Nowra – Bomaderry
- Warragul – Drouin
- Bathurst
- Warrnambool
- Albany
- Kalgoorlie
- Devonport
- Mount Gambier
- Lismore
- Nelson Bay
animals:
- Koala
- Humpback Whale
- Australian Fur Seal
- Wallaby
- Platypus
- Kangaroo
- Wombat
- Sugar Glider
- Flying Fox
- Tasmanian Devil
- Quokka
- Dugong
- Luaner
- Echidna
- Magpie
- Cockatoo
- Tawny Frogmouth
- Galah
- Lorikeet
- Pelican
- Cassowary
- Kookaburra
- Emu
- Lyrebird
- Barramundi
- Grouper
- Murray Cod
- Green Tree Frog
- Cane Toad
- Redback Spider
- Funnel Web Spider
- Blue Ringed Octopus
- Fresh Water Crocodile
- Skink
- Thorny Devil
- King Brown Snake
- Carpet Python
- Tiger Snake
- Red Bellied Black Snake
- Blue Tongue Lizard
- Frilled Neck Lizard
- Saltwater Crocodile
- Eastern Brown Snake
states:
- New South Wales
- Queensland
- Western Australia
- Northern Territory
- South Australia
- Australian Capital Territory
- Victoria
- Tasmania
21 changes: 0 additions & 21 deletions test/faker/location/test_faker_australia.rb

This file was deleted.

31 changes: 31 additions & 0 deletions test/faker/locations/test_faker_australia.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerLocationsAustralia < Test::Unit::TestCase
def test_location
assert_match(/\w+/, Faker::Locations::Australia.location)
end

def test_animal
assert_match(/\w+/, Faker::Locations::Australia.animal)
end

def test_state
assert_match(/\w+/, Faker::Locations::Australia.state)
end
end

class TestFakerAustralia < Test::Unit::TestCase
def test_deprecated_location
assert_match(/\w+/, Faker::Australia.location)
end

def test_deprecated_animal
assert_match(/\w+/, Faker::Australia.animal)
end

def test_state
assert_match(/\w+/, Faker::Australia.state)
end
end
1 change: 1 addition & 0 deletions test/test_determinism.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def skipped_classes
Internet
JapaneseMedia
LeagueOfLegends
Locations
Movies
Myst
Overwatch
Expand Down

0 comments on commit fcf41f1

Please sign in to comment.