country_select 4.0.0 → 8.0.0
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 +25 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/CHANGELOG.md +42 -0
- data/Gemfile +0 -6
- data/Gemfile.lock +56 -270
- data/README.md +31 -11
- data/Rakefile +29 -3
- data/country_select.gemspec +9 -9
- data/gemfiles/{actionpack5.2.gemfile → actionpack-5.2.gemfile} +0 -6
- data/gemfiles/actionpack-5.2.gemfile.lock +98 -0
- data/gemfiles/actionpack-6.0.gemfile +6 -0
- data/gemfiles/actionpack-6.0.gemfile.lock +100 -0
- data/gemfiles/actionpack-6.1.gemfile +6 -0
- data/gemfiles/actionpack-6.1.gemfile.lock +99 -0
- data/gemfiles/actionpack-7.0.gemfile +6 -0
- data/gemfiles/actionpack-7.0.gemfile.lock +99 -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 +13 -18
- data/lib/country_select/version.rb +1 -1
- data/lib/country_select.rb +2 -7
- data/spec/country_select_spec.rb +94 -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: c2e998f6961d73f6b512f6f2a8346f5f1b971b2fd48795772b9f2553970c2a7d
|
4
|
+
data.tar.gz: 72ecc080ff6e7c161d7e09686b170363fc29be7090e2541c41be0c8ab10ffde9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f69921ae492051bdad6a71fab965e03c71f6446e4fbeb6da5b583b5d70d2136302f7eb726aca6fb6e1a803491855fa94928b28face16161f44437dbe93c23e09
|
7
|
+
data.tar.gz: 87530ffdd430818801590107cdf6314cc32deb8f1ec42444ce4e0f8848c4a175934e7e4dac3c495d16b66633e7d819422297213d120014aabefb646b5b9639f0
|
@@ -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]
|
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@v2
|
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,45 @@
|
|
1
|
+
## 8.0.0 2022-06-30
|
2
|
+
|
3
|
+
* Update countries gem to 5.1.0 (@pmor)
|
4
|
+
* Add deprecation warning for old priority country syntax (@pmor)
|
5
|
+
* Allow option to preserve the sort order as inputted in the `only` array of countries (@pmor)
|
6
|
+
* Remove `sort_alphabetical` dependency (@pmor)
|
7
|
+
|
8
|
+
## 7.0.0 2022-04-03
|
9
|
+
|
10
|
+
* #200 - Drop support for Ruby 2.5 and 2.6 (@pmor)
|
11
|
+
* #201 - Upgrade countries gem to 5.0.0 (@pmor)
|
12
|
+
|
13
|
+
## 6.1.1 2022-01-20
|
14
|
+
|
15
|
+
* #195 - Fix deprecation warning on find_by_name (@filipemendespi)
|
16
|
+
|
17
|
+
## 6.1.0 2022-01-16
|
18
|
+
|
19
|
+
* #190 - Upgrade to countries 4.2 (@pmor)
|
20
|
+
* #191 - Add Rails 7 + Ruby 3.1 to build (@scudco)
|
21
|
+
|
22
|
+
## 6.0.0 2021-06-28
|
23
|
+
|
24
|
+
* #186 - Upgrade to countries 4.0.0 (@pmor)
|
25
|
+
|
26
|
+
## 5.1.0 2021-05-18
|
27
|
+
|
28
|
+
* #184 - Add ability to configure defaults (@p-wall)
|
29
|
+
* Upgrade to countries 3.1.0
|
30
|
+
|
31
|
+
## 5.0.1 2021-03-08
|
32
|
+
|
33
|
+
* #181 - Fix i18n fallback in country translations (@lavaturtle)
|
34
|
+
|
35
|
+
## 5.0.0 2021-03-04
|
36
|
+
|
37
|
+
* #164,#172 - Remove support for EOL versions of Ruby and Ruby on Rails
|
38
|
+
* Ruby >= 2.5, Rails >= 5.2
|
39
|
+
* #175 - Add Rails 6.1 Support *(@andrehjr)
|
40
|
+
* #173 - Fallback even if translations cannot be loaded (@mikepluquin)
|
41
|
+
* #164 - Fixup travis build matrix (@olleolleolle)
|
42
|
+
|
1
43
|
## 4.0.0 2018-12-20
|
2
44
|
|
3
45
|
* #160 - Upgrade to countries 3.0 - @gssbzn
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,300 +1,86 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
country_select (
|
5
|
-
countries (~>
|
6
|
-
sort_alphabetical (~> 1.0)
|
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 (
|
12
|
-
actionview (=
|
13
|
-
activesupport (=
|
14
|
-
rack (~> 2.0)
|
10
|
+
actionpack (7.0.3)
|
11
|
+
actionview (= 7.0.3)
|
12
|
+
activesupport (= 7.0.3)
|
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.3)
|
18
|
+
activesupport (= 7.0.3)
|
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.3)
|
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 (
|
33
|
-
i18n_data (~> 0.8.0)
|
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.1.0)
|
34
32
|
sixarm_ruby_unaccent (~> 1.1)
|
35
|
-
|
36
|
-
diff-lcs (1.
|
37
|
-
erubi (1.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
33
|
+
crass (1.0.6)
|
34
|
+
diff-lcs (1.5.0)
|
35
|
+
erubi (1.10.0)
|
36
|
+
i18n (1.10.0)
|
37
|
+
concurrent-ruby (~> 1.0)
|
38
|
+
loofah (2.18.0)
|
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.3)
|
55
|
-
rack-test (0.7.0)
|
56
|
-
rack (>= 1.0, < 3)
|
41
|
+
method_source (1.0.0)
|
42
|
+
minitest (5.16.1)
|
43
|
+
nokogiri (1.13.6-x86_64-darwin)
|
44
|
+
racc (~> 1.4)
|
45
|
+
pry (0.14.1)
|
46
|
+
coderay (~> 1.1)
|
47
|
+
method_source (~> 1.0)
|
48
|
+
racc (1.6.0)
|
49
|
+
rack (2.2.3.1)
|
50
|
+
rack-test (2.0.0)
|
51
|
+
rack (>= 1.3)
|
57
52
|
rails-dom-testing (2.0.3)
|
58
53
|
activesupport (>= 4.2.0)
|
59
54
|
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.
|
55
|
+
rails-html-sanitizer (1.4.3)
|
56
|
+
loofah (~> 2.3)
|
57
|
+
rake (13.0.6)
|
58
|
+
rspec (3.11.0)
|
59
|
+
rspec-core (~> 3.11.0)
|
60
|
+
rspec-expectations (~> 3.11.0)
|
61
|
+
rspec-mocks (~> 3.11.0)
|
62
|
+
rspec-core (3.11.0)
|
63
|
+
rspec-support (~> 3.11.0)
|
64
|
+
rspec-expectations (3.11.0)
|
70
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
71
|
-
rspec-support (~> 3.
|
72
|
-
rspec-mocks (3.
|
66
|
+
rspec-support (~> 3.11.0)
|
67
|
+
rspec-mocks (3.11.1)
|
73
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
-
rspec-support (~> 3.
|
75
|
-
rspec-support (3.
|
76
|
-
rubysl (2.1.0)
|
77
|
-
rubysl-abbrev (~> 2.0)
|
78
|
-
rubysl-base64 (~> 2.0)
|
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)
|
69
|
+
rspec-support (~> 3.11.0)
|
70
|
+
rspec-support (3.11.0)
|
275
71
|
sixarm_ruby_unaccent (1.2.0)
|
276
|
-
|
277
|
-
|
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)
|
72
|
+
tzinfo (2.0.4)
|
73
|
+
concurrent-ruby (~> 1.0)
|
284
74
|
|
285
75
|
PLATFORMS
|
286
|
-
|
76
|
+
x86_64-darwin-21
|
287
77
|
|
288
78
|
DEPENDENCIES
|
289
|
-
actionpack (~>
|
79
|
+
actionpack (~> 7.0)
|
290
80
|
country_select!
|
291
81
|
pry (~> 0)
|
292
|
-
|
293
|
-
racc
|
294
|
-
rake
|
82
|
+
rake (~> 13)
|
295
83
|
rspec (~> 3)
|
296
|
-
rubysl (~> 2.0)
|
297
|
-
wwtd
|
298
84
|
|
299
85
|
BUNDLED WITH
|
300
|
-
|
86
|
+
2.3.10
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Rails – Country Select
|
2
|
-
[![
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/country_select.svg)](https://badge.fury.io/rb/countries) [![build](https://github.com/countries/country_select/actions/workflows/build.yml/badge.svg)](https://github.com/countries/country_select/actions/workflows/build.yml)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/countries/country_select.svg)](https://codeclimate.com/github/countries/country_select)
|
4
|
+
[![CodeQL](https://github.com/countries/country_select/actions/workflows/codeql-analysis.yml/badge.svg)](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,7 +29,7 @@ gem install country_select
|
|
26
29
|
Or put the following in your Gemfile
|
27
30
|
|
28
31
|
```ruby
|
29
|
-
gem 'country_select', '~>
|
32
|
+
gem 'country_select', '~> 6.0'
|
30
33
|
```
|
31
34
|
|
32
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:
|
@@ -54,13 +57,17 @@ country_select("user", "country")
|
|
54
57
|
Supplying priority countries to be placed at the top of the list:
|
55
58
|
|
56
59
|
```ruby
|
57
|
-
country_select("user", "country", priority_countries: ["GB", "FR", "DE"])
|
60
|
+
country_select("user", "country", priority_countries: ["GB", "FR", "DE"]) # Countries will be sorted by name according to the current locale
|
61
|
+
# or
|
62
|
+
country_select("user", "country", priority_countries: ["GB", "FR", "DE"], sort_provided: false) # Countries will be displayed is the provided order
|
58
63
|
```
|
59
64
|
|
60
65
|
Supplying only certain countries:
|
61
66
|
|
62
67
|
```ruby
|
63
|
-
country_select("user", "country", only: ["GB", "FR", "DE"])
|
68
|
+
country_select("user", "country", only: ["GB", "FR", "DE"]) # Countries will be sorted by name according to the current locale
|
69
|
+
# or
|
70
|
+
country_select("user", "country", only: ["GB", "FR", "DE"], sort_provided: false) # Countries will be displayed is the provided order
|
64
71
|
```
|
65
72
|
|
66
73
|
Discarding certain countries:
|
@@ -95,19 +102,19 @@ country_select("user", "country", { priority_countries: ["GB", "FR"], selected:
|
|
95
102
|
### Using a custom formatter
|
96
103
|
|
97
104
|
You can define a custom formatter which will receive an
|
98
|
-
[`ISO3166::Country`](https://github.com/
|
105
|
+
[`ISO3166::Country`](https://github.com/countries/countries/blob/master/lib/countries/country.rb)
|
99
106
|
```ruby
|
100
107
|
# config/initializers/country_select.rb
|
101
108
|
|
102
109
|
# Return a string to customize the text in the <option> tag, `value` attribute will remain unchanged
|
103
110
|
CountrySelect::FORMATS[:with_alpha2] = lambda do |country|
|
104
|
-
"#{country.
|
111
|
+
"#{country.iso_short_name} (#{country.alpha2})"
|
105
112
|
end
|
106
113
|
|
107
114
|
# Return an array to customize <option> text, `value` and other HTML attributes
|
108
115
|
CountrySelect::FORMATS[:with_data_attrs] = lambda do |country|
|
109
116
|
[
|
110
|
-
country.
|
117
|
+
country.iso_short_name,
|
111
118
|
country.alpha2,
|
112
119
|
{
|
113
120
|
'data-country-code' => country.country_code,
|
@@ -122,6 +129,19 @@ country_select("user", "country", format: :with_alpha2)
|
|
122
129
|
country_select("user", "country", format: :with_data_attrs)
|
123
130
|
```
|
124
131
|
|
132
|
+
### Using customized defaults
|
133
|
+
|
134
|
+
You can configure overridable defaults for `except`, `format`, `locale`,
|
135
|
+
`only`, `priority_countries` and `priority_countries_divider` in an initializer.
|
136
|
+
|
137
|
+
````ruby
|
138
|
+
# config/initializers/country_select.rb
|
139
|
+
|
140
|
+
CountrySelect::DEFAULTS[:except] = [ "ZZ" ]
|
141
|
+
````
|
142
|
+
|
143
|
+
The example would exclude "ZZ" from every `country_select` tag, where no `except` option is given.
|
144
|
+
|
125
145
|
### ISO 3166-1 alpha-2 codes
|
126
146
|
The `option` tags use ISO 3166-1 alpha-2 codes as values and the country
|
127
147
|
names as display strings. For example, the United States would appear as
|
@@ -129,7 +149,7 @@ names as display strings. For example, the United States would appear as
|
|
129
149
|
|
130
150
|
Country names are automatically localized based on the value of
|
131
151
|
`I18n.locale` thanks to the wonderful
|
132
|
-
[countries gem](https://github.com/
|
152
|
+
[countries gem](https://github.com/countries/countries/).
|
133
153
|
|
134
154
|
Current translations include:
|
135
155
|
|
@@ -164,7 +184,7 @@ class User < ActiveRecord::Base
|
|
164
184
|
# (usually English) name if no translation is available
|
165
185
|
def country_name
|
166
186
|
country = ISO3166::Country[country_code]
|
167
|
-
country.translations[I18n.locale.to_s] || country.
|
187
|
+
country.translations[I18n.locale.to_s] || country.common_name || country.iso_short_name
|
168
188
|
end
|
169
189
|
|
170
190
|
end
|
@@ -193,7 +213,7 @@ changing the dependencies in the gemspec.
|
|
193
213
|
```shell
|
194
214
|
for i in gemfiles/*.gemfile
|
195
215
|
do
|
196
|
-
BUNDLE_GEMFILE=$i bundle install --
|
216
|
+
BUNDLE_GEMFILE=$i bundle install --local
|
197
217
|
done
|
198
218
|
```
|
199
219
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bundler/setup'
|
2
4
|
require 'rake'
|
3
5
|
require 'bundler/gem_tasks'
|
4
6
|
|
5
|
-
require 'wwtd/tasks'
|
6
|
-
|
7
7
|
require 'rspec/core/rake_task'
|
8
8
|
RSpec::Core::RakeTask.new(:spec)
|
9
9
|
|
10
|
-
task default:
|
10
|
+
task default: 'spec'
|
11
|
+
|
12
|
+
|
13
|
+
task :update_gemfiles do
|
14
|
+
require 'pry'
|
15
|
+
Dir.glob('gemfiles/*.gemfile').each do |gemfile|
|
16
|
+
puts "Updating #{gemfile}...\n\n"
|
17
|
+
ENV['BUNDLE_GEMFILE']=gemfile
|
18
|
+
puts `bundle install --gemfile=#{gemfile} --no-cache`
|
19
|
+
puts `bundle update --gemfile=#{gemfile}`
|
20
|
+
|
21
|
+
lockfile = "#{gemfile}.lock"
|
22
|
+
|
23
|
+
if File.exists? lockfile
|
24
|
+
parsed_lockfile = Bundler::LockfileParser.new(Bundler.read_file(lockfile))
|
25
|
+
# Ensure lockfile has x86_64-linux
|
26
|
+
if parsed_lockfile.platforms.map(&:to_s).none? {|p| p == 'x86_64-linux' }
|
27
|
+
puts "Adding platform x86_64-linux to #{lockfile}\n\n"
|
28
|
+
puts `bundle lock --add-platform x86_64-linux --gemfile=#{gemfile}`
|
29
|
+
end
|
30
|
+
|
31
|
+
puts ""
|
32
|
+
else
|
33
|
+
raise StandardError.new("Expected #{lockfile} to exist.")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|