country_select 6.1.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,112 +1,100 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- country_select (6.1.0)
5
- countries (~> 4.2)
6
- sort_alphabetical (~> 1.1)
4
+ country_select (7.0.0)
5
+ countries (~> 5.0)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
- actionpack (6.1.4.4)
12
- actionview (= 6.1.4.4)
13
- activesupport (= 6.1.4.4)
14
- rack (~> 2.0, >= 2.0.9)
10
+ actionpack (6.0.5)
11
+ actionview (= 6.0.5)
12
+ activesupport (= 6.0.5)
13
+ rack (~> 2.0, >= 2.0.8)
15
14
  rack-test (>= 0.6.3)
16
15
  rails-dom-testing (~> 2.0)
17
16
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.1.4.4)
19
- activesupport (= 6.1.4.4)
17
+ actionview (6.0.5)
18
+ activesupport (= 6.0.5)
20
19
  builder (~> 3.1)
21
20
  erubi (~> 1.4)
22
21
  rails-dom-testing (~> 2.0)
23
22
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activesupport (6.1.4.4)
23
+ activesupport (6.0.5)
25
24
  concurrent-ruby (~> 1.0, >= 1.0.2)
26
- i18n (>= 1.6, < 2)
27
- minitest (>= 5.1)
28
- tzinfo (~> 2.0)
29
- zeitwerk (~> 2.3)
25
+ i18n (>= 0.7, < 2)
26
+ minitest (~> 5.1)
27
+ tzinfo (~> 1.1)
28
+ zeitwerk (~> 2.2, >= 2.2.2)
30
29
  builder (3.2.4)
31
30
  coderay (1.1.3)
32
- concurrent-ruby (1.1.9)
33
- countries (4.2.1)
34
- i18n_data (~> 0.15.0)
31
+ concurrent-ruby (1.1.10)
32
+ countries (5.1.0)
35
33
  sixarm_ruby_unaccent (~> 1.1)
36
34
  crass (1.0.6)
37
35
  diff-lcs (1.5.0)
38
36
  erubi (1.10.0)
39
- i18n (1.8.11)
37
+ i18n (1.10.0)
40
38
  concurrent-ruby (~> 1.0)
41
- i18n_data (0.15.0)
42
- simple_po_parser (~> 1.1)
43
- loofah (2.13.0)
39
+ loofah (2.18.0)
44
40
  crass (~> 1.0.2)
45
41
  nokogiri (>= 1.5.9)
46
42
  method_source (1.0.0)
47
- mini_portile2 (2.7.1)
48
- minitest (5.15.0)
49
- nokogiri (1.13.1)
50
- mini_portile2 (~> 2.7.0)
43
+ minitest (5.16.1)
44
+ nokogiri (1.13.6-x86_64-darwin)
51
45
  racc (~> 1.4)
52
- nokogiri (1.13.1-arm64-darwin)
53
- racc (~> 1.4)
54
- nokogiri (1.13.1-x86_64-linux)
46
+ nokogiri (1.13.6-x86_64-linux)
55
47
  racc (~> 1.4)
56
48
  pry (0.14.1)
57
49
  coderay (~> 1.1)
58
50
  method_source (~> 1.0)
59
51
  racc (1.6.0)
60
- rack (2.2.3)
61
- rack-test (1.1.0)
62
- rack (>= 1.0, < 3)
52
+ rack (2.2.3.1)
53
+ rack-test (2.0.2)
54
+ rack (>= 1.3)
63
55
  rails-dom-testing (2.0.3)
64
56
  activesupport (>= 4.2.0)
65
57
  nokogiri (>= 1.6)
66
- rails-html-sanitizer (1.4.2)
58
+ rails-html-sanitizer (1.4.3)
67
59
  loofah (~> 2.3)
68
- railties (6.1.4.4)
69
- actionpack (= 6.1.4.4)
70
- activesupport (= 6.1.4.4)
60
+ railties (6.0.5)
61
+ actionpack (= 6.0.5)
62
+ activesupport (= 6.0.5)
71
63
  method_source
72
- rake (>= 0.13)
73
- thor (~> 1.0)
64
+ rake (>= 0.8.7)
65
+ thor (>= 0.20.3, < 2.0)
74
66
  rake (13.0.6)
