country_select 3.1.1 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/build.yml +25 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/CHANGELOG.md +41 -1
- data/Gemfile +0 -6
- data/Gemfile.lock +60 -269
- data/README.md +39 -8
- data/Rakefile +3 -3
- data/country_select.gemspec +10 -9
- data/gemfiles/actionpack-5.2.gemfile +6 -0
- data/gemfiles/actionpack-5.2.gemfile.lock +106 -0
- data/gemfiles/actionpack-6.0.gemfile +6 -0
- data/gemfiles/actionpack-6.0.gemfile.lock +107 -0
- data/gemfiles/actionpack-6.1.gemfile +6 -0
- data/gemfiles/actionpack-6.1.gemfile.lock +107 -0
- data/gemfiles/actionpack-7.0.gemfile +6 -0
- data/gemfiles/actionpack-7.0.gemfile.lock +107 -0
- data/gemfiles/{actionpack.edge.gemfile → actionpack-head.gemfile} +0 -6
- data/gemfiles/actionpack-head.gemfile.lock +104 -0
- data/lib/country_select/defaults.rb +10 -0
- data/lib/country_select/formats.rb +3 -1
- data/lib/country_select/tag_helper.rb +9 -10
- data/lib/country_select/version.rb +1 -1
- data/lib/country_select.rb +2 -6
- data/lib/country_select_without_sort_alphabetical.rb +2 -6
- data/spec/country_select_spec.rb +47 -7
- metadata +37 -52
- data/.travis.yml +0 -35
- data/gemfiles/actionpack.edge.gemfile.lock +0 -313
- data/gemfiles/actionpack3.2.gemfile +0 -11
- data/gemfiles/actionpack3.2.gemfile.lock +0 -300
- data/gemfiles/actionpack4.0.gemfile +0 -11
- data/gemfiles/actionpack4.0.gemfile.lock +0 -289
- data/gemfiles/actionpack4.1.gemfile +0 -11
- data/gemfiles/actionpack4.1.gemfile.lock +0 -293
- data/gemfiles/actionpack4.2.gemfile +0 -14
- data/gemfiles/actionpack4.2.gemfile.lock +0 -309
- data/gemfiles/actionpack5.0.gemfile +0 -12
- data/gemfiles/actionpack5.0.gemfile.lock +0 -314
- data/gemfiles/actionpack5.1.gemfile +0 -12
- data/gemfiles/actionpack5.1.gemfile.lock +0 -314
- data/lib/country_select/rails3/country_select_helper.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c90fbc7dfe822e709d24caaa9f6ea4aadbc565d056acd04a83881fd456d77d04
|
4
|
+
data.tar.gz: b8b38e3f7c4b907df636ecb611db60c26aa95c7e355a102ce9b4b5b0395fc77a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c467912e59762ce36aecdff5b9ff177b10745a5462437be8d4b3eb283d6e92d1629b3eaa08f1ac2581bb28b212e2b43114bfbcc88ee5118fd0290b596817dd8
|
7
|
+
data.tar.gz: c29e2c423c6cbf990ff80de5b1415945e90f1425ca5bc82a8cb819edca7438c22d4bba374fc52a6d467c29bab8b823d53b50ad8e70fe5d28afa8a8069ffff083
|
@@ -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,4 +1,44 @@
|
|
1
|
-
##
|
1
|
+
## 7.0.0 2022-04-03
|
2
|
+
|
3
|
+
* #200 - Drop support for Ruby 2.5 and 2.6 (@pmor)
|
4
|
+
* #201 - Upgrade countries gem to 5.0.0 (@pmor)
|
5
|
+
|
6
|
+
## 6.1.1 2022-01-20
|
7
|
+
|
8
|
+
* #195 - Fix deprecation warning on find_by_name (@filipemendespi)
|
9
|
+
|
10
|
+
## 6.1.0 2022-01-16
|
11
|
+
|
12
|
+
* #190 - Upgrade to countries 4.2 (@pmor)
|
13
|
+
* #191 - Add Rails 7 + Ruby 3.1 to build (@scudco)
|
14
|
+
|
15
|
+
## 6.0.0 2021-06-28
|
16
|
+
|
17
|
+
* #186 - Upgrade to countries 4.0.0 (@pmor)
|
18
|
+
|
19
|
+
## 5.1.0 2021-05-18
|
20
|
+
|
21
|
+
* #184 - Add ability to configure defaults (@p-wall)
|
22
|
+
* Upgrade to countries 3.1.0
|
23
|
+
|
24
|
+
## 5.0.1 2021-03-08
|
25
|
+
|
26
|
+
* #181 - Fix i18n fallback in country translations (@lavaturtle)
|
27
|
+
|
28
|
+
## 5.0.0 2021-03-04
|
29
|
+
|
30
|
+
* #164,#172 - Remove support for EOL versions of Ruby and Ruby on Rails
|
31
|
+
* Ruby >= 2.5, Rails >= 5.2
|
32
|
+
* #175 - Add Rails 6.1 Support *(@andrehjr)
|
33
|
+
* #173 - Fallback even if translations cannot be loaded (@mikepluquin)
|
34
|
+
* #164 - Fixup travis build matrix (@olleolleolle)
|
35
|
+
|
36
|
+
## 4.0.0 2018-12-20
|
37
|
+
|
38
|
+
* #160 - Upgrade to countries 3.0 - @gssbzn
|
39
|
+
* https://github.com/hexorx/countries/blob/master/CHANGELOG.md#v220-yanked-and-re-released-as-300-20181217-1020-0000
|
40
|
+
|
41
|
+
## 3.1.1 2017-09-20
|
2
42
|
|
3
43
|
* #146 - Fix value call on Rails edge (5.2+) - @ybart
|
4
44
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,303 +1,94 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
country_select (
|
5
|
-
countries (~>
|
6
|
-
sort_alphabetical (~> 1.
|
4
|
+
country_select (6.1.1)
|
5
|
+
countries (~> 5.0)
|
6
|
+
sort_alphabetical (~> 1.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionpack (
|
12
|
-
actionview (=
|
13
|
-
activesupport (=
|
14
|
-
rack (~> 2.0)
|
11
|
+
actionpack (7.0.2.3)
|
12
|
+
actionview (= 7.0.2.3)
|
13
|
+
activesupport (= 7.0.2.3)
|
14
|
+
rack (~> 2.0, >= 2.2.0)
|
15
15
|
rack-test (>= 0.6.3)
|
16
16
|
rails-dom-testing (~> 2.0)
|
17
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
18
|
-
actionview (
|
19
|
-
activesupport (=
|
17
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
+
actionview (7.0.2.3)
|
19
|
+
activesupport (= 7.0.2.3)
|
20
20
|
builder (~> 3.1)
|
21
21
|
erubi (~> 1.4)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
|
-
rails-html-sanitizer (~> 1.
|
24
|
-
activesupport (
|
23
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
+
activesupport (7.0.2.3)
|
25
25
|
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.
|
34
|
-
money (~> 6.9)
|
26
|
+
i18n (>= 1.6, < 2)
|
27
|
+
minitest (>= 5.1)
|
28
|
+
tzinfo (~> 2.0)
|
29
|
+
builder (3.2.4)
|
30
|
+
coderay (1.1.3)
|
31
|
+
concurrent-ruby (1.1.10)
|
32
|
+
countries (5.0.0)
|
33
|
+
i18n_data (~> 0.16.0)
|
35
34
|
sixarm_ruby_unaccent (~> 1.1)
|
36
|
-
|
37
|
-
diff-lcs (1.
|
38
|
-
erubi (1.
|
39
|
-
|
40
|
-
|
41
|
-
i18n_data (0.
|
42
|
-
|
35
|
+
crass (1.0.6)
|
36
|
+
diff-lcs (1.5.0)
|
37
|
+
erubi (1.10.0)
|
38
|
+
i18n (1.10.0)
|
39
|
+
concurrent-ruby (~> 1.0)
|
40
|
+
i18n_data (0.16.0)
|
41
|
+
simple_po_parser (~> 1.1)
|
42
|
+
loofah (2.16.0)
|
43
|
+
crass (~> 1.0.2)
|
43
44
|
nokogiri (>= 1.5.9)
|
44
|
-
method_source (0.
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
slop (~> 3.4)
|
55
|
-
psych (2.0.15)
|
56
|
-
racc (1.4.12)
|
57
|
-
rack (2.0.3)
|
58
|
-
rack-test (0.7.0)
|
45
|
+
method_source (1.0.0)
|
46
|
+
minitest (5.15.0)
|
47
|
+
nokogiri (1.13.3-x86_64-darwin)
|
48
|
+
racc (~> 1.4)
|
49
|
+
pry (0.14.1)
|
50
|
+
coderay (~> 1.1)
|
51
|
+
method_source (~> 1.0)
|
52
|
+
racc (1.6.0)
|
53
|
+
rack (2.2.3)
|
54
|
+
rack-test (1.1.0)
|
59
55
|
rack (>= 1.0, < 3)
|
60
56
|
rails-dom-testing (2.0.3)
|
61
57
|
activesupport (>= 4.2.0)
|
62
58
|
nokogiri (>= 1.6)
|
63
|
-
rails-html-sanitizer (1.
|
64
|
-
loofah (~> 2.
|
65
|
-
rake (
|
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.
|
59
|
+
rails-html-sanitizer (1.4.2)
|
60
|
+
loofah (~> 2.3)
|
61
|
+
rake (13.0.6)
|
62
|
+
rspec (3.11.0)
|
63
|
+
rspec-core (~> 3.11.0)
|
64
|
+
rspec-expectations (~> 3.11.0)
|
65
|
+
rspec-mocks (~> 3.11.0)
|
66
|
+
rspec-core (3.11.0)
|
67
|
+
rspec-support (~> 3.11.0)
|
68
|
+
rspec-expectations (3.11.0)
|
73
69
|
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
-
rspec-support (~> 3.
|
75
|
-
rspec-mocks (3.
|
70
|
+
rspec-support (~> 3.11.0)
|
71
|
+
rspec-mocks (3.11.1)
|
76
72
|
diff-lcs (>= 1.2.0, < 2.0)
|
77
|
-
rspec-support (~> 3.
|
78
|
-
rspec-support (3.
|
79
|
-
|
80
|
-
rubysl-abbrev (~> 2.0)
|
81
|
-
rubysl-base64 (~> 2.0)
|
82
|
-
rubysl-benchmark (~> 2.0)
|
83
|
-
rubysl-bigdecimal (~> 2.0)
|
84
|
-
rubysl-cgi (~> 2.0)
|
85
|
-
rubysl-cgi-session (~> 2.0)
|
86
|
-
rubysl-cmath (~> 2.0)
|
87
|
-
rubysl-complex (~> 2.0)
|
88
|
-
rubysl-continuation (~> 2.0)
|
89
|
-
rubysl-coverage (~> 2.0)
|
90
|
-
rubysl-csv (~> 2.0)
|
91
|
-
rubysl-curses (~> 2.0)
|
92
|
-
rubysl-date (~> 2.0)
|
93
|
-
rubysl-delegate (~> 2.0)
|
94
|
-
rubysl-digest (~> 2.0)
|
95
|
-
rubysl-drb (~> 2.0)
|
96
|
-
rubysl-e2mmap (~> 2.0)
|
97
|
-
rubysl-english (~> 2.0)
|
98
|
-
rubysl-enumerator (~> 2.0)
|
99
|
-
rubysl-erb (~> 2.0)
|
100
|
-
rubysl-etc (~> 2.0)
|
101
|
-
rubysl-expect (~> 2.0)
|
102
|
-
rubysl-fcntl (~> 2.0)
|
103
|
-
rubysl-fiber (~> 2.0)
|
104
|
-
rubysl-fileutils (~> 2.0)
|
105
|
-
rubysl-find (~> 2.0)
|
106
|
-
rubysl-forwardable (~> 2.0)
|
107
|
-
rubysl-getoptlong (~> 2.0)
|
108
|
-
rubysl-gserver (~> 2.0)
|
109
|
-
rubysl-io-console (~> 2.0)
|
110
|
-
rubysl-io-nonblock (~> 2.0)
|
111
|
-
rubysl-io-wait (~> 2.0)
|
112
|
-
rubysl-ipaddr (~> 2.0)
|
113
|
-
rubysl-irb (~> 2.1)
|
114
|
-
rubysl-logger (~> 2.0)
|
115
|
-
rubysl-mathn (~> 2.0)
|
116
|
-
rubysl-matrix (~> 2.0)
|
117
|
-
rubysl-mkmf (~> 2.0)
|
118
|
-
rubysl-monitor (~> 2.0)
|
119
|
-
rubysl-mutex_m (~> 2.0)
|
120
|
-
rubysl-net-ftp (~> 2.0)
|
121
|
-
rubysl-net-http (~> 2.0)
|
122
|
-
rubysl-net-imap (~> 2.0)
|
123
|
-
rubysl-net-pop (~> 2.0)
|
124
|
-
rubysl-net-protocol (~> 2.0)
|
125
|
-
rubysl-net-smtp (~> 2.0)
|
126
|
-
rubysl-net-telnet (~> 2.0)
|
127
|
-
rubysl-nkf (~> 2.0)
|
128
|
-
rubysl-observer (~> 2.0)
|
129
|
-
rubysl-open-uri (~> 2.0)
|
130
|
-
rubysl-open3 (~> 2.0)
|
131
|
-
rubysl-openssl (~> 2.0)
|
132
|
-
rubysl-optparse (~> 2.0)
|
133
|
-
rubysl-ostruct (~> 2.0)
|
134
|
-
rubysl-pathname (~> 2.0)
|
135
|
-
rubysl-prettyprint (~> 2.0)
|
136
|
-
rubysl-prime (~> 2.0)
|
137
|
-
rubysl-profile (~> 2.0)
|
138
|
-
rubysl-profiler (~> 2.0)
|
139
|
-
rubysl-pstore (~> 2.0)
|
140
|
-
rubysl-pty (~> 2.0)
|
141
|
-
rubysl-rational (~> 2.0)
|
142
|
-
rubysl-resolv (~> 2.0)
|
143
|
-
rubysl-rexml (~> 2.0)
|
144
|
-
rubysl-rinda (~> 2.0)
|
145
|
-
rubysl-rss (~> 2.0)
|
146
|
-
rubysl-scanf (~> 2.0)
|
147
|
-
rubysl-securerandom (~> 2.0)
|
148
|
-
rubysl-set (~> 2.0)
|
149
|
-
rubysl-shellwords (~> 2.0)
|
150
|
-
rubysl-singleton (~> 2.0)
|
151
|
-
rubysl-socket (~> 2.0)
|
152
|
-
rubysl-stringio (~> 2.0)
|
153
|
-
rubysl-strscan (~> 2.0)
|
154
|
-
rubysl-sync (~> 2.0)
|
155
|
-
rubysl-syslog (~> 2.0)
|
156
|
-
rubysl-tempfile (~> 2.0)
|
157
|
-
rubysl-thread (~> 2.0)
|
158
|
-
rubysl-thwait (~> 2.0)
|
159
|
-
rubysl-time (~> 2.0)
|
160
|
-
rubysl-timeout (~> 2.0)
|
161
|
-
rubysl-tmpdir (~> 2.0)
|
162
|
-
rubysl-tsort (~> 2.0)
|
163
|
-
rubysl-un (~> 2.0)
|
164
|
-
rubysl-uri (~> 2.0)
|
165
|
-
rubysl-weakref (~> 2.0)
|
166
|
-
rubysl-webrick (~> 2.0)
|
167
|
-
rubysl-xmlrpc (~> 2.0)
|
168
|
-
rubysl-yaml (~> 2.0)
|
169
|
-
rubysl-zlib (~> 2.0)
|
170
|
-
rubysl-abbrev (2.0.4)
|
171
|
-
rubysl-base64 (2.0.0)
|
172
|
-
rubysl-benchmark (2.0.1)
|
173
|
-
rubysl-bigdecimal (2.0.2)
|
174
|
-
rubysl-cgi (2.0.1)
|
175
|
-
rubysl-cgi-session (2.0.1)
|
176
|
-
rubysl-cmath (2.0.0)
|
177
|
-
rubysl-complex (2.0.0)
|
178
|
-
rubysl-continuation (2.0.0)
|
179
|
-
rubysl-coverage (2.0.3)
|
180
|
-
rubysl-csv (2.0.2)
|
181
|
-
rubysl-english (~> 2.0)
|
182
|
-
rubysl-curses (2.0.1)
|
183
|
-
rubysl-date (2.0.9)
|
184
|
-
rubysl-delegate (2.0.1)
|
185
|
-
rubysl-digest (2.0.8)
|
186
|
-
rubysl-drb (2.0.1)
|
187
|
-
rubysl-e2mmap (2.0.0)
|
188
|
-
rubysl-english (2.0.0)
|
189
|
-
rubysl-enumerator (2.0.0)
|
190
|
-
rubysl-erb (2.0.2)
|
191
|
-
rubysl-etc (2.0.3)
|
192
|
-
ffi2-generators (~> 0.1)
|
193
|
-
rubysl-expect (2.0.0)
|
194
|
-
rubysl-fcntl (2.0.4)
|
195
|
-
ffi2-generators (~> 0.1)
|
196
|
-
rubysl-fiber (2.0.0)
|
197
|
-
rubysl-fileutils (2.0.3)
|
198
|
-
rubysl-find (2.0.1)
|
199
|
-
rubysl-forwardable (2.0.1)
|
200
|
-
rubysl-getoptlong (2.0.0)
|
201
|
-
rubysl-gserver (2.0.0)
|
202
|
-
rubysl-socket (~> 2.0)
|
203
|
-
rubysl-thread (~> 2.0)
|
204
|
-
rubysl-io-console (2.0.0)
|
205
|
-
rubysl-io-nonblock (2.0.0)
|
206
|
-
rubysl-io-wait (2.0.0)
|
207
|
-
rubysl-ipaddr (2.0.0)
|
208
|
-
rubysl-irb (2.1.1)
|
209
|
-
rubysl-e2mmap (~> 2.0)
|
210
|
-
rubysl-mathn (~> 2.0)
|
211
|
-
rubysl-thread (~> 2.0)
|
212
|
-
rubysl-logger (2.1.0)
|
213
|
-
rubysl-mathn (2.0.0)
|
214
|
-
rubysl-matrix (2.1.0)
|
215
|
-
rubysl-e2mmap (~> 2.0)
|
216
|
-
rubysl-mkmf (2.0.1)
|
217
|
-
rubysl-fileutils (~> 2.0)
|
218
|
-
rubysl-shellwords (~> 2.0)
|
219
|
-
rubysl-monitor (2.0.0)
|
220
|
-
rubysl-mutex_m (2.0.0)
|
221
|
-
rubysl-net-ftp (2.0.1)
|
222
|
-
rubysl-net-http (2.0.4)
|
223
|
-
rubysl-cgi (~> 2.0)
|
224
|
-
rubysl-erb (~> 2.0)
|
225
|
-
rubysl-singleton (~> 2.0)
|
226
|
-
rubysl-net-imap (2.0.1)
|
227
|
-
rubysl-net-pop (2.0.1)
|
228
|
-
rubysl-net-protocol (2.0.1)
|
229
|
-
rubysl-net-smtp (2.0.1)
|
230
|
-
rubysl-net-telnet (2.0.0)
|
231
|
-
rubysl-nkf (2.0.1)
|
232
|
-
rubysl-observer (2.0.0)
|
233
|
-
rubysl-open-uri (2.0.0)
|
234
|
-
rubysl-open3 (2.0.0)
|
235
|
-
rubysl-openssl (2.3.0)
|
236
|
-
rubysl-optparse (2.0.1)
|
237
|
-
rubysl-shellwords (~> 2.0)
|
238
|
-
rubysl-ostruct (2.0.4)
|
239
|
-
rubysl-pathname (2.1.0)
|
240
|
-
rubysl-prettyprint (2.0.3)
|
241
|
-
rubysl-prime (2.0.1)
|
242
|
-
rubysl-profile (2.0.0)
|
243
|
-
rubysl-profiler (2.0.1)
|
244
|
-
rubysl-pstore (2.0.0)
|
245
|
-
rubysl-pty (2.0.3)
|
246
|
-
rubysl-rational (2.0.1)
|
247
|
-
rubysl-resolv (2.1.2)
|
248
|
-
rubysl-rexml (2.0.4)
|
249
|
-
rubysl-rinda (2.0.1)
|
250
|
-
rubysl-rss (2.0.0)
|
251
|
-
rubysl-scanf (2.0.0)
|
252
|
-
rubysl-securerandom (2.0.0)
|
253
|
-
rubysl-set (2.0.1)
|
254
|
-
rubysl-shellwords (2.0.0)
|
255
|
-
rubysl-singleton (2.0.0)
|
256
|
-
rubysl-socket (2.0.1)
|
257
|
-
rubysl-stringio (2.0.0)
|
258
|
-
rubysl-strscan (2.0.0)
|
259
|
-
rubysl-sync (2.0.0)
|
260
|
-
rubysl-syslog (2.1.0)
|
261
|
-
ffi2-generators (~> 0.1)
|
262
|
-
rubysl-tempfile (2.0.1)
|
263
|
-
rubysl-thread (2.0.3)
|
264
|
-
rubysl-thwait (2.0.0)
|
265
|
-
rubysl-time (2.0.3)
|
266
|
-
rubysl-timeout (2.0.0)
|
267
|
-
rubysl-tmpdir (2.0.1)
|
268
|
-
rubysl-tsort (2.0.1)
|
269
|
-
rubysl-un (2.0.0)
|
270
|
-
rubysl-fileutils (~> 2.0)
|
271
|
-
rubysl-optparse (~> 2.0)
|
272
|
-
rubysl-uri (2.0.0)
|
273
|
-
rubysl-weakref (2.0.0)
|
274
|
-
rubysl-webrick (2.0.0)
|
275
|
-
rubysl-xmlrpc (2.0.0)
|
276
|
-
rubysl-yaml (2.1.0)
|
277
|
-
rubysl-zlib (2.0.1)
|
73
|
+
rspec-support (~> 3.11.0)
|
74
|
+
rspec-support (3.11.0)
|
75
|
+
simple_po_parser (1.1.6)
|
278
76
|
sixarm_ruby_unaccent (1.2.0)
|
279
|
-
slop (3.6.0)
|
280
77
|
sort_alphabetical (1.1.0)
|
281
78
|
unicode_utils (>= 1.2.2)
|
282
|
-
|
283
|
-
|
284
|
-
thread_safe (~> 0.1)
|
79
|
+
tzinfo (2.0.4)
|
80
|
+
concurrent-ruby (~> 1.0)
|
285
81
|
unicode_utils (1.4.0)
|
286
|
-
wwtd (1.1.1)
|
287
82
|
|
288
83
|
PLATFORMS
|
289
|
-
|
84
|
+
x86_64-darwin-21
|
290
85
|
|
291
86
|
DEPENDENCIES
|
292
|
-
actionpack (~>
|
87
|
+
actionpack (~> 7.0)
|
293
88
|
country_select!
|
294
89
|
pry (~> 0)
|
295
|
-
|
296
|
-
racc
|
297
|
-
rake
|
90
|
+
rake (~> 13)
|
298
91
|
rspec (~> 3)
|
299
|
-
rubysl (~> 2.0)
|
300
|
-
wwtd
|
301
92
|
|
302
93
|
BUNDLED WITH
|
303
|
-
|
94
|
+
2.3.10
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Rails – Country Select
|
2
|
-
[![
|
2
|
+
[![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:
|
@@ -95,18 +98,46 @@ country_select("user", "country", { priority_countries: ["GB", "FR"], selected:
|
|
95
98
|
### Using a custom formatter
|
96
99
|
|
97
100
|
You can define a custom formatter which will receive an
|
98
|
-
[`ISO3166::Country`](https://github.com/
|
101
|
+
[`ISO3166::Country`](https://github.com/countries/countries/blob/master/lib/countries/country.rb)
|
99
102
|
```ruby
|
100
103
|
# config/initializers/country_select.rb
|
104
|
+
|
105
|
+
# Return a string to customize the text in the <option> tag, `value` attribute will remain unchanged
|
101
106
|
CountrySelect::FORMATS[:with_alpha2] = lambda do |country|
|
102
|
-
"#{country.
|
107
|
+
"#{country.iso_short_name} (#{country.alpha2})"
|
108
|
+
end
|
109
|
+
|
110
|
+
# Return an array to customize <option> text, `value` and other HTML attributes
|
111
|
+
CountrySelect::FORMATS[:with_data_attrs] = lambda do |country|
|
112
|
+
[
|
113
|
+
country.iso_short_name,
|
114
|
+
country.alpha2,
|
115
|
+
{
|
116
|
+
'data-country-code' => country.country_code,
|
117
|
+
'data-alpha3' => country.alpha3
|
118
|
+
}
|
119
|
+
]
|
103
120
|
end
|
104
121
|
```
|
105
122
|
|
106
123
|
```ruby
|
107
124
|
country_select("user", "country", format: :with_alpha2)
|
125
|
+
country_select("user", "country", format: :with_data_attrs)
|
108
126
|
```
|
109
127
|
|
128
|
+
### Using customized defaults
|
129
|
+
|
130
|
+
You can configure overridable defaults for `except`, `format`, `locale`,
|
131
|
+
`only`, `priority_countries` and `priority_countries_divider` in an initializer.
|
132
|
+
|
133
|
+
````ruby
|
134
|
+
# config/initializers/country_select.rb
|
135
|
+
|
136
|
+
CountrySelect::DEFAULTS[:except] = [ "ZZ" ]
|
137
|
+
````
|
138
|
+
|
139
|
+
The example would exclude "ZZ" from every `country_select` tag, where no `except` option is given.
|
140
|
+
|
110
141
|
### ISO 3166-1 alpha-2 codes
|
111
142
|
The `option` tags use ISO 3166-1 alpha-2 codes as values and the country
|
112
143
|
names as display strings. For example, the United States would appear as
|
@@ -114,7 +145,7 @@ names as display strings. For example, the United States would appear as
|
|
114
145
|
|
115
146
|
Country names are automatically localized based on the value of
|
116
147
|
`I18n.locale` thanks to the wonderful
|
117
|
-
[countries gem](https://github.com/
|
148
|
+
[countries gem](https://github.com/countries/countries/).
|
118
149
|
|
119
150
|
Current translations include:
|
120
151
|
|
@@ -149,7 +180,7 @@ class User < ActiveRecord::Base
|
|
149
180
|
# (usually English) name if no translation is available
|
150
181
|
def country_name
|
151
182
|
country = ISO3166::Country[country_code]
|
152
|
-
country.translations[I18n.locale.to_s] || country.
|
183
|
+
country.translations[I18n.locale.to_s] || country.common_name || country.iso_short_name
|
153
184
|
end
|
154
185
|
|
155
186
|
end
|
@@ -178,7 +209,7 @@ changing the dependencies in the gemspec.
|
|
178
209
|
```shell
|
179
210
|
for i in gemfiles/*.gemfile
|
180
211
|
do
|
181
|
-
BUNDLE_GEMFILE=$i bundle install --
|
212
|
+
BUNDLE_GEMFILE=$i bundle install --local
|
182
213
|
done
|
183
214
|
```
|
184
215
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
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'
|
data/country_select.gemspec
CHANGED
@@ -8,25 +8,26 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.licenses = ['MIT']
|
9
9
|
s.authors = ['Stefan Penner']
|
10
10
|
s.email = ['stefan.penner@gmail.com']
|
11
|
-
s.homepage = 'https://github.com/
|
11
|
+
s.homepage = 'https://github.com/countries/country_select'
|
12
12
|
s.summary = %q{Country Select Plugin}
|
13
|
-
s.description = %q{Provides a simple helper to get an HTML select list of countries.
|
13
|
+
s.description = %q{Provides a simple helper to get an HTML select list of countries. The list of countries comes from the ISO 3166 standard. While it is a relatively neutral source of country names, it will still offend some users.}
|
14
14
|
|
15
|
-
s.
|
15
|
+
s.metadata = { 'bug_tracker_uri' => 'http://github.com/countries/country_select/issues',
|
16
|
+
'changelog_uri' => 'https://github.com/countries/country_select/blob/master/CHANGELOG.md',
|
17
|
+
'source_code_uri' => 'https://github.com/countries/country_select' }
|
16
18
|
|
17
19
|
s.files = `git ls-files`.split("\n")
|
18
20
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
22
|
s.require_paths = ['lib']
|
21
23
|
|
22
|
-
s.required_ruby_version = '>= 2'
|
24
|
+
s.required_ruby_version = '>= 2.7'
|
23
25
|
|
24
|
-
s.add_development_dependency 'actionpack', '~>
|
26
|
+
s.add_development_dependency 'actionpack', '~> 7.0'
|
25
27
|
s.add_development_dependency 'pry', '~> 0'
|
26
|
-
s.add_development_dependency 'rake'
|
28
|
+
s.add_development_dependency 'rake', '~> 13'
|
27
29
|
s.add_development_dependency 'rspec', '~> 3'
|
28
|
-
s.add_development_dependency 'wwtd'
|
29
30
|
|
30
|
-
s.add_dependency 'countries', '~>
|
31
|
-
s.add_dependency 'sort_alphabetical', '~> 1.
|
31
|
+
s.add_dependency 'countries', '~> 5.0'
|
32
|
+
s.add_dependency 'sort_alphabetical', '~> 1.1'
|
32
33
|
end
|