country_select 8.0.0 → 8.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +2 -2
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +37 -34
- data/README.md +1 -7
- data/Rakefile +2 -2
- data/gemfiles/actionpack-5.2.gemfile +1 -0
- data/gemfiles/actionpack-5.2.gemfile.lock +38 -37
- data/gemfiles/actionpack-6.0.gemfile +1 -0
- data/gemfiles/actionpack-6.0.gemfile.lock +39 -38
- data/gemfiles/actionpack-6.1.gemfile +1 -0
- data/gemfiles/actionpack-6.1.gemfile.lock +39 -38
- data/gemfiles/actionpack-7.0.gemfile +1 -0
- data/gemfiles/actionpack-7.0.gemfile.lock +39 -38
- data/lib/country_select/tag_helper.rb +8 -9
- data/lib/country_select/version.rb +1 -1
- data/spec/country_select_spec.rb +18 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 674674f152073e1e9b8834bbe5bf012c704ac9f128c664a2b2b46891081bc502
|
4
|
+
data.tar.gz: 9b0670886ec8b5ad3961c446adf4a9a4497e5edbeb1822c7c5cb94fbf6694a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd10c341e06f4f72318446e7f8115cf63da4800d2314955c755fab4f0328b53cecdf784385011d55c45edec12bca5d2929c7dd4f21605e46c10227db1d17871e
|
7
|
+
data.tar.gz: 93c7f859aada39e88724fed5a6b508bc84155191a168b1a007c0478b01339faf831752e5c22b25d3ddf98c3c5211e5b35bfd691581818e7e0edcb89ab88e765c
|
data/.github/workflows/build.yml
CHANGED
@@ -12,12 +12,12 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
fail-fast: false
|
14
14
|
matrix:
|
15
|
-
ruby: [2.7, '3.0', 3.1]
|
15
|
+
ruby: [2.7, '3.0', 3.1, 3.2]
|
16
16
|
gemfile: [5.2, '6.0', 6.1, '7.0']
|
17
17
|
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
18
18
|
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/actionpack-${{ matrix.gemfile }}.gemfile
|
19
19
|
steps:
|
20
|
-
- uses: actions/checkout@
|
20
|
+
- uses: actions/checkout@v3
|
21
21
|
- uses: ruby/setup-ruby@v1
|
22
22
|
with:
|
23
23
|
ruby-version: ${{ matrix.ruby }}
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 8.0.1 2023-01-03
|
2
|
+
|
3
|
+
* Update README.md by (@ron-shinall)
|
4
|
+
* Update installation instructions by (@henrik)
|
5
|
+
* Fix deprecated File.exists? on ruby 3.2.0 by (@JNajera212)
|
6
|
+
* Fix priority country sorting bug by (@pmor)
|
7
|
+
* Update countries gem to 5.3.0 (@pmor)
|
8
|
+
|
1
9
|
## 8.0.0 2022-06-30
|
2
10
|
|
3
11
|
* Update countries gem to 5.1.0 (@pmor)
|
data/Gemfile.lock
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
country_select (
|
4
|
+
country_select (8.0.1)
|
5
5
|
countries (~> 5.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (7.0.
|
11
|
-
actionview (= 7.0.
|
12
|
-
activesupport (= 7.0.
|
10
|
+
actionpack (7.0.4)
|
11
|
+
actionview (= 7.0.4)
|
12
|
+
activesupport (= 7.0.4)
|
13
13
|
rack (~> 2.0, >= 2.2.0)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
16
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
-
actionview (7.0.
|
18
|
-
activesupport (= 7.0.
|
17
|
+
actionview (7.0.4)
|
18
|
+
activesupport (= 7.0.4)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
22
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
-
activesupport (7.0.
|
23
|
+
activesupport (7.0.4)
|
24
24
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
25
|
i18n (>= 1.6, < 2)
|
26
26
|
minitest (>= 5.1)
|
@@ -28,52 +28,55 @@ GEM
|
|
28
28
|
builder (3.2.4)
|
29
29
|
coderay (1.1.3)
|
30
30
|
concurrent-ruby (1.1.10)
|
31
|
-
countries (5.
|
32
|
-
|
31
|
+
countries (5.3.0)
|
32
|
+
unaccent (~> 0.3)
|
33
33
|
crass (1.0.6)
|
34
34
|
diff-lcs (1.5.0)
|
35
|
-
erubi (1.
|
36
|
-
i18n (1.
|
35
|
+
erubi (1.12.0)
|
36
|
+
i18n (1.12.0)
|
37
37
|
concurrent-ruby (~> 1.0)
|
38
|
-
loofah (2.
|
38
|
+
loofah (2.19.1)
|
39
39
|
crass (~> 1.0.2)
|
40
40
|
nokogiri (>= 1.5.9)
|
41
41
|
method_source (1.0.0)
|
42
|
-
minitest (5.
|
43
|
-
nokogiri (1.
|
42
|
+
minitest (5.17.0)
|
43
|
+
nokogiri (1.14.0.rc1-x86_64-darwin)
|
44
|
+
racc (~> 1.4)
|
45
|
+
nokogiri (1.14.0.rc1-x86_64-linux)
|
44
46
|
racc (~> 1.4)
|
45
47
|
pry (0.14.1)
|
46
48
|
coderay (~> 1.1)
|
47
49
|
method_source (~> 1.0)
|
48
|
-
racc (1.6.
|
49
|
-
rack (2.2.
|
50
|
-
rack-test (2.0.
|
50
|
+
racc (1.6.2)
|
51
|
+
rack (2.2.5)
|
52
|
+
rack-test (2.0.2)
|
51
53
|
rack (>= 1.3)
|
52
54
|
rails-dom-testing (2.0.3)
|
53
55
|
activesupport (>= 4.2.0)
|
54
56
|
nokogiri (>= 1.6)
|
55
|
-
rails-html-sanitizer (1.4.
|
56
|
-
loofah (~> 2.
|
57
|
+
rails-html-sanitizer (1.4.4)
|
58
|
+
loofah (~> 2.19, >= 2.19.1)
|
57
59
|
rake (13.0.6)
|
58
|
-
rspec (3.
|
59
|
-
rspec-core (~> 3.
|
60
|
-
rspec-expectations (~> 3.
|
61
|
-
rspec-mocks (~> 3.
|
62
|
-
rspec-core (3.
|
63
|
-
rspec-support (~> 3.
|
64
|
-
rspec-expectations (3.
|
60
|
+
rspec (3.12.0)
|
61
|
+
rspec-core (~> 3.12.0)
|
62
|
+
rspec-expectations (~> 3.12.0)
|
63
|
+
rspec-mocks (~> 3.12.0)
|
64
|
+
rspec-core (3.12.0)
|
65
|
+
rspec-support (~> 3.12.0)
|
66
|
+
rspec-expectations (3.12.1)
|
65
67
|
diff-lcs (>= 1.2.0, < 2.0)
|
66
|
-
rspec-support (~> 3.
|
67
|
-
rspec-mocks (3.
|
68
|
+
rspec-support (~> 3.12.0)
|
69
|
+
rspec-mocks (3.12.1)
|
68
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
-
rspec-support (~> 3.
|
70
|
-
rspec-support (3.
|
71
|
-
|
72
|
-
tzinfo (2.0.4)
|
71
|
+
rspec-support (~> 3.12.0)
|
72
|
+
rspec-support (3.12.0)
|
73
|
+
tzinfo (2.0.5)
|
73
74
|
concurrent-ruby (~> 1.0)
|
75
|
+
unaccent (0.4.0)
|
74
76
|
|
75
77
|
PLATFORMS
|
76
|
-
x86_64-darwin-
|
78
|
+
x86_64-darwin-22
|
79
|
+
x86_64-linux
|
77
80
|
|
78
81
|
DEPENDENCIES
|
79
82
|
actionpack (~> 7.0)
|
@@ -83,4 +86,4 @@ DEPENDENCIES
|
|
83
86
|
rspec (~> 3)
|
84
87
|
|
85
88
|
BUNDLED WITH
|
86
|
-
2.
|
89
|
+
2.4.2
|
data/README.md
CHANGED
@@ -29,13 +29,7 @@ gem install country_select
|
|
29
29
|
Or put the following in your Gemfile
|
30
30
|
|
31
31
|
```ruby
|
32
|
-
gem 'country_select', '~>
|
33
|
-
```
|
34
|
-
|
35
|
-
If you don't want to require `sort_alphabetical` (it depends on `unicode_utils` which is known to use lots of memory) you can opt out of using it as follows:
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
gem 'country_select', require: 'country_select_without_sort_alphabetical'
|
32
|
+
gem 'country_select', '~> 8.0'
|
39
33
|
```
|
40
34
|
|
41
35
|
## Usage
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ task :update_gemfiles do
|
|
20
20
|
|
21
21
|
lockfile = "#{gemfile}.lock"
|
22
22
|
|
23
|
-
if File.
|
23
|
+
if File.exist? lockfile
|
24
24
|
parsed_lockfile = Bundler::LockfileParser.new(Bundler.read_file(lockfile))
|
25
25
|
# Ensure lockfile has x86_64-linux
|
26
26
|
if parsed_lockfile.platforms.map(&:to_s).none? {|p| p == 'x86_64-linux' }
|
@@ -33,4 +33,4 @@ task :update_gemfiles do
|
|
33
33
|
raise StandardError.new("Expected #{lockfile} to exist.")
|
34
34
|
end
|
35
35
|
end
|
36
|
-
end
|
36
|
+
end
|
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
country_select (
|
4
|
+
country_select (8.0.1)
|
5
5
|
countries (~> 5.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (5.2.8)
|
11
|
-
actionview (= 5.2.8)
|
12
|
-
activesupport (= 5.2.8)
|
10
|
+
actionpack (5.2.8.1)
|
11
|
+
actionview (= 5.2.8.1)
|
12
|
+
activesupport (= 5.2.8.1)
|
13
13
|
rack (~> 2.0, >= 2.0.8)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
16
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
-
actionview (5.2.8)
|
18
|
-
activesupport (= 5.2.8)
|
17
|
+
actionview (5.2.8.1)
|
18
|
+
activesupport (= 5.2.8.1)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
22
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
23
|
-
activesupport (5.2.8)
|
23
|
+
activesupport (5.2.8.1)
|
24
24
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
25
|
i18n (>= 0.7, < 2)
|
26
26
|
minitest (~> 5.1)
|
@@ -28,71 +28,72 @@ GEM
|
|
28
28
|
builder (3.2.4)
|
29
29
|
coderay (1.1.3)
|
30
30
|
concurrent-ruby (1.1.10)
|
31
|
-
countries (5.
|
32
|
-
|
31
|
+
countries (5.3.0)
|
32
|
+
unaccent (~> 0.3)
|
33
33
|
crass (1.0.6)
|
34
34
|
diff-lcs (1.5.0)
|
35
|
-
erubi (1.
|
36
|
-
i18n (1.
|
35
|
+
erubi (1.12.0)
|
36
|
+
i18n (1.12.0)
|
37
37
|
concurrent-ruby (~> 1.0)
|
38
|
-
loofah (2.
|
38
|
+
loofah (2.19.1)
|
39
39
|
crass (~> 1.0.2)
|
40
40
|
nokogiri (>= 1.5.9)
|
41
41
|
method_source (1.0.0)
|
42
|
-
minitest (5.
|
43
|
-
nokogiri (1.
|
42
|
+
minitest (5.17.0)
|
43
|
+
nokogiri (1.14.0.rc1-x86_64-darwin)
|
44
44
|
racc (~> 1.4)
|
45
|
-
nokogiri (1.
|
45
|
+
nokogiri (1.14.0.rc1-x86_64-linux)
|
46
46
|
racc (~> 1.4)
|
47
47
|
pry (0.14.1)
|
48
48
|
coderay (~> 1.1)
|
49
49
|
method_source (~> 1.0)
|
50
|
-
racc (1.6.
|
51
|
-
rack (2.2.
|
50
|
+
racc (1.6.2)
|
51
|
+
rack (2.2.5)
|
52
52
|
rack-test (2.0.2)
|
53
53
|
rack (>= 1.3)
|
54
54
|
rails-dom-testing (2.0.3)
|
55
55
|
activesupport (>= 4.2.0)
|
56
56
|
nokogiri (>= 1.6)
|
57
|
-
rails-html-sanitizer (1.4.
|
58
|
-
loofah (~> 2.
|
59
|
-
railties (5.2.8)
|
60
|
-
actionpack (= 5.2.8)
|
61
|
-
activesupport (= 5.2.8)
|
57
|
+
rails-html-sanitizer (1.4.4)
|
58
|
+
loofah (~> 2.19, >= 2.19.1)
|
59
|
+
railties (5.2.8.1)
|
60
|
+
actionpack (= 5.2.8.1)
|
61
|
+
activesupport (= 5.2.8.1)
|
62
62
|
method_source
|
63
63
|
rake (>= 0.8.7)
|
64
64
|
thor (>= 0.19.0, < 2.0)
|
65
65
|
rake (13.0.6)
|
66
|
-
rspec (3.
|
67
|
-
rspec-core (~> 3.
|
68
|
-
rspec-expectations (~> 3.
|
69
|
-
rspec-mocks (~> 3.
|
70
|
-
rspec-core (3.
|
71
|
-
rspec-support (~> 3.
|
72
|
-
rspec-expectations (3.
|
66
|
+
rspec (3.12.0)
|
67
|
+
rspec-core (~> 3.12.0)
|
68
|
+
rspec-expectations (~> 3.12.0)
|
69
|
+
rspec-mocks (~> 3.12.0)
|
70
|
+
rspec-core (3.12.0)
|
71
|
+
rspec-support (~> 3.12.0)
|
72
|
+
rspec-expectations (3.12.1)
|
73
73
|
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
-
rspec-support (~> 3.
|
75
|
-
rspec-mocks (3.
|
74
|
+
rspec-support (~> 3.12.0)
|
75
|
+
rspec-mocks (3.12.1)
|
76
76
|
diff-lcs (>= 1.2.0, < 2.0)
|
77
|
-
rspec-support (~> 3.
|
78
|
-
rspec-support (3.
|
79
|
-
sixarm_ruby_unaccent (1.2.0)
|
77
|
+
rspec-support (~> 3.12.0)
|
78
|
+
rspec-support (3.12.0)
|
80
79
|
thor (1.2.1)
|
81
80
|
thread_safe (0.3.6)
|
82
|
-
tzinfo (1.2.
|
81
|
+
tzinfo (1.2.10)
|
83
82
|
thread_safe (~> 0.1)
|
83
|
+
unaccent (0.4.0)
|
84
84
|
|
85
85
|
PLATFORMS
|
86
|
-
x86_64-darwin-
|
86
|
+
x86_64-darwin-22
|
87
87
|
x86_64-linux
|
88
88
|
|
89
89
|
DEPENDENCIES
|
90
90
|
actionpack (~> 5.2.0)
|
91
91
|
country_select!
|
92
|
+
nokogiri (= 1.14.0.rc1)
|
92
93
|
pry (~> 0)
|
93
94
|
railties (~> 5.2.0)
|
94
95
|
rake (~> 13)
|
95
96
|
rspec (~> 3)
|
96
97
|
|
97
98
|
BUNDLED WITH
|
98
|
-
2.
|
99
|
+
2.4.2
|
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
country_select (
|
4
|
+
country_select (8.0.1)
|
5
5
|
countries (~> 5.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (6.0.
|
11
|
-
actionview (= 6.0.
|
12
|
-
activesupport (= 6.0.
|
10
|
+
actionpack (6.0.6)
|
11
|
+
actionview (= 6.0.6)
|
12
|
+
activesupport (= 6.0.6)
|
13
13
|
rack (~> 2.0, >= 2.0.8)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
16
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
-
actionview (6.0.
|
18
|
-
activesupport (= 6.0.
|
17
|
+
actionview (6.0.6)
|
18
|
+
activesupport (= 6.0.6)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
22
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
-
activesupport (6.0.
|
23
|
+
activesupport (6.0.6)
|
24
24
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
25
|
i18n (>= 0.7, < 2)
|
26
26
|
minitest (~> 5.1)
|
@@ -29,72 +29,73 @@ GEM
|
|
29
29
|
builder (3.2.4)
|
30
30
|
coderay (1.1.3)
|
31
31
|
concurrent-ruby (1.1.10)
|
32
|
-
countries (5.
|
33
|
-
|
32
|
+
countries (5.3.0)
|
33
|
+
unaccent (~> 0.3)
|
34
34
|
crass (1.0.6)
|
35
35
|
diff-lcs (1.5.0)
|
36
|
-
erubi (1.
|
37
|
-
i18n (1.
|
36
|
+
erubi (1.12.0)
|
37
|
+
i18n (1.12.0)
|
38
38
|
concurrent-ruby (~> 1.0)
|
39
|
-
loofah (2.
|
39
|
+
loofah (2.19.1)
|
40
40
|
crass (~> 1.0.2)
|
41
41
|
nokogiri (>= 1.5.9)
|
42
42
|
method_source (1.0.0)
|
43
|
-
minitest (5.
|
44
|
-
nokogiri (1.
|
43
|
+
minitest (5.17.0)
|
44
|
+
nokogiri (1.14.0.rc1-x86_64-darwin)
|
45
45
|
racc (~> 1.4)
|
46
|
-
nokogiri (1.
|
46
|
+
nokogiri (1.14.0.rc1-x86_64-linux)
|
47
47
|
racc (~> 1.4)
|
48
48
|
pry (0.14.1)
|
49
49
|
coderay (~> 1.1)
|
50
50
|
method_source (~> 1.0)
|
51
|
-
racc (1.6.
|
52
|
-
rack (2.2.
|
51
|
+
racc (1.6.2)
|
52
|
+
rack (2.2.5)
|
53
53
|
rack-test (2.0.2)
|
54
54
|
rack (>= 1.3)
|
55
55
|
rails-dom-testing (2.0.3)
|
56
56
|
activesupport (>= 4.2.0)
|
57
57
|
nokogiri (>= 1.6)
|
58
|
-
rails-html-sanitizer (1.4.
|
59
|
-
loofah (~> 2.
|
60
|
-
railties (6.0.
|
61
|
-
actionpack (= 6.0.
|
62
|
-
activesupport (= 6.0.
|
58
|
+
rails-html-sanitizer (1.4.4)
|
59
|
+
loofah (~> 2.19, >= 2.19.1)
|
60
|
+
railties (6.0.6)
|
61
|
+
actionpack (= 6.0.6)
|
62
|
+
activesupport (= 6.0.6)
|
63
63
|
method_source
|
64
64
|
rake (>= 0.8.7)
|
65
65
|
thor (>= 0.20.3, < 2.0)
|
66
66
|
rake (13.0.6)
|
67
|
-
rspec (3.
|
68
|
-
rspec-core (~> 3.
|
69
|
-
rspec-expectations (~> 3.
|
70
|
-
rspec-mocks (~> 3.
|
71
|
-
rspec-core (3.
|
72
|
-
rspec-support (~> 3.
|
73
|
-
rspec-expectations (3.
|
67
|
+
rspec (3.12.0)
|
68
|
+
rspec-core (~> 3.12.0)
|
69
|
+
rspec-expectations (~> 3.12.0)
|
70
|
+
rspec-mocks (~> 3.12.0)
|
71
|
+
rspec-core (3.12.0)
|
72
|
+
rspec-support (~> 3.12.0)
|
73
|
+
rspec-expectations (3.12.1)
|
74
74
|
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
-
rspec-support (~> 3.
|
76
|
-
rspec-mocks (3.
|
75
|
+
rspec-support (~> 3.12.0)
|
76
|
+
rspec-mocks (3.12.1)
|
77
77
|
diff-lcs (>= 1.2.0, < 2.0)
|
78
|
-
rspec-support (~> 3.
|
79
|
-
rspec-support (3.
|
80
|
-
sixarm_ruby_unaccent (1.2.0)
|
78
|
+
rspec-support (~> 3.12.0)
|
79
|
+
rspec-support (3.12.0)
|
81
80
|
thor (1.2.1)
|
82
81
|
thread_safe (0.3.6)
|
83
|
-
tzinfo (1.2.
|
82
|
+
tzinfo (1.2.10)
|
84
83
|
thread_safe (~> 0.1)
|
85
|
-
|
84
|
+
unaccent (0.4.0)
|
85
|
+
zeitwerk (2.6.6)
|
86
86
|
|
87
87
|
PLATFORMS
|
88
|
-
x86_64-darwin-
|
88
|
+
x86_64-darwin-22
|
89
89
|
x86_64-linux
|
90
90
|
|
91
91
|
DEPENDENCIES
|
92
92
|
actionpack (~> 6.0.0)
|
93
93
|
country_select!
|
94
|
+
nokogiri (= 1.14.0.rc1)
|
94
95
|
pry (~> 0)
|
95
96
|
railties (~> 6.0.0)
|
96
97
|
rake (~> 13)
|
97
98
|
rspec (~> 3)
|
98
99
|
|
99
100
|
BUNDLED WITH
|
100
|
-
2.
|
101
|
+
2.4.2
|
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
country_select (
|
4
|
+
country_select (8.0.1)
|
5
5
|
countries (~> 5.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (6.1.
|
11
|
-
actionview (= 6.1.
|
12
|
-
activesupport (= 6.1.
|
10
|
+
actionpack (6.1.7)
|
11
|
+
actionview (= 6.1.7)
|
12
|
+
activesupport (= 6.1.7)
|
13
13
|
rack (~> 2.0, >= 2.0.9)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
16
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
-
actionview (6.1.
|
18
|
-
activesupport (= 6.1.
|
17
|
+
actionview (6.1.7)
|
18
|
+
activesupport (= 6.1.7)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
22
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
-
activesupport (6.1.
|
23
|
+
activesupport (6.1.7)
|
24
24
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
25
|
i18n (>= 1.6, < 2)
|
26
26
|
minitest (>= 5.1)
|
@@ -29,71 +29,72 @@ GEM
|
|
29
29
|
builder (3.2.4)
|
30
30
|
coderay (1.1.3)
|
31
31
|
concurrent-ruby (1.1.10)
|
32
|
-
countries (5.
|
33
|
-
|
32
|
+
countries (5.3.0)
|
33
|
+
unaccent (~> 0.3)
|
34
34
|
crass (1.0.6)
|
35
35
|
diff-lcs (1.5.0)
|
36
|
-
erubi (1.
|
37
|
-
i18n (1.
|
36
|
+
erubi (1.12.0)
|
37
|
+
i18n (1.12.0)
|
38
38
|
concurrent-ruby (~> 1.0)
|
39
|
-
loofah (2.
|
39
|
+
loofah (2.19.1)
|
40
40
|
crass (~> 1.0.2)
|
41
41
|
nokogiri (>= 1.5.9)
|
42
42
|
method_source (1.0.0)
|
43
|
-
minitest (5.
|
44
|
-
nokogiri (1.
|
43
|
+
minitest (5.17.0)
|
44
|
+
nokogiri (1.14.0.rc1-x86_64-darwin)
|
45
45
|
racc (~> 1.4)
|
46
|
-
nokogiri (1.
|
46
|
+
nokogiri (1.14.0.rc1-x86_64-linux)
|
47
47
|
racc (~> 1.4)
|
48
48
|
pry (0.14.1)
|
49
49
|
coderay (~> 1.1)
|
50
50
|
method_source (~> 1.0)
|
51
|
-
racc (1.6.
|
52
|
-
rack (2.2.
|
51
|
+
racc (1.6.2)
|
52
|
+
rack (2.2.5)
|
53
53
|
rack-test (2.0.2)
|
54
54
|
rack (>= 1.3)
|
55
55
|
rails-dom-testing (2.0.3)
|
56
56
|
activesupport (>= 4.2.0)
|
57
57
|
nokogiri (>= 1.6)
|
58
|
-
rails-html-sanitizer (1.4.
|
59
|
-
loofah (~> 2.
|
60
|
-
railties (6.1.
|
61
|
-
actionpack (= 6.1.
|
62
|
-
activesupport (= 6.1.
|
58
|
+
rails-html-sanitizer (1.4.4)
|
59
|
+
loofah (~> 2.19, >= 2.19.1)
|
60
|
+
railties (6.1.7)
|
61
|
+
actionpack (= 6.1.7)
|
62
|
+
activesupport (= 6.1.7)
|
63
63
|
method_source
|
64
64
|
rake (>= 12.2)
|
65
65
|
thor (~> 1.0)
|
66
66
|
rake (13.0.6)
|
67
|
-
rspec (3.
|
68
|
-
rspec-core (~> 3.
|
69
|
-
rspec-expectations (~> 3.
|
70
|
-
rspec-mocks (~> 3.
|
71
|
-
rspec-core (3.
|
72
|
-
rspec-support (~> 3.
|
73
|
-
rspec-expectations (3.
|
67
|
+
rspec (3.12.0)
|
68
|
+
rspec-core (~> 3.12.0)
|
69
|
+
rspec-expectations (~> 3.12.0)
|
70
|
+
rspec-mocks (~> 3.12.0)
|
71
|
+
rspec-core (3.12.0)
|
72
|
+
rspec-support (~> 3.12.0)
|
73
|
+
rspec-expectations (3.12.1)
|
74
74
|
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
-
rspec-support (~> 3.
|
76
|
-
rspec-mocks (3.
|
75
|
+
rspec-support (~> 3.12.0)
|
76
|
+
rspec-mocks (3.12.1)
|
77
77
|
diff-lcs (>= 1.2.0, < 2.0)
|
78
|
-
rspec-support (~> 3.
|
79
|
-
rspec-support (3.
|
80
|
-
sixarm_ruby_unaccent (1.2.0)
|
78
|
+
rspec-support (~> 3.12.0)
|
79
|
+
rspec-support (3.12.0)
|
81
80
|
thor (1.2.1)
|
82
|
-
tzinfo (2.0.
|
81
|
+
tzinfo (2.0.5)
|
83
82
|
concurrent-ruby (~> 1.0)
|
84
|
-
|
83
|
+
unaccent (0.4.0)
|
84
|
+
zeitwerk (2.6.6)
|
85
85
|
|
86
86
|
PLATFORMS
|
87
|
-
x86_64-darwin-
|
87
|
+
x86_64-darwin-22
|
88
88
|
x86_64-linux
|
89
89
|
|
90
90
|
DEPENDENCIES
|
91
91
|
actionpack (~> 6.1.0)
|
92
92
|
country_select!
|
93
|
+
nokogiri (= 1.14.0.rc1)
|
93
94
|
pry (~> 0)
|
94
95
|
railties (~> 6.1.0)
|
95
96
|
rake (~> 13)
|
96
97
|
rspec (~> 3)
|
97
98
|
|
98
99
|
BUNDLED WITH
|
99
|
-
2.
|
100
|
+
2.4.2
|
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
country_select (
|
4
|
+
country_select (8.0.1)
|
5
5
|
countries (~> 5.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (7.0.
|
11
|
-
actionview (= 7.0.
|
12
|
-
activesupport (= 7.0.
|
10
|
+
actionpack (7.0.4)
|
11
|
+
actionview (= 7.0.4)
|
12
|
+
activesupport (= 7.0.4)
|
13
13
|
rack (~> 2.0, >= 2.2.0)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
16
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
-
actionview (7.0.
|
18
|
-
activesupport (= 7.0.
|
17
|
+
actionview (7.0.4)
|
18
|
+
activesupport (= 7.0.4)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
22
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
-
activesupport (7.0.
|
23
|
+
activesupport (7.0.4)
|
24
24
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
25
|
i18n (>= 1.6, < 2)
|
26
26
|
minitest (>= 5.1)
|
@@ -28,72 +28,73 @@ GEM
|
|
28
28
|
builder (3.2.4)
|
29
29
|
coderay (1.1.3)
|
30
30
|
concurrent-ruby (1.1.10)
|
31
|
-
countries (5.
|
32
|
-
|
31
|
+
countries (5.3.0)
|
32
|
+
unaccent (~> 0.3)
|
33
33
|
crass (1.0.6)
|
34
34
|
diff-lcs (1.5.0)
|
35
|
-
erubi (1.
|
36
|
-
i18n (1.
|
35
|
+
erubi (1.12.0)
|
36
|
+
i18n (1.12.0)
|
37
37
|
concurrent-ruby (~> 1.0)
|
38
|
-
loofah (2.
|
38
|
+
loofah (2.19.1)
|
39
39
|
crass (~> 1.0.2)
|
40
40
|
nokogiri (>= 1.5.9)
|
41
41
|
method_source (1.0.0)
|
42
|
-
minitest (5.
|
43
|
-
nokogiri (1.
|
42
|
+
minitest (5.17.0)
|
43
|
+
nokogiri (1.14.0.rc1-x86_64-darwin)
|
44
44
|
racc (~> 1.4)
|
45
|
-
nokogiri (1.
|
45
|
+
nokogiri (1.14.0.rc1-x86_64-linux)
|
46
46
|
racc (~> 1.4)
|
47
47
|
pry (0.14.1)
|
48
48
|
coderay (~> 1.1)
|
49
49
|
method_source (~> 1.0)
|
50
|
-
racc (1.6.
|
51
|
-
rack (2.2.
|
50
|
+
racc (1.6.2)
|
51
|
+
rack (2.2.5)
|
52
52
|
rack-test (2.0.2)
|
53
53
|
rack (>= 1.3)
|
54
54
|
rails-dom-testing (2.0.3)
|
55
55
|
activesupport (>= 4.2.0)
|
56
56
|
nokogiri (>= 1.6)
|
57
|
-
rails-html-sanitizer (1.4.
|
58
|
-
loofah (~> 2.
|
59
|
-
railties (7.0.
|
60
|
-
actionpack (= 7.0.
|
61
|
-
activesupport (= 7.0.
|
57
|
+
rails-html-sanitizer (1.4.4)
|
58
|
+
loofah (~> 2.19, >= 2.19.1)
|
59
|
+
railties (7.0.4)
|
60
|
+
actionpack (= 7.0.4)
|
61
|
+
activesupport (= 7.0.4)
|
62
62
|
method_source
|
63
63
|
rake (>= 12.2)
|
64
64
|
thor (~> 1.0)
|
65
65
|
zeitwerk (~> 2.5)
|
66
66
|
rake (13.0.6)
|
67
|
-
rspec (3.
|
68
|
-
rspec-core (~> 3.
|
69
|
-
rspec-expectations (~> 3.
|
70
|
-
rspec-mocks (~> 3.
|
71
|
-
rspec-core (3.
|
72
|
-
rspec-support (~> 3.
|
73
|
-
rspec-expectations (3.
|
67
|
+
rspec (3.12.0)
|
68
|
+
rspec-core (~> 3.12.0)
|
69
|
+
rspec-expectations (~> 3.12.0)
|
70
|
+
rspec-mocks (~> 3.12.0)
|
71
|
+
rspec-core (3.12.0)
|
72
|
+
rspec-support (~> 3.12.0)
|
73
|
+
rspec-expectations (3.12.1)
|
74
74
|
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
-
rspec-support (~> 3.
|
76
|
-
rspec-mocks (3.
|
75
|
+
rspec-support (~> 3.12.0)
|
76
|
+
rspec-mocks (3.12.1)
|
77
77
|
diff-lcs (>= 1.2.0, < 2.0)
|
78
|
-
rspec-support (~> 3.
|
79
|
-
rspec-support (3.
|
80
|
-
sixarm_ruby_unaccent (1.2.0)
|
78
|
+
rspec-support (~> 3.12.0)
|
79
|
+
rspec-support (3.12.0)
|
81
80
|
thor (1.2.1)
|
82
|
-
tzinfo (2.0.
|
81
|
+
tzinfo (2.0.5)
|
83
82
|
concurrent-ruby (~> 1.0)
|
84
|
-
|
83
|
+
unaccent (0.4.0)
|
84
|
+
zeitwerk (2.6.6)
|
85
85
|
|
86
86
|
PLATFORMS
|
87
|
-
x86_64-darwin-
|
87
|
+
x86_64-darwin-22
|
88
88
|
x86_64-linux
|
89
89
|
|
90
90
|
DEPENDENCIES
|
91
91
|
actionpack (~> 7.0.0)
|
92
92
|
country_select!
|
93
|
+
nokogiri (= 1.14.0.rc1)
|
93
94
|
pry (~> 0)
|
94
95
|
railties (~> 7.0.0)
|
95
96
|
rake (~> 13)
|
96
97
|
rspec (~> 3)
|
97
98
|
|
98
99
|
BUNDLED WITH
|
99
|
-
2.
|
100
|
+
2.4.2
|
@@ -59,19 +59,18 @@ module CountrySelect
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def country_options
|
62
|
-
country_options_for(all_country_codes, @options.fetch(:sort_provided, ::CountrySelect::DEFAULTS[:sort_provided]))
|
63
|
-
end
|
64
|
-
|
65
|
-
def all_country_codes
|
66
|
-
codes = ISO3166::Country.codes
|
67
|
-
|
68
62
|
if only_country_codes.present?
|
69
|
-
only_country_codes & codes
|
63
|
+
codes = only_country_codes & ISO3166::Country.codes
|
64
|
+
sort = @options.fetch(:sort_provided, ::CountrySelect::DEFAULTS[:sort_provided])
|
70
65
|
elsif except_country_codes.present?
|
71
|
-
codes - except_country_codes
|
66
|
+
codes = ISO3166::Country.codes - except_country_codes
|
67
|
+
sort = true
|
72
68
|
else
|
73
|
-
codes
|
69
|
+
codes = ISO3166::Country.codes
|
70
|
+
sort = true
|
74
71
|
end
|
72
|
+
|
73
|
+
country_options_for(codes, sort)
|
75
74
|
end
|
76
75
|
|
77
76
|
def country_options_for(country_codes, sorted=true)
|
data/spec/country_select_spec.rb
CHANGED
@@ -140,6 +140,24 @@ describe "CountrySelect" do
|
|
140
140
|
expect(t).to include(tag)
|
141
141
|
end
|
142
142
|
|
143
|
+
it "priority countries with `sort_provided: false` still sorts the non-priority countries by name" do
|
144
|
+
tag = options_for_select(
|
145
|
+
[
|
146
|
+
['Latvia','LV'],
|
147
|
+
['United States','US'],
|
148
|
+
['Denmark', 'DK'],
|
149
|
+
['-'*15,'-'*15],
|
150
|
+
['Afghanistan','AF']
|
151
|
+
],
|
152
|
+
selected: 'AF',
|
153
|
+
disabled: '-'*15
|
154
|
+
)
|
155
|
+
|
156
|
+
walrus.country_code = 'AF'
|
157
|
+
t = builder.country_select(:country_code, priority_countries: ['LV','US','DK'], sort_provided: false)
|
158
|
+
expect(t).to include(tag)
|
159
|
+
end
|
160
|
+
|
143
161
|
describe "when selected options is not an array" do
|
144
162
|
it "selects only the first matching option" do
|
145
163
|
tag = options_for_select([["United States", "US"],["Uruguay", "UY"]], "US")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: country_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.
|
4
|
+
version: 8.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Penner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
|
-
rubygems_version: 3.
|
142
|
+
rubygems_version: 3.4.2
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: Country Select Plugin
|