75
- rspec (3.10.0)
76
- rspec-core (~> 3.10.0)
77
- rspec-expectations (~> 3.10.0)
78
- rspec-mocks (~> 3.10.0)
79
- rspec-core (3.10.1)
80
- rspec-support (~> 3.10.0)
81
- rspec-expectations (3.10.2)
67
+ rspec (3.11.0)
68
+ rspec-core (~> 3.11.0)
69
+ rspec-expectations (~> 3.11.0)
70
+ rspec-mocks (~> 3.11.0)
71
+ rspec-core (3.11.0)
72
+ rspec-support (~> 3.11.0)
73
+ rspec-expectations (3.11.0)
82
74
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.10.0)
84
- rspec-mocks (3.10.2)
75
+ rspec-support (~> 3.11.0)
76
+ rspec-mocks (3.11.1)
85
77
  diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.10.0)
87
- rspec-support (3.10.3)
88
- simple_po_parser (1.1.5)
78
+ rspec-support (~> 3.11.0)
79
+ rspec-support (3.11.0)
89
80
  sixarm_ruby_unaccent (1.2.0)
90
- sort_alphabetical (1.1.0)
91
- unicode_utils (>= 1.2.2)
92
81
  thor (1.2.1)
93
- tzinfo (2.0.4)
94
- concurrent-ruby (~> 1.0)
95
- unicode_utils (1.4.0)
96
- zeitwerk (2.5.3)
82
+ thread_safe (0.3.6)
83
+ tzinfo (1.2.9)
84
+ thread_safe (~> 0.1)
85
+ zeitwerk (2.6.0)
97
86
 
98
87
  PLATFORMS
99
- arm64-darwin-21
100
- ruby
88
+ x86_64-darwin-21
101
89
  x86_64-linux
102
90
 
103
91
  DEPENDENCIES
104
- actionpack (~> 6.0)
92
+ actionpack (~> 6.0.0)
105
93
  country_select!
106
94
  pry (~> 0)
107
- railties (~> 6.0)
95
+ railties (~> 6.0.0)
108
96
  rake (~> 13)
109
97
  rspec (~> 3)
110
98
 
111
99
  BUNDLED WITH
112
- 2.3.3
100
+ 2.3.10
@@ -2,5 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec :path => "../"
4
4
 
5
- gem "railties", "~> 6.1"
6
- gem "actionpack", "~> 6.1"
5
+ gem "railties", "~> 6.1.0"
6
+ gem "actionpack", "~> 6.1.0"
@@ -1,27 +1,26 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- country_select (6.1.0)
5
- countries (~> 4.2)
6
- sort_alphabetical (~> 1.1)
4
+ country_select (7.0.0)
5
+ countries (~> 5.0)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
- actionpack (6.1.4.4)
12
- actionview (= 6.1.4.4)
13
- activesupport (= 6.1.4.4)
10
+ actionpack (6.1.6)
11
+ actionview (= 6.1.6)
12
+ activesupport (= 6.1.6)
14
13
  rack (~> 2.0, >= 2.0.9)
15
14
  rack-test (>= 0.6.3)
16
15
  rails-dom-testing (~> 2.0)
17
16
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.1.4.4)
19
- activesupport (= 6.1.4.4)
17
+ actionview (6.1.6)
18
+ activesupport (= 6.1.6)
20
19
  builder (~> 3.1)
21
20
  erubi (~> 1.4)
22
21
  rails-dom-testing (~> 2.0)
23
22
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activesupport (6.1.4.4)
23
+ activesupport (6.1.6)
25
24
  concurrent-ruby (~> 1.0, >= 1.0.2)
26
25
  i18n (>= 1.6, < 2)
27
26
  minitest (>= 5.1)
@@ -29,84 +28,72 @@ GEM
29
28
  zeitwerk (~> 2.3)
30
29
  builder (3.2.4)
31
30
  coderay (1.1.3)
32
- concurrent-ruby (1.1.9)
33
- countries (4.2.1)
34
- i18n_data (~> 0.15.0)
31
+ concurrent-ruby (1.1.10)
32
+ countries (5.1.0)
35
33
  sixarm_ruby_unaccent (~> 1.1)
36
34
  crass (1.0.6)
37
35
  diff-lcs (1.5.0)
38
36
  erubi (1.10.0)
39
- i18n (1.8.11)
37
+ i18n (1.10.0)
40
38
  concurrent-ruby (~> 1.0)
41
- i18n_data (0.15.0)
42
- simple_po_parser (~> 1.1)
43
- loofah (2.13.0)
39
+ loofah (2.18.0)
44
40
  crass (~> 1.0.2)
45
41
  nokogiri (>= 1.5.9)
46
42
  method_source (1.0.0)
47
- mini_portile2 (2.7.1)
48
- minitest (5.15.0)
49
- nokogiri (1.13.1)
50
- mini_portile2 (~> 2.7.0)
43
+ minitest (5.16.1)
44
+ nokogiri (1.13.6-x86_64-darwin)
51
45
  racc (~> 1.4)
