country_select 10.0.0 → 11.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 +4 -4
- data/.github/workflows/test.yml +3 -3
- data/CHANGELOG.md +10 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +66 -46
- data/README.md +1 -6
- data/country_select.gemspec +2 -3
- data/gemfiles/actionpack-7.1.gemfile +1 -1
- data/gemfiles/actionpack-7.1.gemfile.lock +82 -54
- data/gemfiles/actionpack-7.2.gemfile +1 -1
- data/gemfiles/actionpack-7.2.gemfile.lock +80 -56
- data/gemfiles/{actionpack-7.0.gemfile → actionpack-8.0.gemfile} +3 -3
- data/gemfiles/actionpack-8.0.gemfile.lock +174 -0
- data/lib/country_select/defaults.rb +0 -1
- data/lib/country_select/tag_helper.rb +9 -8
- data/lib/country_select/version.rb +1 -1
- data/spec/country_select_spec.rb +24 -18
- metadata +10 -29
- data/gemfiles/actionpack-6.1.gemfile +0 -9
- data/gemfiles/actionpack-6.1.gemfile.lock +0 -111
- data/gemfiles/actionpack-7.0.gemfile.lock +0 -114
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
country_select (10.0.
|
5
|
-
countries (>
|
4
|
+
country_select (10.0.1)
|
5
|
+
countries (> 6.0, < 9.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (7.2.1)
|
11
|
-
actionview (= 7.2.1)
|
12
|
-
activesupport (= 7.2.1)
|
10
|
+
actionpack (7.2.2.1)
|
11
|
+
actionview (= 7.2.2.1)
|
12
|
+
activesupport (= 7.2.2.1)
|
13
13
|
nokogiri (>= 1.8.5)
|
14
14
|
racc
|
15
15
|
rack (>= 2.2.4, < 3.2)
|
@@ -18,14 +18,15 @@ GEM
|
|
18
18
|
rails-dom-testing (~> 2.2)
|
19
19
|
rails-html-sanitizer (~> 1.6)
|
20
20
|
useragent (~> 0.16)
|
21
|
-
actionview (7.2.1)
|
22
|
-
activesupport (= 7.2.1)
|
21
|
+
actionview (7.2.2.1)
|
22
|
+
activesupport (= 7.2.2.1)
|
23
23
|
builder (~> 3.1)
|
24
24
|
erubi (~> 1.11)
|
25
25
|
rails-dom-testing (~> 2.2)
|
26
26
|
rails-html-sanitizer (~> 1.6)
|
27
|
-
activesupport (7.2.1)
|
27
|
+
activesupport (7.2.2.1)
|
28
28
|
base64
|
29
|
+
benchmark (>= 0.3)
|
29
30
|
bigdecimal
|
30
31
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
31
32
|
connection_pool (>= 2.2.5)
|
@@ -35,118 +36,141 @@ GEM
|
|
35
36
|
minitest (>= 5.1)
|
36
37
|
securerandom (>= 0.3)
|
37
38
|
tzinfo (~> 2.0, >= 2.0.5)
|
38
|
-
base64 (0.
|
39
|
-
|
39
|
+
base64 (0.3.0)
|
40
|
+
benchmark (0.4.1)
|
41
|
+
bigdecimal (3.2.1)
|
40
42
|
builder (3.3.0)
|
41
43
|
coderay (1.1.3)
|
42
|
-
concurrent-ruby (1.3.
|
43
|
-
connection_pool (2.
|
44
|
-
countries (
|
44
|
+
concurrent-ruby (1.3.5)
|
45
|
+
connection_pool (2.5.3)
|
46
|
+
countries (8.0.0)
|
45
47
|
unaccent (~> 0.3)
|
46
48
|
crass (1.0.6)
|
47
|
-
|
49
|
+
date (3.4.1)
|
50
|
+
diff-lcs (1.6.2)
|
48
51
|
docile (1.4.1)
|
49
|
-
drb (2.2.
|
50
|
-
|
51
|
-
|
52
|
+
drb (2.2.3)
|
53
|
+
erb (5.0.1)
|
54
|
+
erubi (1.13.1)
|
55
|
+
i18n (1.14.7)
|
52
56
|
concurrent-ruby (~> 1.0)
|
53
|
-
io-console (0.
|
54
|
-
irb (1.
|
57
|
+
io-console (0.8.0)
|
58
|
+
irb (1.15.2)
|
59
|
+
pp (>= 0.6.0)
|
55
60
|
rdoc (>= 4.0.0)
|
56
61
|
reline (>= 0.4.2)
|
57
|
-
logger (1.
|
58
|
-
loofah (2.
|
62
|
+
logger (1.7.0)
|
63
|
+
loofah (2.24.1)
|
59
64
|
crass (~> 1.0.2)
|
60
65
|
nokogiri (>= 1.12.0)
|
61
66
|
method_source (1.1.0)
|
62
|
-
|
63
|
-
|
67
|
+
mini_portile2 (2.8.9)
|
68
|
+
minitest (5.25.5)
|
69
|
+
nokogiri (1.18.8)
|
70
|
+
mini_portile2 (~> 2.8.2)
|
64
71
|
racc (~> 1.4)
|
65
|
-
nokogiri (1.
|
72
|
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
66
73
|
racc (~> 1.4)
|
67
|
-
nokogiri (1.
|
74
|
+
nokogiri (1.18.8-aarch64-linux-musl)
|
68
75
|
racc (~> 1.4)
|
69
|
-
nokogiri (1.
|
76
|
+
nokogiri (1.18.8-arm-linux-gnu)
|
70
77
|
racc (~> 1.4)
|
71
|
-
nokogiri (1.
|
78
|
+
nokogiri (1.18.8-arm-linux-musl)
|
72
79
|
racc (~> 1.4)
|
73
|
-
nokogiri (1.
|
80
|
+
nokogiri (1.18.8-arm64-darwin)
|
74
81
|
racc (~> 1.4)
|
75
|
-
|
82
|
+
nokogiri (1.18.8-x86_64-darwin)
|
83
|
+
racc (~> 1.4)
|
84
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
85
|
+
racc (~> 1.4)
|
86
|
+
nokogiri (1.18.8-x86_64-linux-musl)
|
87
|
+
racc (~> 1.4)
|
88
|
+
pp (0.6.2)
|
89
|
+
prettyprint
|
90
|
+
prettyprint (0.2.0)
|
91
|
+
pry (0.15.2)
|
76
92
|
coderay (~> 1.1)
|
77
93
|
method_source (~> 1.0)
|
78
|
-
psych (5.
|
94
|
+
psych (5.2.6)
|
95
|
+
date
|
79
96
|
stringio
|
80
97
|
racc (1.8.1)
|
81
|
-
rack (3.1.
|
82
|
-
rack-session (2.
|
98
|
+
rack (3.1.15)
|
99
|
+
rack-session (2.1.1)
|
100
|
+
base64 (>= 0.1.0)
|
83
101
|
rack (>= 3.0.0)
|
84
|
-
rack-test (2.
|
102
|
+
rack-test (2.2.0)
|
85
103
|
rack (>= 1.3)
|
86
|
-
rackup (2.1
|
104
|
+
rackup (2.2.1)
|
87
105
|
rack (>= 3)
|
88
|
-
|
89
|
-
rails-dom-testing (2.2.0)
|
106
|
+
rails-dom-testing (2.3.0)
|
90
107
|
activesupport (>= 5.0.0)
|
91
108
|
minitest
|
92
109
|
nokogiri (>= 1.6)
|
93
|
-
rails-html-sanitizer (1.6.
|
110
|
+
rails-html-sanitizer (1.6.2)
|
94
111
|
loofah (~> 2.21)
|
95
|
-
nokogiri (
|
96
|
-
railties (7.2.1)
|
97
|
-
actionpack (= 7.2.1)
|
98
|
-
activesupport (= 7.2.1)
|
112
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
113
|
+
railties (7.2.2.1)
|
114
|
+
actionpack (= 7.2.2.1)
|
115
|
+
activesupport (= 7.2.2.1)
|
99
116
|
irb (~> 1.13)
|
100
117
|
rackup (>= 1.0.0)
|
101
118
|
rake (>= 12.2)
|
102
119
|
thor (~> 1.0, >= 1.2.2)
|
103
120
|
zeitwerk (~> 2.6)
|
104
|
-
rake (13.
|
105
|
-
rdoc (6.
|
121
|
+
rake (13.3.0)
|
122
|
+
rdoc (6.14.0)
|
123
|
+
erb
|
106
124
|
psych (>= 4.0.0)
|
107
|
-
reline (0.
|
125
|
+
reline (0.6.1)
|
108
126
|
io-console (~> 0.5)
|
109
|
-
rspec (3.13.
|
127
|
+
rspec (3.13.1)
|
110
128
|
rspec-core (~> 3.13.0)
|
111
129
|
rspec-expectations (~> 3.13.0)
|
112
130
|
rspec-mocks (~> 3.13.0)
|
113
|
-
rspec-core (3.13.
|
131
|
+
rspec-core (3.13.4)
|
114
132
|
rspec-support (~> 3.13.0)
|
115
|
-
rspec-expectations (3.13.
|
133
|
+
rspec-expectations (3.13.5)
|
116
134
|
diff-lcs (>= 1.2.0, < 2.0)
|
117
135
|
rspec-support (~> 3.13.0)
|
118
|
-
rspec-mocks (3.13.
|
136
|
+
rspec-mocks (3.13.5)
|
119
137
|
diff-lcs (>= 1.2.0, < 2.0)
|
120
138
|
rspec-support (~> 3.13.0)
|
121
|
-
rspec-support (3.13.
|
122
|
-
securerandom (0.
|
139
|
+
rspec-support (3.13.4)
|
140
|
+
securerandom (0.4.1)
|
123
141
|
simplecov (0.22.0)
|
124
142
|
docile (~> 1.1)
|
125
143
|
simplecov-html (~> 0.11)
|
126
144
|
simplecov_json_formatter (~> 0.1)
|
127
145
|
simplecov-html (0.13.1)
|
128
146
|
simplecov_json_formatter (0.1.4)
|
129
|
-
stringio (3.1.
|
147
|
+
stringio (3.1.7)
|
130
148
|
thor (1.3.2)
|
131
149
|
tzinfo (2.0.6)
|
132
150
|
concurrent-ruby (~> 1.0)
|
133
151
|
unaccent (0.4.0)
|
134
|
-
useragent (0.16.
|
135
|
-
|
136
|
-
zeitwerk (2.6.18)
|
152
|
+
useragent (0.16.11)
|
153
|
+
zeitwerk (2.7.3)
|
137
154
|
|
138
155
|
PLATFORMS
|
139
156
|
aarch64-linux
|
157
|
+
aarch64-linux-gnu
|
158
|
+
aarch64-linux-musl
|
140
159
|
arm-linux
|
160
|
+
arm-linux-gnu
|
161
|
+
arm-linux-musl
|
141
162
|
arm64-darwin
|
163
|
+
ruby
|
142
164
|
x86-linux
|
143
165
|
x86_64-darwin
|
144
166
|
x86_64-linux
|
167
|
+
x86_64-linux-gnu
|
168
|
+
x86_64-linux-musl
|
145
169
|
|
146
170
|
DEPENDENCIES
|
147
171
|
actionpack (~> 7.2.0)
|
148
172
|
country_select!
|
149
|
-
nokogiri (~> 1.
|
173
|
+
nokogiri (~> 1.18)
|
150
174
|
pry (~> 0)
|
151
175
|
railties (~> 7.2.0)
|
152
176
|
rake (~> 13)
|
@@ -154,4 +178,4 @@ DEPENDENCIES
|
|
154
178
|
simplecov (~> 0.22)
|
155
179
|
|
156
180
|
BUNDLED WITH
|
157
|
-
2.
|
181
|
+
2.6.2
|
@@ -0,0 +1,174 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
country_select (10.0.1)
|
5
|
+
countries (> 6.0, < 9.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionpack (8.0.2)
|
11
|
+
actionview (= 8.0.2)
|
12
|
+
activesupport (= 8.0.2)
|
13
|
+
nokogiri (>= 1.8.5)
|
14
|
+
rack (>= 2.2.4)
|
15
|
+
rack-session (>= 1.0.1)
|
16
|
+
rack-test (>= 0.6.3)
|
17
|
+
rails-dom-testing (~> 2.2)
|
18
|
+
rails-html-sanitizer (~> 1.6)
|
19
|
+
useragent (~> 0.16)
|
20
|
+
actionview (8.0.2)
|
21
|
+
activesupport (= 8.0.2)
|
22
|
+
builder (~> 3.1)
|
23
|
+
erubi (~> 1.11)
|
24
|
+
rails-dom-testing (~> 2.2)
|
25
|
+
rails-html-sanitizer (~> 1.6)
|
26
|
+
activesupport (8.0.2)
|
27
|
+
base64
|
28
|
+
benchmark (>= 0.3)
|
29
|
+
bigdecimal
|
30
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
31
|
+
connection_pool (>= 2.2.5)
|
32
|
+
drb
|
33
|
+
i18n (>= 1.6, < 2)
|
34
|
+
logger (>= 1.4.2)
|
35
|
+
minitest (>= 5.1)
|
36
|
+
securerandom (>= 0.3)
|
37
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
38
|
+
uri (>= 0.13.1)
|
39
|
+
base64 (0.3.0)
|
40
|
+
benchmark (0.4.1)
|
41
|
+
bigdecimal (3.2.1)
|
42
|
+
builder (3.3.0)
|
43
|
+
coderay (1.1.3)
|
44
|
+
concurrent-ruby (1.3.5)
|
45
|
+
connection_pool (2.5.3)
|
46
|
+
countries (8.0.0)
|
47
|
+
unaccent (~> 0.3)
|
48
|
+
crass (1.0.6)
|
49
|
+
date (3.4.1)
|
50
|
+
diff-lcs (1.6.2)
|
51
|
+
docile (1.4.1)
|
52
|
+
drb (2.2.3)
|
53
|
+
erb (5.0.1)
|
54
|
+
erubi (1.13.1)
|
55
|
+
i18n (1.14.7)
|
56
|
+
concurrent-ruby (~> 1.0)
|
57
|
+
io-console (0.8.0)
|
58
|
+
irb (1.15.2)
|
59
|
+
pp (>= 0.6.0)
|
60
|
+
rdoc (>= 4.0.0)
|
61
|
+
reline (>= 0.4.2)
|
62
|
+
logger (1.7.0)
|
63
|
+
loofah (2.24.1)
|
64
|
+
crass (~> 1.0.2)
|
65
|
+
nokogiri (>= 1.12.0)
|
66
|
+
method_source (1.1.0)
|
67
|
+
minitest (5.25.5)
|
68
|
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
69
|
+
racc (~> 1.4)
|
70
|
+
nokogiri (1.18.8-aarch64-linux-musl)
|
71
|
+
racc (~> 1.4)
|
72
|
+
nokogiri (1.18.8-arm-linux-gnu)
|
73
|
+
racc (~> 1.4)
|
74
|
+
nokogiri (1.18.8-arm-linux-musl)
|
75
|
+
racc (~> 1.4)
|
76
|
+
nokogiri (1.18.8-arm64-darwin)
|
77
|
+
racc (~> 1.4)
|
78
|
+
nokogiri (1.18.8-x86_64-darwin)
|
79
|
+
racc (~> 1.4)
|
80
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
81
|
+
racc (~> 1.4)
|
82
|
+
nokogiri (1.18.8-x86_64-linux-musl)
|
83
|
+
racc (~> 1.4)
|
84
|
+
pp (0.6.2)
|
85
|
+
prettyprint
|
86
|
+
prettyprint (0.2.0)
|
87
|
+
pry (0.15.2)
|
88
|
+
coderay (~> 1.1)
|
89
|
+
method_source (~> 1.0)
|
90
|
+
psych (5.2.6)
|
91
|
+
date
|
92
|
+
stringio
|
93
|
+
racc (1.8.1)
|
94
|
+
rack (3.1.15)
|
95
|
+
rack-session (2.1.1)
|
96
|
+
base64 (>= 0.1.0)
|
97
|
+
rack (>= 3.0.0)
|
98
|
+
rack-test (2.2.0)
|
99
|
+
rack (>= 1.3)
|
100
|
+
rackup (2.2.1)
|
101
|
+
rack (>= 3)
|
102
|
+
rails-dom-testing (2.3.0)
|
103
|
+
activesupport (>= 5.0.0)
|
104
|
+
minitest
|
105
|
+
nokogiri (>= 1.6)
|
106
|
+
rails-html-sanitizer (1.6.2)
|
107
|
+
loofah (~> 2.21)
|
108
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
109
|
+
railties (8.0.2)
|
110
|
+
actionpack (= 8.0.2)
|
111
|
+
activesupport (= 8.0.2)
|
112
|
+
irb (~> 1.13)
|
113
|
+
rackup (>= 1.0.0)
|
114
|
+
rake (>= 12.2)
|
115
|
+
thor (~> 1.0, >= 1.2.2)
|
116
|
+
zeitwerk (~> 2.6)
|
117
|
+
rake (13.3.0)
|
118
|
+
rdoc (6.14.0)
|
119
|
+
erb
|
120
|
+
psych (>= 4.0.0)
|
121
|
+
reline (0.6.1)
|
122
|
+
io-console (~> 0.5)
|
123
|
+
rspec (3.13.1)
|
124
|
+
rspec-core (~> 3.13.0)
|
125
|
+
rspec-expectations (~> 3.13.0)
|
126
|
+
rspec-mocks (~> 3.13.0)
|
127
|
+
rspec-core (3.13.4)
|
128
|
+
rspec-support (~> 3.13.0)
|
129
|
+
rspec-expectations (3.13.5)
|
130
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
131
|
+
rspec-support (~> 3.13.0)
|
132
|
+
rspec-mocks (3.13.5)
|
133
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
134
|
+
rspec-support (~> 3.13.0)
|
135
|
+
rspec-support (3.13.4)
|
136
|
+
securerandom (0.4.1)
|
137
|
+
simplecov (0.22.0)
|
138
|
+
docile (~> 1.1)
|
139
|
+
simplecov-html (~> 0.11)
|
140
|
+
simplecov_json_formatter (~> 0.1)
|
141
|
+
simplecov-html (0.13.1)
|
142
|
+
simplecov_json_formatter (0.1.4)
|
143
|
+
stringio (3.1.7)
|
144
|
+
thor (1.3.2)
|
145
|
+
tzinfo (2.0.6)
|
146
|
+
concurrent-ruby (~> 1.0)
|
147
|
+
unaccent (0.4.0)
|
148
|
+
uri (1.0.3)
|
149
|
+
useragent (0.16.11)
|
150
|
+
zeitwerk (2.7.3)
|
151
|
+
|
152
|
+
PLATFORMS
|
153
|
+
aarch64-linux-gnu
|
154
|
+
aarch64-linux-musl
|
155
|
+
arm-linux-gnu
|
156
|
+
arm-linux-musl
|
157
|
+
arm64-darwin
|
158
|
+
x86_64-darwin
|
159
|
+
x86_64-linux
|
160
|
+
x86_64-linux-gnu
|
161
|
+
x86_64-linux-musl
|
162
|
+
|
163
|
+
DEPENDENCIES
|
164
|
+
actionpack (~> 8.0.0)
|
165
|
+
country_select!
|
166
|
+
nokogiri (~> 1.18)
|
167
|
+
pry (~> 0)
|
168
|
+
railties (~> 8.0.0)
|
169
|
+
rake (~> 13)
|
170
|
+
rspec (~> 3)
|
171
|
+
simplecov (~> 0.22)
|
172
|
+
|
173
|
+
BUNDLED WITH
|
174
|
+
2.6.2
|
@@ -43,10 +43,6 @@ module CountrySelect
|
|
43
43
|
@options.fetch(:priority_countries, ::CountrySelect::DEFAULTS[:priority_countries])
|
44
44
|
end
|
45
45
|
|
46
|
-
def priority_countries_divider
|
47
|
-
@options.fetch(:priority_countries_divider, ::CountrySelect::DEFAULTS[:priority_countries_divider])
|
48
|
-
end
|
49
|
-
|
50
46
|
def only_country_codes
|
51
47
|
@options.fetch(:only, ::CountrySelect::DEFAULTS[:only])
|
52
48
|
end
|
@@ -77,7 +73,14 @@ module CountrySelect
|
|
77
73
|
I18n.with_locale(locale) do
|
78
74
|
country_list = country_codes.map { |code_or_name| get_formatted_country(code_or_name) }
|
79
75
|
|
80
|
-
country_list.sort_by! { |name, _|
|
76
|
+
country_list.sort_by! { |name, _|
|
77
|
+
transliterated_name = I18n.transliterate(name.to_s)
|
78
|
+
if transliterated_name.include?('?') # For languages that cannot be transliterated (e.g. languages with non-Latin scripts)
|
79
|
+
[name, name] # If transliteration fails, duplicate the original name to maintain a consistent two-element array structure.
|
80
|
+
else
|
81
|
+
[transliterated_name, name]
|
82
|
+
end
|
83
|
+
} if sorted
|
81
84
|
country_list
|
82
85
|
end
|
83
86
|
end
|
@@ -98,9 +101,7 @@ module CountrySelect
|
|
98
101
|
end
|
99
102
|
|
100
103
|
def priority_options_for_select(priority_countries_options, tags_options)
|
101
|
-
|
102
|
-
option_tags += "\n".html_safe +
|
103
|
-
options_for_select([priority_countries_divider], disabled: priority_countries_divider)
|
104
|
+
options_for_select(priority_countries_options, tags_options) + "\n<hr>".html_safe
|
104
105
|
end
|
105
106
|
|
106
107
|
def get_formatted_country(code_or_name)
|
data/spec/country_select_spec.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
+
require 'uri'
|
5
6
|
require 'action_view'
|
6
7
|
require 'country_select'
|
7
8
|
|
@@ -94,12 +95,10 @@ describe 'CountrySelect' do
|
|
94
95
|
[
|
95
96
|
['Denmark', 'DK'],
|
96
97
|
['Latvia', 'LV'],
|
97
|
-
['United States', 'US']
|
98
|
-
['-' * 15, '-' * 15]
|
98
|
+
['United States', 'US']
|
99
99
|
],
|
100
|
-
selected: 'US'
|
101
|
-
|
102
|
-
)
|
100
|
+
selected: 'US'
|
101
|
+
) + "\n<hr>".html_safe
|
103
102
|
|
104
103
|
walrus.country_code = 'US'
|
105
104
|
t = builder.country_select(:country_code, priority_countries: %w[LV US DK])
|
@@ -111,12 +110,10 @@ describe 'CountrySelect' do
|
|
111
110
|
[
|
112
111
|
['Denmark', 'DK'],
|
113
112
|
['Latvia', 'LV'],
|
114
|
-
['United States', 'US']
|
115
|
-
['-' * 15, '-' * 15]
|
113
|
+
['United States', 'US']
|
116
114
|
],
|
117
|
-
selected: 'US'
|
118
|
-
|
119
|
-
)
|
115
|
+
selected: 'US'
|
116
|
+
) + "\n<hr>".html_safe
|
120
117
|
|
121
118
|
walrus.country_code = 'US'
|
122
119
|
t = builder.country_select(:country_code, priority_countries: %w[LV US DK])
|
@@ -128,12 +125,10 @@ describe 'CountrySelect' do
|
|
128
125
|
[
|
129
126
|
['Latvia', 'LV'],
|
130
127
|
['United States', 'US'],
|
131
|
-
['Denmark', 'DK']
|
132
|
-
['-' * 15, '-' * 15]
|
128
|
+
['Denmark', 'DK']
|
133
129
|
],
|
134
130
|
selected: 'US',
|
135
|
-
|
136
|
-
)
|
131
|
+
) + "\n<hr>".html_safe
|
137
132
|
|
138
133
|
walrus.country_code = 'US'
|
139
134
|
t = builder.country_select(:country_code, priority_countries: %w[LV US DK], sort_provided: false)
|
@@ -145,12 +140,13 @@ describe 'CountrySelect' do
|
|
145
140
|
[
|
146
141
|
['Latvia', 'LV'],
|
147
142
|
['United States', 'US'],
|
148
|
-
['Denmark', 'DK']
|
149
|
-
|
143
|
+
['Denmark', 'DK']
|
144
|
+
]
|
145
|
+
) + "\n<hr>\n".html_safe + options_for_select(
|
146
|
+
[
|
150
147
|
['Afghanistan', 'AF']
|
151
148
|
],
|
152
|
-
selected: 'AF'
|
153
|
-
disabled: '-' * 15
|
149
|
+
selected: 'AF'
|
154
150
|
)
|
155
151
|
|
156
152
|
walrus.country_code = 'AF'
|
@@ -237,6 +233,16 @@ describe 'CountrySelect' do
|
|
237
233
|
expect(order).to eq(%w[AF AX AL ZW])
|
238
234
|
end
|
239
235
|
|
236
|
+
it 'sorts non-Latin strings' do
|
237
|
+
I18n.available_locales = [:ja]
|
238
|
+
I18n.locale = :ja
|
239
|
+
ISO3166.reset
|
240
|
+
|
241
|
+
tag = builder.country_select(:country_code, only: %w[US CN JP KR])
|
242
|
+
order = tag.scan(/value="(\w{2})"/).map { |o| o[0] }
|
243
|
+
expect(order).to eq(%w[CN KR JP US])
|
244
|
+
end
|
245
|
+
|
240
246
|
describe 'custom formats' do
|
241
247
|
it 'accepts a custom formatter' do
|
242
248
|
CountrySelect::FORMATS[:with_alpha2] = lambda do |country|
|
metadata
CHANGED
@@ -1,29 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: country_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Penner
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: actionpack
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '7.0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '7.0'
|
27
12
|
- !ruby/object:Gem::Dependency
|
28
13
|
name: pry
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,20 +71,20 @@ dependencies:
|
|
86
71
|
requirements:
|
87
72
|
- - ">"
|
88
73
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
74
|
+
version: '6.0'
|
90
75
|
- - "<"
|
91
76
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
77
|
+
version: '9.0'
|
93
78
|
type: :runtime
|
94
79
|
prerelease: false
|
95
80
|
version_requirements: !ruby/object:Gem::Requirement
|
96
81
|
requirements:
|
97
82
|
- - ">"
|
98
83
|
- !ruby/object:Gem::Version
|
99
|
-
version: '
|
84
|
+
version: '6.0'
|
100
85
|
- - "<"
|
101
86
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
87
|
+
version: '9.0'
|
103
88
|
description: |-
|
104
89
|
Provides a simple helper to get an HTML select list of countries. \
|
105
90
|
The list of countries comes from the ISO 3166 standard. \
|
@@ -124,14 +109,12 @@ files:
|
|
124
109
|
- Rakefile
|
125
110
|
- UPGRADING.md
|
126
111
|
- country_select.gemspec
|
127
|
-
- gemfiles/actionpack-6.1.gemfile
|
128
|
-
- gemfiles/actionpack-6.1.gemfile.lock
|
129
|
-
- gemfiles/actionpack-7.0.gemfile
|
130
|
-
- gemfiles/actionpack-7.0.gemfile.lock
|
131
112
|
- gemfiles/actionpack-7.1.gemfile
|
132
113
|
- gemfiles/actionpack-7.1.gemfile.lock
|
133
114
|
- gemfiles/actionpack-7.2.gemfile
|
134
115
|
- gemfiles/actionpack-7.2.gemfile.lock
|
116
|
+
- gemfiles/actionpack-8.0.gemfile
|
117
|
+
- gemfiles/actionpack-8.0.gemfile.lock
|
135
118
|
- lib/country_select.rb
|
136
119
|
- lib/country_select/country_select_helper.rb
|
137
120
|
- lib/country_select/defaults.rb
|
@@ -148,7 +131,6 @@ metadata:
|
|
148
131
|
changelog_uri: https://github.com/countries/country_select/blob/master/CHANGELOG.md
|
149
132
|
source_code_uri: https://github.com/countries/country_select
|
150
133
|
rubygems_mfa_required: 'true'
|
151
|
-
post_install_message:
|
152
134
|
rdoc_options: []
|
153
135
|
require_paths:
|
154
136
|
- lib
|
@@ -156,15 +138,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
138
|
requirements:
|
157
139
|
- - ">="
|
158
140
|
- !ruby/object:Gem::Version
|
159
|
-
version: '3.
|
141
|
+
version: '3.2'
|
160
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
143
|
requirements:
|
162
144
|
- - ">="
|
163
145
|
- !ruby/object:Gem::Version
|
164
146
|
version: '0'
|
165
147
|
requirements: []
|
166
|
-
rubygems_version: 3.
|
167
|
-
signing_key:
|
148
|
+
rubygems_version: 3.6.8
|
168
149
|
specification_version: 4
|
169
150
|
summary: Country Select Plugin
|
170
151
|
test_files: []
|