countries 5.7.2 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 893e579d0a0350a04815841ba766ae82e720cb75d9100ca04b8b0e3f01053180
4
- data.tar.gz: 23d6f05a8476b04247c4516ca4579ee2603fbe7c64f0944c47be632bd2e01e91
3
+ metadata.gz: 286e531b8c0498d092f01f34f1573cbb0972d032daa6da575a2aa23e04b556a0
4
+ data.tar.gz: f378901c7e6e1000aebe0938b3fc85f1aefc9b979c1b649fe9751aaf80c447e5
5
5
  SHA512:
6
- metadata.gz: 92eaed4d5b20099acf998d8337e95af144fa0ca99dde7ef1aecb9a29e045c2e2c80e9339a24e1ec7e0994f6de51a0aca6831fdf003fd74aa76d281656b050c4c
7
- data.tar.gz: 94eff3410807022c9fcd835600ebde0aa595df2f61d2c12600bc938fd0e37c869b6d4701ad69ed580203aff9c6584c24fcff0e1e394286d98fc17b9975bdd16f
6
+ metadata.gz: 6d85ce97b881c2917d06aea6572cd3bbf4dfbace7fa69efa5252fba05127e4e8e2577b488d5c73df886456c0887f4fda904be9a519221ca259482ee267f6afaa
7
+ data.tar.gz: 7e9f46b3537b01ad9e772051a9cacbaf65ccde95077d917d328bb1e38fd1251e63f961c082323ee3e4a4f58b17c69a79908510f54fa6863a76f1f88d82152605
@@ -2,8 +2,8 @@
2
2
 
3
3
  module ISO3166
4
4
  module CountryFinderMethods
5
- FIND_BY_REGEX = /^find_(all_)?(country_|countries_)?by_(.+)/.freeze
6
- SEARCH_TERM_FILTER_REGEX = /\(|\)|\[\]|,/.freeze
5
+ FIND_BY_REGEX = /^find_(all_)?(country_|countries_)?by_(.+)/
6
+ SEARCH_TERM_FILTER_REGEX = /\(|\)|\[\]|,/
7
7
 
8
8
  def search(query)
9
9
  country = new(query.to_s.upcase)
@@ -10,13 +10,13 @@ module ISO3166
10
10
 
11
11
  ISO3166::DEFAULT_COUNTRY_HASH.each do |method_name, _type|
12
12
  define_method method_name do
13
- data[method_name.to_s].freeze
13
+ data[method_name.to_s]
14
14
  end
15
15
  end
16
16
 
17
17
  ISO3166::DEFAULT_COUNTRY_HASH['geo'].each do |method_name, _type|
18
18
  define_method method_name do
19
- data['geo'][method_name.to_s].freeze
19
+ data['geo'][method_name.to_s]
20
20
  end
21
21
  end
22
22
 
@@ -45,10 +45,12 @@ module ISO3166
45
45
 
46
46
  # Resets the loaded data and cache
47
47
  def reset
48
- @cache = {}
49
- @subdivisions = {}
50
- @registered_data = {}
51
- ISO3166.configuration.loaded_locales = []
48
+ synchronized do
49
+ @cache = {}
50
+ @subdivisions = {}
51
+ @registered_data = {}
52
+ ISO3166.configuration.loaded_locales = []
53
+ end
52
54
  end
53
55
 
54
56
  def codes
@@ -97,16 +99,7 @@ module ISO3166
97
99
  end
98
100
 
99
101
  def synchronized(&block)
100
- if use_mutex?
101
- @mutex.synchronize(&block)
102
- else
103
- block.call
104
- end
105
- end
106
-
107
- def use_mutex?
108
- # Stubbed in testing
109
- true
102
+ @mutex.synchronize(&block)
110
103
  end
111
104
 
112
105
  def load_required?
@@ -7,7 +7,7 @@ namespace :postal_codes do
7
7
  require 'open-uri'
8
8
  require 'yaml'
9
9
 
10
- country_files = Dir['lib/countries/data/countries/*.yaml'].sort
10
+ country_files = Dir['lib/countries/data/countries/*.yaml']
11
11
 
12
12
  country_files.each do |country_file|
13
13
  yaml = YAML.load_file(country_file)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Countries
4
- VERSION = '5.7.2'
4
+ VERSION = '6.0.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: countries
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.7.2
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Robinson
@@ -848,14 +848,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
848
848
  requirements:
849
849
  - - ">="
850
850
  - !ruby/object:Gem::Version
851
- version: '2.7'
851
+ version: '3.0'
852
852
  required_rubygems_version: !ruby/object:Gem::Requirement
853
853
  requirements:
854
854
  - - ">="
855
855
  - !ruby/object:Gem::Version
856
856
  version: '0'
857
857
  requirements: []
858
- rubygems_version: 3.4.19
858
+ rubygems_version: 3.5.4
859
859
  signing_key:
860
860
  specification_version: 4
861
861
  summary: Gives you a country object full of all sorts of useful information.