52
- nokogiri (1.13.1-arm64-darwin)
53
- racc (~> 1.4)
54
- nokogiri (1.13.1-x86_64-linux)
46
+ nokogiri (1.13.6-x86_64-linux)
55
47
  racc (~> 1.4)
56
48
  pry (0.14.1)
57
49
  coderay (~> 1.1)
58
50
  method_source (~> 1.0)
59
51
  racc (1.6.0)
60
- rack (2.2.3)
61
- rack-test (1.1.0)
62
- rack (>= 1.0, < 3)
52
+ rack (2.2.3.1)
53
+ rack-test (2.0.2)
54
+ rack (>= 1.3)
63
55
  rails-dom-testing (2.0.3)
64
56
  activesupport (>= 4.2.0)
65
57
  nokogiri (>= 1.6)
66
- rails-html-sanitizer (1.4.2)
58
+ rails-html-sanitizer (1.4.3)
67
59
  loofah (~> 2.3)
68
- railties (6.1.4.4)
69
- actionpack (= 6.1.4.4)
70
- activesupport (= 6.1.4.4)
60
+ railties (6.1.6)
61
+ actionpack (= 6.1.6)
62
+ activesupport (= 6.1.6)
71
63
  method_source
72
- rake (>= 0.13)
64
+ rake (>= 12.2)
73
65
  thor (~> 1.0)
74
66
  rake (13.0.6)
75
- rspec (3.10.0)
76
- rspec-core (~> 3.10.0)
77
- rspec-expectations (~> 3.10.0)
78
- rspec-mocks (~> 3.10.0)
79
- rspec-core (3.10.1)
80
- rspec-support (~> 3.10.0)
81
- rspec-expectations (3.10.2)
67
+ rspec (3.11.0)
68
+ rspec-core (~> 3.11.0)
69
+ rspec-expectations (~> 3.11.0)
70
+ rspec-mocks (~> 3.11.0)
71
+ rspec-core (3.11.0)
72
+ rspec-support (~> 3.11.0)
73
+ rspec-expectations (3.11.0)
82
74
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.10.0)
84
- rspec-mocks (3.10.2)
75
+ rspec-support (~> 3.11.0)
76
+ rspec-mocks (3.11.1)
85
77
  diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.10.0)
87
- rspec-support (3.10.3)
88
- simple_po_parser (1.1.5)
78
+ rspec-support (~> 3.11.0)
79
+ rspec-support (3.11.0)
89
80
  sixarm_ruby_unaccent (1.2.0)
90
- sort_alphabetical (1.1.0)
91
- unicode_utils (>= 1.2.2)
92
81
  thor (1.2.1)
93
82
  tzinfo (2.0.4)
94
83
  concurrent-ruby (~> 1.0)
95
- unicode_utils (1.4.0)
96
- zeitwerk (2.5.3)
84
+ zeitwerk (2.6.0)
97
85
 
98
86
  PLATFORMS
99
- arm64-darwin-21
100
- ruby
87
+ x86_64-darwin-21
101
88
  x86_64-linux
102
89
 
103
90
  DEPENDENCIES
104
- actionpack (~> 6.1)
91
+ actionpack (~> 6.1.0)
105
92
  country_select!
106
93
  pry (~> 0)
107
- railties (~> 6.1)
94
+ railties (~> 6.1.0)
108
95
  rake (~> 13)
109
96
  rspec (~> 3)
110
97
 
111
98
  BUNDLED WITH
112
- 2.3.3
99
+ 2.3.10
@@ -2,5 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec :path => "../"
4
4
 
5
- gem "railties", "~> 7.0"
6
- gem "actionpack", "~> 7.0"
5
+ gem "railties", "~> 7.0.0"
6
+ gem "actionpack", "~> 7.0.0"
@@ -1,112 +1,99 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- country_select (6.1.0)
5
- countries (~> 4.2)
6
- sort_alphabetical (~> 1.1)
4
+ country_select (7.0.0)
5
+ countries (~> 5.0)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
- actionpack (7.0.1)
12
- actionview (= 7.0.1)
13
- activesupport (= 7.0.1)
10
+ actionpack (7.0.3)
11
+ actionview (= 7.0.3)
12
+ activesupport (= 7.0.3)
14
13
  rack (~> 2.0, >= 2.2.0)
15
14
  rack-test (>= 0.6.3)
16
15
  rails-dom-testing (~> 2.0)
17
16
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (7.0.1)
19
- activesupport (= 7.0.1)
17
+ actionview (7.0.3)
18
+ activesupport (= 7.0.3)
20
19
  builder (~> 3.1)
