Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from adjust/update-countries-to-match-netsuite
Browse files Browse the repository at this point in the history
Update countries to match netsuite
  • Loading branch information
fixme authored Aug 18, 2023
2 parents 2909843 + ddf1ecb commit 9c76e4c
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 43 deletions.
22 changes: 13 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,4 +28,4 @@ DEPENDENCIES
test-unit (~> 3.0)

BUNDLED WITH
1.11.2
2.1.4
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.8
0.8.0
70 changes: 41 additions & 29 deletions lib/iso_country_codes/iso_3166_1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

40 changes: 38 additions & 2 deletions overrides.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion rakelib/iso_3166_1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion test/iso_country_codes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 9c76e4c

Please sign in to comment.