diff --git a/Gemfile.lock b/Gemfile.lock index 48fd854..154a313 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,15 +2,19 @@ GEM remote: https://rubygems.org/ specs: erubis (2.7.0) - json (1.8.2) - mini_portile (0.6.2) - nokogiri (1.6.6.2) - mini_portile (~> 0.6.0) - power_assert (0.2.7) + mini_portile2 (2.8.4) + nokogiri (1.15.4) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + power_assert (2.0.3) + psych (5.1.0) + stringio + racc (1.7.1) rake (10.4.2) - rdoc (4.2.0) - json (~> 1.4) - test-unit (3.1.8) + rdoc (6.5.0) + psych (>= 4.0.0) + stringio (3.0.8) + test-unit (3.6.1) power_assert PLATFORMS @@ -24,4 +28,4 @@ DEPENDENCIES test-unit (~> 3.0) BUNDLED WITH - 1.11.2 + 2.1.4 diff --git a/VERSION b/VERSION index e7c7d3c..a3df0a6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.8 +0.8.0 diff --git a/lib/iso_country_codes/iso_3166_1.rb b/lib/iso_country_codes/iso_3166_1.rb index 41941de..3422cab 100644 --- a/lib/iso_country_codes/iso_3166_1.rb +++ b/lib/iso_country_codes/iso_3166_1.rb @@ -10,7 +10,7 @@ class AFG < Code #:nodoc: end class ALA < Code #:nodoc: self.numeric = %q{248} - self.name = %q{Åland Islands} + self.name = %q{Aland Islands} self.alpha2 = %q{AX} self.alpha3 = %q{ALA} end @@ -166,7 +166,7 @@ class BOL < Code #:nodoc: end class BES < Code #:nodoc: self.numeric = %q{535} - self.name = %q{Bonaire, Sint Eustatius and Saba} + self.name = %q{Bonaire, Saint Eustatius, and Saba} self.alpha2 = %q{BQ} self.alpha3 = %q{BES} end @@ -304,13 +304,13 @@ class COM < Code #:nodoc: end class COG < Code #:nodoc: self.numeric = %q{178} - self.name = %q{Congo} + self.name = %q{Congo, Democratic People's Republic} self.alpha2 = %q{CG} self.alpha3 = %q{COG} end class COD < Code #:nodoc: self.numeric = %q{180} - self.name = %q{Congo (Democratic Republic of the)} + self.name = %q{Congo, Republic of} self.alpha2 = %q{CD} self.alpha3 = %q{COD} end @@ -334,7 +334,7 @@ class CIV < Code #:nodoc: end class HRV < Code #:nodoc: self.numeric = %q{191} - self.name = %q{Croatia} + self.name = %q{Croatia/Hrvatska} self.alpha2 = %q{HR} self.alpha3 = %q{HRV} end @@ -422,6 +422,12 @@ class EST < Code #:nodoc: self.alpha2 = %q{EE} self.alpha3 = %q{EST} end + class SWZ < Code #:nodoc: + self.numeric = %q{748} + self.name = %q{Eswatini} + self.alpha2 = %q{SZ} + self.alpha3 = %q{SWZ} + end class ETH < Code #:nodoc: self.numeric = %q{231} self.name = %q{Ethiopia} @@ -586,7 +592,7 @@ class HMD < Code #:nodoc: end class VAT < Code #:nodoc: self.numeric = %q{336} - self.name = %q{Holy See} + self.name = %q{Holy See (City Vatican State)} self.alpha2 = %q{VA} self.alpha3 = %q{VAT} end @@ -706,13 +712,13 @@ class KIR < Code #:nodoc: end class PRK < Code #:nodoc: self.numeric = %q{408} - self.name = %q{Korea (Democratic People's Republic of)} + self.name = %q{Korea, Democratic People's Republic} self.alpha2 = %q{KP} self.alpha3 = %q{PRK} end class KOR < Code #:nodoc: self.numeric = %q{410} - self.name = %q{Korea (Republic of)} + self.name = %q{Korea, Republic of} self.alpha2 = %q{KR} self.alpha3 = %q{KOR} end @@ -788,12 +794,6 @@ class MAC < Code #:nodoc: self.alpha2 = %q{MO} self.alpha3 = %q{MAC} end - class MKD < Code #:nodoc: - self.numeric = %q{807} - self.name = %q{Macedonia (the former Yugoslav Republic of)} - self.alpha2 = %q{MK} - self.alpha3 = %q{MKD} - end class MDG < Code #:nodoc: self.numeric = %q{450} self.name = %q{Madagascar} @@ -868,13 +868,13 @@ class MEX < Code #:nodoc: end class FSM < Code #:nodoc: self.numeric = %q{583} - self.name = %q{Micronesia (Federated States of)} + self.name = %q{Micronesia, Federal State of} self.alpha2 = %q{FM} self.alpha3 = %q{FSM} end class MDA < Code #:nodoc: self.numeric = %q{498} - self.name = %q{Moldova (Republic of)} + self.name = %q{Moldova, Republic of} self.alpha2 = %q{MD} self.alpha3 = %q{MDA} end @@ -940,7 +940,7 @@ class NPL < Code #:nodoc: end class NLD < Code #:nodoc: self.numeric = %q{528} - self.name = %q{Netherlands} + self.name = %q{Netherlands, Kingdom of the} self.alpha2 = %q{NL} self.alpha3 = %q{NLD} end @@ -986,6 +986,12 @@ class NFK < Code #:nodoc: self.alpha2 = %q{NF} self.alpha3 = %q{NFK} end + class MKD < Code #:nodoc: + self.numeric = %q{807} + self.name = %q{North Macedonia} + self.alpha2 = %q{MK} + self.alpha3 = %q{MKD} + end class MNP < Code #:nodoc: self.numeric = %q{580} self.name = %q{Northern Mariana Islands} @@ -1018,7 +1024,7 @@ class PLW < Code #:nodoc: end class PSE < Code #:nodoc: self.numeric = %q{275} - self.name = %q{Palestine, State of} + self.name = %q{State of Palestine} self.alpha2 = %q{PS} self.alpha3 = %q{PSE} end @@ -1132,13 +1138,13 @@ class LCA < Code #:nodoc: end class MAF < Code #:nodoc: self.numeric = %q{663} - self.name = %q{Saint Martin (French part)} + self.name = %q{Saint Martin} self.alpha2 = %q{MF} self.alpha3 = %q{MAF} end class SPM < Code #:nodoc: self.numeric = %q{666} - self.name = %q{Saint Pierre and Miquelon} + self.name = %q{St. Pierre and Miquelon} self.alpha2 = %q{PM} self.alpha3 = %q{SPM} end @@ -1240,7 +1246,7 @@ class ZAF < Code #:nodoc: end class SGS < Code #:nodoc: self.numeric = %q{239} - self.name = %q{South Georgia and the South Sandwich Islands} + self.name = %q{South Georgia} self.alpha2 = %q{GS} self.alpha3 = %q{SGS} end @@ -1280,12 +1286,6 @@ class SJM < Code #:nodoc: self.alpha2 = %q{SJ} self.alpha3 = %q{SJM} end - class SWZ < Code #:nodoc: - self.numeric = %q{748} - self.name = %q{Swaziland} - self.alpha2 = %q{SZ} - self.alpha3 = %q{SWZ} - end class SWE < Code #:nodoc: self.numeric = %q{752} self.name = %q{Sweden} @@ -1306,7 +1306,7 @@ class SYR < Code #:nodoc: end class TWN < Code #:nodoc: self.numeric = %q{158} - self.name = %q{Taiwan} + self.name = %q{Taiwan, Province of China} self.alpha2 = %q{TW} self.alpha3 = %q{TWN} end @@ -1366,7 +1366,7 @@ class TUN < Code #:nodoc: end class TUR < Code #:nodoc: self.numeric = %q{792} - self.name = %q{Turkey} + self.name = %q{Türkiye} self.alpha2 = %q{TR} self.alpha3 = %q{TUR} end @@ -1496,6 +1496,18 @@ class ZWE < Code #:nodoc: self.alpha2 = %q{ZW} self.alpha3 = %q{ZWE} end + class ANT < Code #:nodoc: + self.numeric = %q{530} + self.name = %q{Netherlands Antilles} + self.alpha2 = %q{AN} + self.alpha3 = %q{ANT} + end + class IC < Code #:nodoc: + self.numeric = %q{} + self.name = %q{Canary Islands} + self.alpha2 = %q{IC} + self.alpha3 = %q{} + end end # end Code end # IsoCountryCodes diff --git a/overrides.yml b/overrides.yml index ce2499a..73a06ce 100644 --- a/overrides.yml +++ b/overrides.yml @@ -1,3 +1,39 @@ --- -"TWN": - :name: "Taiwan" +"ALA": + :name: "Aland Islands" +"ANT": + :name: "Netherlands Antilles" + :alpha2: "AN" + :alpha3: "ANT" + :numeric: 530 +"BES": + :name: "Bonaire, Saint Eustatius, and Saba" +"IC": + :name: "Canary Islands" + :alpha2: "IC" +"COG": + :name: "Congo, Democratic People's Republic" +"COD": + :name: "Congo, Republic of" +"HRV": + :name: "Croatia/Hrvatska" +"VAT": + :name: "Holy See (City Vatican State)" +"PRK": + :name: "Korea, Democratic People's Republic" +"KOR": + :name: "Korea, Republic of" +"FSM": + :name: "Micronesia, Federal State of" +"MDA": + :name: "Moldova, Republic of" +"MAF": + :name: "Saint Martin" +"SPM": + :name: "St. Pierre and Miquelon" +"SGS": + :name: "South Georgia" +"PSE": + :name: "State of Palestine" +"TUR": + :name: "Türkiye" \ No newline at end of file diff --git a/rakelib/iso_3166_1.rb b/rakelib/iso_3166_1.rb index 01b2601..125a305 100644 --- a/rakelib/iso_3166_1.rb +++ b/rakelib/iso_3166_1.rb @@ -7,7 +7,7 @@ class IsoCountryCodes module Task module UpdateCodes def self.get - doc = Nokogiri::HTML.parse(open('https://en.wikipedia.org/wiki/ISO_3166-1'), nil, 'UTF-8') + doc = Nokogiri::HTML.parse(URI.open('https://en.wikipedia.org/wiki/ISO_3166-1'), nil, 'UTF-8') codes = {} td_map = { :name => 1, diff --git a/test/iso_country_codes_test.rb b/test/iso_country_codes_test.rb index 4705459..e65806c 100644 --- a/test/iso_country_codes_test.rb +++ b/test/iso_country_codes_test.rb @@ -78,7 +78,7 @@ def test_search_by_name_returning_many_results_starting_wth_the_search_string def test_search_by_name_returning_many_results_not_starting_with_the_search_string assert_equal([ - IsoCountryCodes::Code::COD.instance, + IsoCountryCodes::Code::COG.instance, IsoCountryCodes::Code::PRK.instance, IsoCountryCodes::Code::LAO.instance ], IsoCountryCodes.search_by_name('democratic'))