country_select 4.0.0 → 8.0.1
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/build.yml +25 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/CHANGELOG.md +50 -0
- data/Gemfile +0 -6
- data/Gemfile.lock +61 -272
- data/README.md +31 -17
- data/Rakefile +29 -3
- data/country_select.gemspec +9 -9
- data/gemfiles/{actionpack5.2.gemfile → actionpack-5.2.gemfile} +1 -6
- data/gemfiles/actionpack-5.2.gemfile.lock +99 -0
- data/gemfiles/actionpack-6.0.gemfile +7 -0
- data/gemfiles/actionpack-6.0.gemfile.lock +101 -0
- data/gemfiles/actionpack-6.1.gemfile +7 -0
- data/gemfiles/actionpack-6.1.gemfile.lock +100 -0
- data/gemfiles/actionpack-7.0.gemfile +7 -0
- data/gemfiles/actionpack-7.0.gemfile.lock +100 -0
- data/lib/country_select/country_select_helper.rb +5 -0
- data/lib/country_select/defaults.rb +11 -0
- data/lib/country_select/formats.rb +3 -1
- data/lib/country_select/tag_helper.rb +19 -25
- data/lib/country_select/version.rb +1 -1
- data/lib/country_select.rb +2 -7
- data/spec/country_select_spec.rb +112 -25
- metadata +33 -67
- data/.travis.yml +0 -41
- data/gemfiles/actionpack.edge.gemfile +0 -15
- data/gemfiles/actionpack.edge.gemfile.lock +0 -310
- data/gemfiles/actionpack3.2.gemfile +0 -11
- data/gemfiles/actionpack3.2.gemfile.lock +0 -297
- data/gemfiles/actionpack4.0.gemfile +0 -11
- data/gemfiles/actionpack4.0.gemfile.lock +0 -286
- data/gemfiles/actionpack4.1.gemfile +0 -11
- data/gemfiles/actionpack4.1.gemfile.lock +0 -290
- data/gemfiles/actionpack4.2.gemfile +0 -14
- data/gemfiles/actionpack4.2.gemfile.lock +0 -306
- data/gemfiles/actionpack5.0.gemfile +0 -12
- data/gemfiles/actionpack5.0.gemfile.lock +0 -311
- data/gemfiles/actionpack5.1.gemfile +0 -12
- data/gemfiles/actionpack5.1.gemfile.lock +0 -311
- data/gemfiles/actionpack5.2.gemfile.lock +0 -312
- data/lib/country_select/rails3/country_select_helper.rb +0 -39
- data/lib/country_select_without_sort_alphabetical.rb +0 -13
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
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: build
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
branches:
|
5
|
+
- '*'
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- master
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
fail-fast: false
|
14
|
+
matrix:
|
15
|
+
ruby: [2.7, '3.0', 3.1, 3.2]
|
16
|
+
gemfile: [5.2, '6.0', 6.1, '7.0']
|
17
|
+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
18
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/actionpack-${{ matrix.gemfile }}.gemfile
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v3
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
bundler-cache: true
|
25
|
+
- run: bundle exec rake
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ master ]
|
17
|
+
pull_request:
|
18
|
+
# The branches below must be a subset of the branches above
|
19
|
+
branches: [ master ]
|
20
|
+
schedule:
|
21
|
+
- cron: '21 7 * * 5'
|
22
|
+
|
23
|
+
jobs:
|
24
|
+
analyze:
|
25
|
+
name: Analyze
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
permissions:
|
28
|
+
actions: read
|
29
|
+
contents: read
|
30
|
+
security-events: write
|
31
|
+
|
32
|
+
strategy:
|
33
|
+
fail-fast: false
|
34
|
+
matrix:
|
35
|
+
language: [ 'ruby' ]
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
37
|
+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
38
|
+
|
39
|
+
steps:
|
40
|
+
- name: Checkout repository
|
41
|
+
uses: actions/checkout@v3
|
42
|
+
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
44
|
+
- name: Initialize CodeQL
|
45
|
+
uses: github/codeql-action/init@v1
|
46
|
+
with:
|
47
|
+
languages: ${{ matrix.language }}
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
51
|
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
52
|
+
|
53
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
54
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
55
|
+
- name: Autobuild
|
56
|
+
uses: github/codeql-action/autobuild@v1
|
57
|
+
|
58
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
59
|
+
# 📚 https://git.io/JvXDl
|
60
|
+
|
61
|
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
62
|
+
# and modify them (or add more) to build your code if your project
|
63
|
+
# uses a compiled language
|
64
|
+
|
65
|
+
#- run: |
|
66
|
+
# make bootstrap
|
67
|
+
# make release
|
68
|
+
|
69
|
+
- name: Perform CodeQL Analysis
|
70
|
+
uses: github/codeql-action/analyze@v1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,53 @@
|
|
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
|
+
|
9
|
+
## 8.0.0 2022-06-30
|
10
|
+
|
11
|
+
* Update countries gem to 5.1.0 (@pmor)
|
12
|
+
* Add deprecation warning for old priority country syntax (@pmor)
|
13
|
+
* Allow option to preserve the sort order as inputted in the `only` array of countries (@pmor)
|
14
|
+
* Remove `sort_alphabetical` dependency (@pmor)
|
15
|
+
|
16
|
+
## 7.0.0 2022-04-03
|
17
|
+
|
18
|
+
* #200 - Drop support for Ruby 2.5 and 2.6 (@pmor)
|
19
|
+
* #201 - Upgrade countries gem to 5.0.0 (@pmor)
|
20
|
+
|
21
|
+
## 6.1.1 2022-01-20
|
22
|
+
|
23
|
+
* #195 - Fix deprecation warning on find_by_name (@filipemendespi)
|
24
|
+
|
25
|
+
## 6.1.0 2022-01-16
|
26
|
+
|
27
|
+
* #190 - Upgrade to countries 4.2 (@pmor)
|
28
|
+
* #191 - Add Rails 7 + Ruby 3.1 to build (@scudco)
|
29
|
+
|
30
|
+
## 6.0.0 2021-06-28
|
31
|
+
|
32
|
+
* #186 - Upgrade to countries 4.0.0 (@pmor)
|
33
|
+
|
34
|
+
## 5.1.0 2021-05-18
|
35
|
+
|
36
|
+
* #184 - Add ability to configure defaults (@p-wall)
|
37
|
+
* Upgrade to countries 3.1.0
|
38
|
+
|
39
|
+
## 5.0.1 2021-03-08
|
40
|
+
|
41
|
+
* #181 - Fix i18n fallback in country translations (@lavaturtle)
|
42
|
+
|
43
|
+
## 5.0.0 2021-03-04
|
44
|
+
|
45
|
+
* #164,#172 - Remove support for EOL versions of Ruby and Ruby on Rails
|
46
|
+
* Ruby >= 2.5, Rails >= 5.2
|
47
|
+
* #175 - Add Rails 6.1 Support *(@andrehjr)
|
48
|
+
* #173 - Fallback even if translations cannot be loaded (@mikepluquin)
|
49
|
+
* #164 - Fixup travis build matrix (@olleolleolle)
|
50
|
+
|
1
51
|
## 4.0.0 2018-12-20
|
2
52
|
|
3
53
|
* #160 - Upgrade to countries 3.0 - @gssbzn
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,300 +1,89 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
country_select (
|
5
|
-
countries (~>
|
6
|
-
sort_alphabetical (~> 1.0)
|
4
|
+
country_select (8.0.1)
|
5
|
+
countries (~> 5.0)
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
10
9
|
specs:
|
11
|
-
actionpack (
|
12
|
-
actionview (=
|
13
|
-
activesupport (=
|
14
|
-
rack (~> 2.0)
|
10
|
+
actionpack (7.0.4)
|
11
|
+
actionview (= 7.0.4)
|
12
|
+
activesupport (= 7.0.4)
|
13
|
+
rack (~> 2.0, >= 2.2.0)
|
15
14
|
rack-test (>= 0.6.3)
|
16
15
|
rails-dom-testing (~> 2.0)
|
17
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
18
|
-
actionview (
|
19
|
-
activesupport (=
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
+
actionview (7.0.4)
|
18
|
+
activesupport (= 7.0.4)
|
20
19
|
builder (~> 3.1)
|
21
20
|
erubi (~> 1.4)
|
22
21
|
rails-dom-testing (~> 2.0)
|
23
|
-
rails-html-sanitizer (~> 1.
|
24
|
-
activesupport (
|
22
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
+
activesupport (7.0.4)
|
25
24
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
26
|
-
i18n (
|
27
|
-
minitest (
|
28
|
-
tzinfo (~>
|
29
|
-
builder (3.2.
|
30
|
-
coderay (1.1.
|
31
|
-
concurrent-ruby (1.
|
32
|
-
countries (3.0
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
loofah (2.0.3)
|
25
|
+
i18n (>= 1.6, < 2)
|
26
|
+
minitest (>= 5.1)
|
27
|
+
tzinfo (~> 2.0)
|
28
|
+
builder (3.2.4)
|
29
|
+
coderay (1.1.3)
|
30
|
+
concurrent-ruby (1.1.10)
|
31
|
+
countries (5.3.0)
|
32
|
+
unaccent (~> 0.3)
|
33
|
+
crass (1.0.6)
|
34
|
+
diff-lcs (1.5.0)
|
35
|
+
erubi (1.12.0)
|
36
|
+
i18n (1.12.0)
|
37
|
+
concurrent-ruby (~> 1.0)
|
38
|
+
loofah (2.19.1)
|
39
|
+
crass (~> 1.0.2)
|
42
40
|
nokogiri (>= 1.5.9)
|
43
|
-
method_source (0.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
rack (2.0.
|
55
|
-
|
56
|
-
rack (>= 1.0, < 3)
|
41
|
+
method_source (1.0.0)
|
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)
|
46
|
+
racc (~> 1.4)
|
47
|
+
pry (0.14.1)
|
48
|
+
coderay (~> 1.1)
|
49
|
+
method_source (~> 1.0)
|
50
|
+
racc (1.6.2)
|
51
|
+
rack (2.2.5)
|
52
|
+
rack-test (2.0.2)
|
53
|
+
rack (>= 1.3)
|
57
54
|
rails-dom-testing (2.0.3)
|
58
55
|
activesupport (>= 4.2.0)
|
59
56
|
nokogiri (>= 1.6)
|
60
|
-
rails-html-sanitizer (1.
|
61
|
-
loofah (~> 2.
|
62
|
-
rake (
|
63
|
-
rspec (3.
|
64
|
-
rspec-core (~> 3.
|
65
|
-
rspec-expectations (~> 3.
|
66
|
-
rspec-mocks (~> 3.
|
67
|
-
rspec-core (3.
|
68
|
-
rspec-support (~> 3.
|
69
|
-
rspec-expectations (3.
|
57
|
+
rails-html-sanitizer (1.4.4)
|
58
|
+
loofah (~> 2.19, >= 2.19.1)
|
59
|
+
rake (13.0.6)
|
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)
|
70
67
|
diff-lcs (>= 1.2.0, < 2.0)
|
71
|
-
rspec-support (~> 3.
|
72
|
-
rspec-mocks (3.
|
68
|
+
rspec-support (~> 3.12.0)
|
69
|
+
rspec-mocks (3.12.1)
|
73
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
-
rspec-support (~> 3.
|
75
|
-
rspec-support (3.
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
rubysl-benchmark (~> 2.0)
|
80
|
-
rubysl-bigdecimal (~> 2.0)
|
81
|
-
rubysl-cgi (~> 2.0)
|
82
|
-
rubysl-cgi-session (~> 2.0)
|
83
|
-
rubysl-cmath (~> 2.0)
|
84
|
-
rubysl-complex (~> 2.0)
|
85
|
-
rubysl-continuation (~> 2.0)
|
86
|
-
rubysl-coverage (~> 2.0)
|
87
|
-
rubysl-csv (~> 2.0)
|
88
|
-
rubysl-curses (~> 2.0)
|
89
|
-
rubysl-date (~> 2.0)
|
90
|
-
rubysl-delegate (~> 2.0)
|
91
|
-
rubysl-digest (~> 2.0)
|
92
|
-
rubysl-drb (~> 2.0)
|
93
|
-
rubysl-e2mmap (~> 2.0)
|
94
|
-
rubysl-english (~> 2.0)
|
95
|
-
rubysl-enumerator (~> 2.0)
|
96
|
-
rubysl-erb (~> 2.0)
|
97
|
-
rubysl-etc (~> 2.0)
|
98
|
-
rubysl-expect (~> 2.0)
|
99
|
-
rubysl-fcntl (~> 2.0)
|
100
|
-
rubysl-fiber (~> 2.0)
|
101
|
-
rubysl-fileutils (~> 2.0)
|
102
|
-
rubysl-find (~> 2.0)
|
103
|
-
rubysl-forwardable (~> 2.0)
|
104
|
-
rubysl-getoptlong (~> 2.0)
|
105
|
-
rubysl-gserver (~> 2.0)
|
106
|
-
rubysl-io-console (~> 2.0)
|
107
|
-
rubysl-io-nonblock (~> 2.0)
|
108
|
-
rubysl-io-wait (~> 2.0)
|
109
|
-
rubysl-ipaddr (~> 2.0)
|
110
|
-
rubysl-irb (~> 2.1)
|
111
|
-
rubysl-logger (~> 2.0)
|
112
|
-
rubysl-mathn (~> 2.0)
|
113
|
-
rubysl-matrix (~> 2.0)
|
114
|
-
rubysl-mkmf (~> 2.0)
|
115
|
-
rubysl-monitor (~> 2.0)
|
116
|
-
rubysl-mutex_m (~> 2.0)
|
117
|
-
rubysl-net-ftp (~> 2.0)
|
118
|
-
rubysl-net-http (~> 2.0)
|
119
|
-
rubysl-net-imap (~> 2.0)
|
120
|
-
rubysl-net-pop (~> 2.0)
|
121
|
-
rubysl-net-protocol (~> 2.0)
|
122
|
-
rubysl-net-smtp (~> 2.0)
|
123
|
-
rubysl-net-telnet (~> 2.0)
|
124
|
-
rubysl-nkf (~> 2.0)
|
125
|
-
rubysl-observer (~> 2.0)
|
126
|
-
rubysl-open-uri (~> 2.0)
|
127
|
-
rubysl-open3 (~> 2.0)
|
128
|
-
rubysl-openssl (~> 2.0)
|
129
|
-
rubysl-optparse (~> 2.0)
|
130
|
-
rubysl-ostruct (~> 2.0)
|
131
|
-
rubysl-pathname (~> 2.0)
|
132
|
-
rubysl-prettyprint (~> 2.0)
|
133
|
-
rubysl-prime (~> 2.0)
|
134
|
-
rubysl-profile (~> 2.0)
|
135
|
-
rubysl-profiler (~> 2.0)
|
136
|
-
rubysl-pstore (~> 2.0)
|
137
|
-
rubysl-pty (~> 2.0)
|
138
|
-
rubysl-rational (~> 2.0)
|
139
|
-
rubysl-resolv (~> 2.0)
|
140
|
-
rubysl-rexml (~> 2.0)
|
141
|
-
rubysl-rinda (~> 2.0)
|
142
|
-
rubysl-rss (~> 2.0)
|
143
|
-
rubysl-scanf (~> 2.0)
|
144
|
-
rubysl-securerandom (~> 2.0)
|
145
|
-
rubysl-set (~> 2.0)
|
146
|
-
rubysl-shellwords (~> 2.0)
|
147
|
-
rubysl-singleton (~> 2.0)
|
148
|
-
rubysl-socket (~> 2.0)
|
149
|
-
rubysl-stringio (~> 2.0)
|
150
|
-
rubysl-strscan (~> 2.0)
|
151
|
-
rubysl-sync (~> 2.0)
|
152
|
-
rubysl-syslog (~> 2.0)
|
153
|
-
rubysl-tempfile (~> 2.0)
|
154
|
-
rubysl-thread (~> 2.0)
|
155
|
-
rubysl-thwait (~> 2.0)
|
156
|
-
rubysl-time (~> 2.0)
|
157
|
-
rubysl-timeout (~> 2.0)
|
158
|
-
rubysl-tmpdir (~> 2.0)
|
159
|
-
rubysl-tsort (~> 2.0)
|
160
|
-
rubysl-un (~> 2.0)
|
161
|
-
rubysl-uri (~> 2.0)
|
162
|
-
rubysl-weakref (~> 2.0)
|
163
|
-
rubysl-webrick (~> 2.0)
|
164
|
-
rubysl-xmlrpc (~> 2.0)
|
165
|
-
rubysl-yaml (~> 2.0)
|
166
|
-
rubysl-zlib (~> 2.0)
|
167
|
-
rubysl-abbrev (2.0.4)
|
168
|
-
rubysl-base64 (2.0.0)
|
169
|
-
rubysl-benchmark (2.0.1)
|
170
|
-
rubysl-bigdecimal (2.0.2)
|
171
|
-
rubysl-cgi (2.0.1)
|
172
|
-
rubysl-cgi-session (2.0.1)
|
173
|
-
rubysl-cmath (2.0.0)
|
174
|
-
rubysl-complex (2.0.0)
|
175
|
-
rubysl-continuation (2.0.0)
|
176
|
-
rubysl-coverage (2.0.3)
|
177
|
-
rubysl-csv (2.0.2)
|
178
|
-
rubysl-english (~> 2.0)
|
179
|
-
rubysl-curses (2.0.1)
|
180
|
-
rubysl-date (2.0.9)
|
181
|
-
rubysl-delegate (2.0.1)
|
182
|
-
rubysl-digest (2.0.8)
|
183
|
-
rubysl-drb (2.0.1)
|
184
|
-
rubysl-e2mmap (2.0.0)
|
185
|
-
rubysl-english (2.0.0)
|
186
|
-
rubysl-enumerator (2.0.0)
|
187
|
-
rubysl-erb (2.0.2)
|
188
|
-
rubysl-etc (2.0.3)
|
189
|
-
ffi2-generators (~> 0.1)
|
190
|
-
rubysl-expect (2.0.0)
|
191
|
-
rubysl-fcntl (2.0.4)
|
192
|
-
ffi2-generators (~> 0.1)
|
193
|
-
rubysl-fiber (2.0.0)
|
194
|
-
rubysl-fileutils (2.0.3)
|
195
|
-
rubysl-find (2.0.1)
|
196
|
-
rubysl-forwardable (2.0.1)
|
197
|
-
rubysl-getoptlong (2.0.0)
|
198
|
-
rubysl-gserver (2.0.0)
|
199
|
-
rubysl-socket (~> 2.0)
|
200
|
-
rubysl-thread (~> 2.0)
|
201
|
-
rubysl-io-console (2.0.0)
|
202
|
-
rubysl-io-nonblock (2.0.0)
|
203
|
-
rubysl-io-wait (2.0.0)
|
204
|
-
rubysl-ipaddr (2.0.0)
|
205
|
-
rubysl-irb (2.1.1)
|
206
|
-
rubysl-e2mmap (~> 2.0)
|
207
|
-
rubysl-mathn (~> 2.0)
|
208
|
-
rubysl-thread (~> 2.0)
|
209
|
-
rubysl-logger (2.1.0)
|
210
|
-
rubysl-mathn (2.0.0)
|
211
|
-
rubysl-matrix (2.1.0)
|
212
|
-
rubysl-e2mmap (~> 2.0)
|
213
|
-
rubysl-mkmf (2.0.1)
|
214
|
-
rubysl-fileutils (~> 2.0)
|
215
|
-
rubysl-shellwords (~> 2.0)
|
216
|
-
rubysl-monitor (2.0.0)
|
217
|
-
rubysl-mutex_m (2.0.0)
|
218
|
-
rubysl-net-ftp (2.0.1)
|
219
|
-
rubysl-net-http (2.0.4)
|
220
|
-
rubysl-cgi (~> 2.0)
|
221
|
-
rubysl-erb (~> 2.0)
|
222
|
-
rubysl-singleton (~> 2.0)
|
223
|
-
rubysl-net-imap (2.0.1)
|
224
|
-
rubysl-net-pop (2.0.1)
|
225
|
-
rubysl-net-protocol (2.0.1)
|
226
|
-
rubysl-net-smtp (2.0.1)
|
227
|
-
rubysl-net-telnet (2.0.0)
|
228
|
-
rubysl-nkf (2.0.1)
|
229
|
-
rubysl-observer (2.0.0)
|
230
|
-
rubysl-open-uri (2.0.0)
|
231
|
-
rubysl-open3 (2.0.0)
|
232
|
-
rubysl-openssl (2.3.0)
|
233
|
-
rubysl-optparse (2.0.1)
|
234
|
-
rubysl-shellwords (~> 2.0)
|
235
|
-
rubysl-ostruct (2.0.4)
|
236
|
-
rubysl-pathname (2.1.0)
|
237
|
-
rubysl-prettyprint (2.0.3)
|
238
|
-
rubysl-prime (2.0.1)
|
239
|
-
rubysl-profile (2.0.0)
|
240
|
-
rubysl-profiler (2.0.1)
|
241
|
-
rubysl-pstore (2.0.0)
|
242
|
-
rubysl-pty (2.0.3)
|
243
|
-
rubysl-rational (2.0.1)
|
244
|
-
rubysl-resolv (2.1.2)
|
245
|
-
rubysl-rexml (2.0.4)
|
246
|
-
rubysl-rinda (2.0.1)
|
247
|
-
rubysl-rss (2.0.0)
|
248
|
-
rubysl-scanf (2.0.0)
|
249
|
-
rubysl-securerandom (2.0.0)
|
250
|
-
rubysl-set (2.0.1)
|
251
|
-
rubysl-shellwords (2.0.0)
|
252
|
-
rubysl-singleton (2.0.0)
|
253
|
-
rubysl-socket (2.0.1)
|
254
|
-
rubysl-stringio (2.0.0)
|
255
|
-
rubysl-strscan (2.0.0)
|
256
|
-
rubysl-sync (2.0.0)
|
257
|
-
rubysl-syslog (2.1.0)
|
258
|
-
ffi2-generators (~> 0.1)
|
259
|
-
rubysl-tempfile (2.0.1)
|
260
|
-
rubysl-thread (2.0.3)
|
261
|
-
rubysl-thwait (2.0.0)
|
262
|
-
rubysl-time (2.0.3)
|
263
|
-
rubysl-timeout (2.0.0)
|
264
|
-
rubysl-tmpdir (2.0.1)
|
265
|
-
rubysl-tsort (2.0.1)
|
266
|
-
rubysl-un (2.0.0)
|
267
|
-
rubysl-fileutils (~> 2.0)
|
268
|
-
rubysl-optparse (~> 2.0)
|
269
|
-
rubysl-uri (2.0.0)
|
270
|
-
rubysl-weakref (2.0.0)
|
271
|
-
rubysl-webrick (2.0.0)
|
272
|
-
rubysl-xmlrpc (2.0.0)
|
273
|
-
rubysl-yaml (2.1.0)
|
274
|
-
rubysl-zlib (2.0.1)
|
275
|
-
sixarm_ruby_unaccent (1.2.0)
|
276
|
-
slop (3.6.0)
|
277
|
-
sort_alphabetical (1.1.0)
|
278
|
-
unicode_utils (>= 1.2.2)
|
279
|
-
thread_safe (0.3.6)
|
280
|
-
tzinfo (1.2.3)
|
281
|
-
thread_safe (~> 0.1)
|
282
|
-
unicode_utils (1.4.0)
|
283
|
-
wwtd (1.1.1)
|
71
|
+
rspec-support (~> 3.12.0)
|
72
|
+
rspec-support (3.12.0)
|
73
|
+
tzinfo (2.0.5)
|
74
|
+
concurrent-ruby (~> 1.0)
|
75
|
+
unaccent (0.4.0)
|
284
76
|
|
285
77
|
PLATFORMS
|
286
|
-
|
78
|
+
x86_64-darwin-22
|
79
|
+
x86_64-linux
|
287
80
|
|
288
81
|
DEPENDENCIES
|
289
|
-
actionpack (~>
|
82
|
+
actionpack (~> 7.0)
|
290
83
|
country_select!
|
291
84
|
pry (~> 0)
|
292
|
-
|
293
|
-
racc
|
294
|
-
rake
|
85
|
+
rake (~> 13)
|
295
86
|
rspec (~> 3)
|
296
|
-
rubysl (~> 2.0)
|
297
|
-
wwtd
|
298
87
|
|
299
88
|
BUNDLED WITH
|
300
|
-
|
89
|
+
2.4.2
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Rails – Country Select
|
2
|
-
[](https://badge.fury.io/rb/countries) [](https://github.com/countries/country_select/actions/workflows/build.yml)
|
3
|
+
[](https://codeclimate.com/github/countries/country_select)
|
4
|
+
[](https://github.com/countries/country_select/actions/workflows/codeql-analysis.yml)
|
5
|
+
|
3
6
|
|
4
7
|
Provides a simple helper to get an HTML select list of countries using the
|
5
8
|
[ISO 3166-1 standard](https://en.wikipedia.org/wiki/ISO_3166-1).
|
@@ -14,7 +17,7 @@ to evaluate the suitability of this list given their user base.
|
|
14
17
|
|
15
18
|
## Reporting issues
|
16
19
|
|
17
|
-
Open an issue on the [issue tracker](https://github.com/
|
20
|
+
Open an issue on the [issue tracker](https://github.com/countries/country_select/issues/new). Ideally provide versions used, and code example that demonstrates the issue.
|
18
21
|
|
19
22
|
## Installation
|
20
23
|
|
@@ -26,13 +29,7 @@ gem install country_select
|
|
26
29
|
Or put the following in your Gemfile
|
27
30
|
|
28
31
|
```ruby
|
29
|
-
gem 'country_select', '~>
|
30
|
-
```
|
31
|
-
|
32
|
-
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:
|
33
|
-
|
34
|
-
```ruby
|
35
|
-
gem 'country_select', require: 'country_select_without_sort_alphabetical'
|
32
|
+
gem 'country_select', '~> 8.0'
|
36
33
|
```
|
37
34
|
|
38
35
|
## Usage
|
@@ -54,13 +51,17 @@ country_select("user", "country")
|
|
54
51
|
Supplying priority countries to be placed at the top of the list:
|
55
52
|
|
56
53
|
```ruby
|
57
|
-
country_select("user", "country", priority_countries: ["GB", "FR", "DE"])
|
54
|
+
country_select("user", "country", priority_countries: ["GB", "FR", "DE"]) # Countries will be sorted by name according to the current locale
|
55
|
+
# or
|
56
|
+
country_select("user", "country", priority_countries: ["GB", "FR", "DE"], sort_provided: false) # Countries will be displayed is the provided order
|
58
57
|
```
|
59
58
|
|
60
59
|
Supplying only certain countries:
|
61
60
|
|
62
61
|
```ruby
|
63
|
-
country_select("user", "country", only: ["GB", "FR", "DE"])
|
62
|
+
country_select("user", "country", only: ["GB", "FR", "DE"]) # Countries will be sorted by name according to the current locale
|
63
|
+
# or
|
64
|
+
country_select("user", "country", only: ["GB", "FR", "DE"], sort_provided: false) # Countries will be displayed is the provided order
|
64
65
|
```
|
65
66
|
|
66
67
|
Discarding certain countries:
|
@@ -95,19 +96,19 @@ country_select("user", "country", { priority_countries: ["GB", "FR"], selected:
|
|
95
96
|
### Using a custom formatter
|
96
97
|
|
97
98
|
You can define a custom formatter which will receive an
|
98
|
-
[`ISO3166::Country`](https://github.com/
|
99
|
+
[`ISO3166::Country`](https://github.com/countries/countries/blob/master/lib/countries/country.rb)
|
99
100
|
```ruby
|
100
101
|
# config/initializers/country_select.rb
|
101
102
|
|
102
103
|
# Return a string to customize the text in the <option> tag, `value` attribute will remain unchanged
|
103
104
|
CountrySelect::FORMATS[:with_alpha2] = lambda do |country|
|
104
|
-
"#{country.
|
105
|
+
"#{country.iso_short_name} (#{country.alpha2})"
|
105
106
|
end
|
106
107
|
|
107
108
|
# Return an array to customize <option> text, `value` and other HTML attributes
|
108
109
|
CountrySelect::FORMATS[:with_data_attrs] = lambda do |country|
|
109
110
|
[
|
110
|
-
country.
|
111
|
+
country.iso_short_name,
|
111
112
|
country.alpha2,
|
112
113
|
{
|
113
114
|
'data-country-code' => country.country_code,
|
@@ -122,6 +123,19 @@ country_select("user", "country", format: :with_alpha2)
|
|
122
123
|
country_select("user", "country", format: :with_data_attrs)
|
123
124
|
```
|
124
125
|
|
126
|
+
### Using customized defaults
|
127
|
+
|
128
|
+
You can configure overridable defaults for `except`, `format`, `locale`,
|
129
|
+
`only`, `priority_countries` and `priority_countries_divider` in an initializer.
|
130
|
+
|
131
|
+
````ruby
|
132
|
+
# config/initializers/country_select.rb
|
133
|
+
|
134
|
+
CountrySelect::DEFAULTS[:except] = [ "ZZ" ]
|
135
|
+
````
|
136
|
+
|
137
|
+
The example would exclude "ZZ" from every `country_select` tag, where no `except` option is given.
|
138
|
+
|
125
139
|
### ISO 3166-1 alpha-2 codes
|
126
140
|
The `option` tags use ISO 3166-1 alpha-2 codes as values and the country
|
127
141
|
names as display strings. For example, the United States would appear as
|
@@ -129,7 +143,7 @@ names as display strings. For example, the United States would appear as
|
|
129
143
|
|
130
144
|
Country names are automatically localized based on the value of
|
131
145
|
`I18n.locale` thanks to the wonderful
|
132
|
-
[countries gem](https://github.com/
|
146
|
+
[countries gem](https://github.com/countries/countries/).
|
133
147
|
|
134
148
|
Current translations include:
|
135
149
|
|
@@ -164,7 +178,7 @@ class User < ActiveRecord::Base
|
|
164
178
|
# (usually English) name if no translation is available
|
165
179
|
def country_name
|
166
180
|
country = ISO3166::Country[country_code]
|
167
|
-
country.translations[I18n.locale.to_s] || country.
|
181
|
+
country.translations[I18n.locale.to_s] || country.common_name || country.iso_short_name
|
168
182
|
end
|
169
183
|
|
170
184
|
end
|
@@ -193,7 +207,7 @@ changing the dependencies in the gemspec.
|
|
193
207
|
```shell
|
194
208
|
for i in gemfiles/*.gemfile
|
195
209
|
do
|
196
|
-
BUNDLE_GEMFILE=$i bundle install --
|
210
|
+
BUNDLE_GEMFILE=$i bundle install --local
|
197
211
|
done
|
198
212
|
```
|
199
213
|
|