-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Update Faker::Australia to Faker::Locations::Australia #2869
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
Merged
stefannibrasil
merged 22 commits into
faker-ruby:main
from
keshavbiswa:keshav/update-australia-to-locations-australia
Mar 19, 2024
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
382e49b
update Faker::Australia to Faker::Locations::Australia
keshavbiswa c54a349
Merge branch 'main' into keshav/update-australia-to-locations-australia
keshavbiswa d095a7c
Bump minitest from 5.21.1 to 5.21.2 (#2894)
dependabot[bot] 18f4d3d
Bump rubocop from 1.59.0 to 1.60.2 (#2896)
dependabot[bot] 9e004ca
Add Kenya to supported countries (#2871)
AndrewNduati d0aef26
Bump minitest from 5.21.2 to 5.22.2 (#2902)
dependabot[bot] d62b619
Bump test-unit from 3.6.1 to 3.6.2 (#2906)
dependabot[bot] dea4fd7
Refactor `Faker::IDNumber` to `Faker::IdNumber` to be more consistent…
Jamal-A-Mohamed 964a223
Fix/Deprecate FmaBrotherhood Generator (#2856)
08801ce
Bump i18n from 1.14.1 to 1.14.4 (#2913)
dependabot[bot] ebd93ab
Remove duplicates in doc file (#2914)
mmarusyk b03b2cc
Bump rubocop from 1.60.2 to 1.62.1 (#2916)
dependabot[bot] 7f05e48
Bump yard from 0.9.34 to 0.9.36 (#2909)
dependabot[bot] 8cb3f4f
Deprecated Faker::Australia
keshavbiswa bdc58b2
Merge branch 'main' into keshav/update-australia-to-locations-australia
keshavbiswa 783b8a9
Added Docs for Australia
keshavbiswa 7df8a08
Updated Readme to include Locations
keshavbiswa 69d845f
Merge branch 'main' into keshav/update-australia-to-locations-australia
keshavbiswa 9d69731
Updated locales path for australia
keshavbiswa 865bddf
updated test to differentiate deprecated methods
keshavbiswa 2c9ab80
Merge branch 'main' into keshav/update-australia-to-locations-australia
keshavbiswa 391399c
Removed whitespaces from australia.yml
keshavbiswa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
keshavbiswa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,7 @@ def skipped_classes | |
Internet | ||
JapaneseMedia | ||
LeagueOfLegends | ||
Locations | ||
Movies | ||
Myst | ||
Overwatch | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.