21
20
  erubi (~> 1.4)
22
21
  rails-dom-testing (~> 2.0)
23
22
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activesupport (7.0.1)
23
+ activesupport (7.0.3)
25
24
  concurrent-ruby (~> 1.0, >= 1.0.2)
26
25
  i18n (>= 1.6, < 2)
27
26
  minitest (>= 5.1)
28
27
  tzinfo (~> 2.0)
29
28
  builder (3.2.4)
30
29
  coderay (1.1.3)
31
- concurrent-ruby (1.1.9)
32
- countries (4.2.1)
33
- i18n_data (~> 0.15.0)
30
+ concurrent-ruby (1.1.10)
31
+ countries (5.1.0)
34
32
  sixarm_ruby_unaccent (~> 1.1)
35
33
  crass (1.0.6)
36
34
  diff-lcs (1.5.0)
37
35
  erubi (1.10.0)
38
- i18n (1.8.11)
36
+ i18n (1.10.0)
39
37
  concurrent-ruby (~> 1.0)
40
- i18n_data (0.15.0)
41
- simple_po_parser (~> 1.1)
42
- loofah (2.13.0)
38
+ loofah (2.18.0)
43
39
  crass (~> 1.0.2)
44
40
  nokogiri (>= 1.5.9)
45
41
  method_source (1.0.0)
46
- mini_portile2 (2.7.1)
47
- minitest (5.15.0)
48
- nokogiri (1.13.1)
49
- mini_portile2 (~> 2.7.0)
42
+ minitest (5.16.1)
43
+ nokogiri (1.13.6-x86_64-darwin)
50
44
  racc (~> 1.4)
51
- nokogiri (1.13.1-arm64-darwin)
52
- racc (~> 1.4)
53
- nokogiri (1.13.1-x86_64-linux)
45
+ nokogiri (1.13.6-x86_64-linux)
54
46
  racc (~> 1.4)
55
47
  pry (0.14.1)
56
48
  coderay (~> 1.1)
57
49
  method_source (~> 1.0)
58
50
  racc (1.6.0)
59
- rack (2.2.3)
60
- rack-test (1.1.0)
61
- rack (>= 1.0, < 3)
51
+ rack (2.2.3.1)
52
+ rack-test (2.0.2)
53
+ rack (>= 1.3)
62
54
  rails-dom-testing (2.0.3)
63
55
  activesupport (>= 4.2.0)
64
56
  nokogiri (>= 1.6)
65
- rails-html-sanitizer (1.4.2)
57
+ rails-html-sanitizer (1.4.3)
66
58
  loofah (~> 2.3)
67
- railties (7.0.1)
68
- actionpack (= 7.0.1)
69
- activesupport (= 7.0.1)
59
+ railties (7.0.3)
60
+ actionpack (= 7.0.3)
61
+ activesupport (= 7.0.3)
70
62
  method_source
71
63
  rake (>= 12.2)
72
64
  thor (~> 1.0)
73
65
  zeitwerk (~> 2.5)
74
66
  rake (13.0.6)
75
- rspec (3.10.0)
76
- rspec-core (~> 3.10.0)
77
- rspec-expectations (~> 3.10.0)
78
- rspec-mocks (~> 3.10.0)
79
- rspec-core (3.10.1)
80
- rspec-support (~> 3.10.0)
81
- rspec-expectations (3.10.2)
67
+ rspec (3.11.0)
68
+ rspec-core (~> 3.11.0)
69
+ rspec-expectations (~> 3.11.0)
70
+ rspec-mocks (~> 3.11.0)
71
+ rspec-core (3.11.0)
72
+ rspec-support (~> 3.11.0)
73
+ rspec-expectations (3.11.0)
82
74
  diff-lcs (>= 1.2.0, < 2.0)
83
- rspec-support (~> 3.10.0)
84
- rspec-mocks (3.10.2)
75
+ rspec-support (~> 3.11.0)
76
+ rspec-mocks (3.11.1)
85
77
  diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.10.0)
87
- rspec-support (3.10.3)
88
- simple_po_parser (1.1.5)
78
+ rspec-support (~> 3.11.0)
79
+ rspec-support (3.11.0)
89
80
  sixarm_ruby_unaccent (1.2.0)
90
- sort_alphabetical (1.1.0)
91
- unicode_utils (>= 1.2.2)
92
81
  thor (1.2.1)
93
82
  tzinfo (2.0.4)
94
83
  concurrent-ruby (~> 1.0)
95
- unicode_utils (1.4.0)
96
- zeitwerk (2.5.3)
84
+ zeitwerk (2.6.0)
97
85
 
