From 826c0fc6857e0d1c38e7890646d482f8feed94e8 Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Wed, 20 Jan 2021 22:41:44 +1100 Subject: [PATCH 01/10] Add initial test --- test/faker/location/test_faker_australia.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/faker/location/test_faker_australia.rb diff --git a/test/faker/location/test_faker_australia.rb b/test/faker/location/test_faker_australia.rb new file mode 100644 index 0000000000..1b15c1ba10 --- /dev/null +++ b/test/faker/location/test_faker_australia.rb @@ -0,0 +1,11 @@ +require_relative '../../test_helper' + +class TestFakerAustralia < Test::Unit::TestCase + def setup + @tester = Faker::Australia + end + + def test_location + assert @tester.location.match(/\w+/) + end +end \ No newline at end of file From ca2dc4fd5b7d7f4ded7991ea29d11a6a6b0b993c Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Wed, 20 Jan 2021 22:57:00 +1100 Subject: [PATCH 02/10] Add Australia class and first method locations --- lib/faker/location/australia.rb | 21 +++++++++++++++++++++ test/faker/location/test_faker_australia.rb | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 lib/faker/location/australia.rb diff --git a/lib/faker/location/australia.rb b/lib/faker/location/australia.rb new file mode 100644 index 0000000000..438599c8e2 --- /dev/null +++ b/lib/faker/location/australia.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Faker + class Australia < Base + class << self + ## + # Produces a location in Australia + # + # @return [String] + # + # @example + # Faker::Fantasy::Australia.location + # #=> "Sydney" + # + # @faker.version next + def location + fetch('australia.locations') + end + end + end +end diff --git a/test/faker/location/test_faker_australia.rb b/test/faker/location/test_faker_australia.rb index 1b15c1ba10..0091de168f 100644 --- a/test/faker/location/test_faker_australia.rb +++ b/test/faker/location/test_faker_australia.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative '../../test_helper' class TestFakerAustralia < Test::Unit::TestCase @@ -8,4 +10,4 @@ def setup def test_location assert @tester.location.match(/\w+/) end -end \ No newline at end of file +end From 5c4fff5551d4507705e0fcada1aea1bc306f966b Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Wed, 20 Jan 2021 23:08:11 +1100 Subject: [PATCH 03/10] Add 50 australian locations --- lib/locales/en/australia.yml | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 lib/locales/en/australia.yml diff --git a/lib/locales/en/australia.yml b/lib/locales/en/australia.yml new file mode 100644 index 0000000000..fbcf41a9e7 --- /dev/null +++ b/lib/locales/en/australia.yml @@ -0,0 +1,56 @@ +en: + faker: + australia: + locations: + - Sydney + - Brisbane + - Sydney + - Melbour + - Brisbane + - Perth + - Adelaide + - Gold Coast + - Newcastle + - Canberra + - Central Coast + - Sunshine Coast + - Wollongong + - Geelong + - Hobart + - Townsville + - Cairns + - Toowoomba + - Darwin + - Ballara + - 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 – Boulder + - Devonport + - Mount Gambier + - Lismore + - Nelson Bay \ No newline at end of file From 8163cd152a95213d0057cbba14be670a84601e1b Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Fri, 22 Jan 2021 17:30:52 +1100 Subject: [PATCH 04/10] Add Australian animals --- lib/faker/location/australia.rb | 15 +++++-- lib/locales/en/australia.yml | 46 ++++++++++++++++++++- test/faker/location/test_faker_australia.rb | 4 ++ 3 files changed, 61 insertions(+), 4 deletions(-) diff --git a/lib/faker/location/australia.rb b/lib/faker/location/australia.rb index 438599c8e2..27706c1051 100644 --- a/lib/faker/location/australia.rb +++ b/lib/faker/location/australia.rb @@ -9,13 +9,22 @@ class << self # @return [String] # # @example - # Faker::Fantasy::Australia.location + # Faker::Australia.location # #=> "Sydney" - # - # @faker.version next def location fetch('australia.locations') end + # Produces an Australian animal + # + # @return [String] + # + # @example + # Faker::Australia.animal + # #=> "Dingo" + + def animal + fetch('australia.animals') + end end end end diff --git a/lib/locales/en/australia.yml b/lib/locales/en/australia.yml index fbcf41a9e7..91e941462c 100644 --- a/lib/locales/en/australia.yml +++ b/lib/locales/en/australia.yml @@ -53,4 +53,48 @@ en: - Devonport - Mount Gambier - Lismore - - Nelson Bay \ No newline at end of file + - 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 diff --git a/test/faker/location/test_faker_australia.rb b/test/faker/location/test_faker_australia.rb index 0091de168f..4cc4642430 100644 --- a/test/faker/location/test_faker_australia.rb +++ b/test/faker/location/test_faker_australia.rb @@ -10,4 +10,8 @@ def setup def test_location assert @tester.location.match(/\w+/) end + + def test_animal + assert @tester.animal.match(/\w+/) + end end From 1cc8d8184efa5a7a3ece34bf291f82cca7e6009e Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Fri, 22 Jan 2021 17:32:07 +1100 Subject: [PATCH 05/10] Rename folder --- lib/faker/{location => locations}/australia.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/faker/{location => locations}/australia.rb (100%) diff --git a/lib/faker/location/australia.rb b/lib/faker/locations/australia.rb similarity index 100% rename from lib/faker/location/australia.rb rename to lib/faker/locations/australia.rb From a78f8aa3d893d38b2b243def40573c92dacb7a00 Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Fri, 22 Jan 2021 17:37:53 +1100 Subject: [PATCH 06/10] Add Australian States --- lib/faker/locations/australia.rb | 13 ++++++++++++- lib/locales/en/australia.yml | 9 +++++++++ test/faker/location/test_faker_australia.rb | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/faker/locations/australia.rb b/lib/faker/locations/australia.rb index 27706c1051..1e9829a584 100644 --- a/lib/faker/locations/australia.rb +++ b/lib/faker/locations/australia.rb @@ -14,6 +14,7 @@ class << self def location fetch('australia.locations') end + # Produces an Australian animal # # @return [String] @@ -21,10 +22,20 @@ def location # @example # Faker::Australia.animal # #=> "Dingo" - def animal fetch('australia.animals') end + + # Produces an Australian State or Territory + # + # @return [String] + # + # @example + # Faker::Australia.state + # #=> "New South Wales" + def state + fetch('australia.states') + end end end end diff --git a/lib/locales/en/australia.yml b/lib/locales/en/australia.yml index 91e941462c..98f2f4fed7 100644 --- a/lib/locales/en/australia.yml +++ b/lib/locales/en/australia.yml @@ -98,3 +98,12 @@ en: - Frilled Neck Lizard - Saltwater Crocodile - Eastern Brown Snake + states: + - New South wales + - Queensland + - Western Australia + - Northern Territory + - South Australia + - Australian Capital Territory + - Visctoria + - Tasmania diff --git a/test/faker/location/test_faker_australia.rb b/test/faker/location/test_faker_australia.rb index 4cc4642430..5d58c03e57 100644 --- a/test/faker/location/test_faker_australia.rb +++ b/test/faker/location/test_faker_australia.rb @@ -14,4 +14,8 @@ def test_location def test_animal assert @tester.animal.match(/\w+/) end + + def test_state + assert @tester.state.match(/\w+/) + end end From 227eef706486cfaafd16cda73476f9a176741e51 Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Fri, 29 Jan 2021 05:40:01 +1100 Subject: [PATCH 07/10] Fix typos --- lib/locales/en/australia.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/locales/en/australia.yml b/lib/locales/en/australia.yml index 98f2f4fed7..c976073272 100644 --- a/lib/locales/en/australia.yml +++ b/lib/locales/en/australia.yml @@ -2,10 +2,9 @@ en: faker: australia: locations: - - Sydney - Brisbane - Sydney - - Melbour + - Melbourn - Brisbane - Perth - Adelaide @@ -21,7 +20,7 @@ en: - Cairns - Toowoomba - Darwin - - Ballara + - Ballarat - Bendigo - Albury - Launceston From c8654bc428bb558ef82cf105a8cb7cd2eb801885 Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Fri, 29 Jan 2021 05:40:35 +1100 Subject: [PATCH 08/10] Fix more typos --- lib/locales/en/australia.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/locales/en/australia.yml b/lib/locales/en/australia.yml index c976073272..24537b52bd 100644 --- a/lib/locales/en/australia.yml +++ b/lib/locales/en/australia.yml @@ -4,7 +4,7 @@ en: locations: - Brisbane - Sydney - - Melbourn + - Melbourne - Brisbane - Perth - Adelaide From fab0ae261887523e6838e969b956862cee6c873e Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Fri, 25 Jun 2021 23:18:12 +1000 Subject: [PATCH 09/10] Fix spacing --- lib/locales/en/australia.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/locales/en/australia.yml b/lib/locales/en/australia.yml index 24537b52bd..0ac977c2ff 100644 --- a/lib/locales/en/australia.yml +++ b/lib/locales/en/australia.yml @@ -19,36 +19,36 @@ en: - Townsville - Cairns - Toowoomba - - Darwin + - Darwin - Ballarat - Bendigo - Albury - - Launceston + - Launceston - Mackay - Rockhampton - Bunbury - Coffs Harbour - Bundaberg - - Melton - - Wagga Wagga - - Hervey Bay + - Melton + - Wagga Wagga + - Hervey Bay - Mildura – Wentworth - - Shepparton – Mooroopna + - Shepparton – Mooroopna - Port Macquarie - Gladstone – Tannum Sands - - Tamworth - - Traralgon – Morwell - - Orange - - Bowral – Mittagong - - Busselton + - Tamworth + - Traralgon – Morwell + - Orange + - Bowral – Mittagong + - Busselton - Geraldton - Dubbo - Nowra – Bomaderry - Warragul – Drouin - Bathurst - - Warrnambool + - Warrnambool - Albany - - Kalgoorlie – Boulder + - Kalgoorlie - Devonport - Mount Gambier - Lismore From b5d74243acf2208babcf19023ee6586e039720b6 Mon Sep 17 00:00:00 2001 From: Blake Astley Date: Fri, 20 Aug 2021 21:25:38 +1000 Subject: [PATCH 10/10] Add faker version documentation --- lib/faker/locations/australia.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/faker/locations/australia.rb b/lib/faker/locations/australia.rb index 1e9829a584..c0aeadf597 100644 --- a/lib/faker/locations/australia.rb +++ b/lib/faker/locations/australia.rb @@ -11,6 +11,8 @@ class << self # @example # Faker::Australia.location # #=> "Sydney" + # + # @faker.version next def location fetch('australia.locations') end @@ -22,6 +24,8 @@ def location # @example # Faker::Australia.animal # #=> "Dingo" + # + # @faker.version next def animal fetch('australia.animals') end @@ -33,6 +37,8 @@ def animal # @example # Faker::Australia.state # #=> "New South Wales" + # + # @faker.version next def state fetch('australia.states') end