98
86
  PLATFORMS
99
- arm64-darwin-21
100
- ruby
87
+ x86_64-darwin-21
101
88
  x86_64-linux
102
89
 
103
90
  DEPENDENCIES
104
- actionpack (~> 7.0)
91
+ actionpack (~> 7.0.0)
105
92
  country_select!
106
93
  pry (~> 0)
107
- railties (~> 7.0)
94
+ railties (~> 7.0.0)
108
95
  rake (~> 13)
109
96
  rspec (~> 3)
110
97
 
111
98
  BUNDLED WITH
112
- 2.3.3
99
+ 2.3.10
@@ -6,6 +6,11 @@ module ActionView
6
6
  html_options = options
7
7
  options = priority_or_options
8
8
  else
9
+ if RUBY_VERSION =~ /^3\.\d\.\d/
10
+ warn "DEPRECATION WARNING: Setting priority countries with the 1.x syntax is deprecated. Please use the `priority_countries:` option.", uplevel: 1, category: :deprecated
11
+ else
12
+ warn "DEPRECATION WARNING: Setting priority countries with the 1.x syntax is deprecated. Please use the `priority_countries:` option.", uplevel: 1
13
+ end
9
14
  options[:priority_countries] = priority_or_options
10
15
  end
11
16
 
@@ -5,6 +5,7 @@ module CountrySelect
5
5
  locale: nil,
6
6
  only: nil,
7
7
  priority_countries: nil,
8
- priority_countries_divider: "-" * 15
8
+ priority_countries_divider: "-" * 15,
9
+ sort_provided: true
9
10
  }
10
11
  end
@@ -4,6 +4,6 @@ module CountrySelect
4
4
  FORMATS[:default] = lambda do |country|
5
5
  # Need to use :[] specifically, not :dig, because country.translations is a
6
6
  # ISO3166::Translations object, which overrides :[] to support i18n locale fallbacks
7
- country.translations&.send(:[], I18n.locale.to_s) || country.iso_short_name
7
+ country.translations&.send(:[], I18n.locale.to_s) || country.common_name || country.iso_short_name
8
8
  end
9
9
  end
@@ -19,7 +19,7 @@ module CountrySelect
19
19
  }
20
20
 
21
21
  if priority_countries.present?
22
- priority_countries_options = country_options_for(priority_countries, false)
22
+ priority_countries_options = country_options_for(priority_countries, @options.fetch(:sort_provided, ::CountrySelect::DEFAULTS[:sort_provided]))
23
23
 
24
24
  option_tags = options_for_select(priority_countries_options, option_tags_options)
25
25
  option_tags += html_safe_newline + options_for_select([priority_countries_divider], disabled: priority_countries_divider)
@@ -59,14 +59,14 @@ module CountrySelect
59
59
  end
60
60
 
61
61
  def country_options
62
- country_options_for(all_country_codes, true)
62
+ country_options_for(all_country_codes, @options.fetch(:sort_provided, ::CountrySelect::DEFAULTS[:sort_provided]))
63
63
  end
64
64
 
65
65
  def all_country_codes
66
66
  codes = ISO3166::Country.codes
67
67
 
68
68
  if only_country_codes.present?
69
- codes & only_country_codes
69
+ only_country_codes & codes
70
70
  elsif except_country_codes.present?
71
71
  codes - except_country_codes
72
72
  else
@@ -79,9 +79,8 @@ module CountrySelect
79
79
  country_list = country_codes.map do |code_or_name|
80
80
  if country = ISO3166::Country.new(code_or_name)
81
81
  code = country.alpha2
82
- elsif country = ISO3166::Country.find_by_name(code_or_name)
83
- code = country.first
84
- country = ISO3166::Country.new(code)
82
+ elsif country = ISO3166::Country.find_country_by_any_name(code_or_name)
83
+ code = country.alpha2
85
84
  end
86
85
 
87
86
  unless country.present?
@@ -100,11 +99,7 @@ module CountrySelect
100
99
  end
101
100
 
102
101
  if sorted
103
- if country_list.respond_to?(:sort_alphabetical)
104
- country_list.sort_alphabetical
105
- else
106
- country_list.sort
107
- end
102
+ country_list.sort_by { |name, code| [I18n.transliterate(name), name] }
108
103
  else
109
104
  country_list
110
105
  end
@@ -1,3 +1,3 @@
1
1
  module CountrySelect
2
- VERSION = '6.1.0'
2
+ VERSION = '8.0.0'
3
3
  end
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'countries'
4
- require 'sort_alphabetical'
5
4
 
6
5
  require 'country_select/version'
7
6
  require 'country_select/defaults'