country_select 3.1.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/build.yml +25 -0
  3. data/.github/workflows/codeql-analysis.yml +70 -0
  4. data/CHANGELOG.md +44 -0
  5. data/Gemfile +0 -6
  6. data/Gemfile.lock +72 -275
  7. data/README.md +44 -8
  8. data/Rakefile +3 -3
  9. data/country_select.gemspec +10 -9
  10. data/gemfiles/actionpack-5.2.gemfile +6 -0
  11. data/gemfiles/actionpack-5.2.gemfile.lock +106 -0
  12. data/gemfiles/actionpack-6.0.gemfile +6 -0
  13. data/gemfiles/actionpack-6.0.gemfile.lock +107 -0
  14. data/gemfiles/actionpack-6.1.gemfile +6 -0
  15. data/gemfiles/actionpack-6.1.gemfile.lock +107 -0
  16. data/gemfiles/actionpack-7.0.gemfile +6 -0
  17. data/gemfiles/actionpack-7.0.gemfile.lock +107 -0
  18. data/gemfiles/{actionpack.edge.gemfile → actionpack-head.gemfile} +0 -6
  19. data/gemfiles/actionpack-head.gemfile.lock +104 -0
  20. data/lib/country_select/defaults.rb +10 -0
  21. data/lib/country_select/formats.rb +3 -1
  22. data/lib/country_select/tag_helper.rb +20 -10
  23. data/lib/country_select/version.rb +1 -1
  24. data/lib/country_select.rb +2 -6
  25. data/lib/country_select_without_sort_alphabetical.rb +2 -6
  26. data/spec/country_select_spec.rb +47 -7
  27. metadata +37 -52
  28. data/.travis.yml +0 -35
  29. data/gemfiles/actionpack.edge.gemfile.lock +0 -313
  30. data/gemfiles/actionpack3.2.gemfile +0 -11
  31. data/gemfiles/actionpack3.2.gemfile.lock +0 -300
  32. data/gemfiles/actionpack4.0.gemfile +0 -11
  33. data/gemfiles/actionpack4.0.gemfile.lock +0 -289
  34. data/gemfiles/actionpack4.1.gemfile +0 -11
  35. data/gemfiles/actionpack4.1.gemfile.lock +0 -293
  36. data/gemfiles/actionpack4.2.gemfile +0 -14
  37. data/gemfiles/actionpack4.2.gemfile.lock +0 -309
  38. data/gemfiles/actionpack5.0.gemfile +0 -12
  39. data/gemfiles/actionpack5.0.gemfile.lock +0 -314
  40. data/gemfiles/actionpack5.1.gemfile +0 -12
  41. data/gemfiles/actionpack5.1.gemfile.lock +0 -314
  42. data/lib/country_select/rails3/country_select_helper.rb +0 -39
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5a0b49887be335ea4a50f736e7768d267adb0851
4
- data.tar.gz: 13db26a37a192cb6a31a557f28fa7daf4811a8d7
2
+ SHA256:
3
+ metadata.gz: c90fbc7dfe822e709d24caaa9f6ea4aadbc565d056acd04a83881fd456d77d04
4
+ data.tar.gz: b8b38e3f7c4b907df636ecb611db60c26aa95c7e355a102ce9b4b5b0395fc77a
5
5
  SHA512:
6
- metadata.gz: b572d405c2601801b0e57c9e76beffb8fdbbbe8b2a2acc0bddbc241c5c3d4d2d0e4626aa7ed429b683404498894b3d7949112d27656898f9b09b351ac6ccb702
7
- data.tar.gz: 390fffb2d462fa8b18620ed6b52d01329abdf411484f45bd7e6ec9d9f8618ae7cbab0345c0f009daf67c0f6c78abfd207761b9814c4633f383ac80bf201f76f6
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,3 +1,47 @@
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
42
+
43
+ * #146 - Fix value call on Rails edge (5.2+) - @ybart
44
+
1
45
  ## 3.1.0 2017-07-18
2
46
 
3
47
  * #144 - Provide a possibility to opt out of `sort_alphabetical` - @fschwahn
data/Gemfile CHANGED
@@ -1,9 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- platforms :rbx do
6
- gem 'racc'
7
- gem 'rubysl', '~> 2.0'
8
- gem 'psych'
9
- end
data/Gemfile.lock CHANGED
@@ -1,297 +1,94 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- country_select (3.0.0)
5
- countries (~> 2.0)
6
- sort_alphabetical (~> 1.0)
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 (3.2.22)
12
- activemodel (= 3.2.22)
13
- activesupport (= 3.2.22)
14
- builder (~> 3.0.0)
15
- erubis (~> 2.7.0)
16
- journey (~> 1.0.4)
17
- rack (~> 1.4.5)
18
- rack-cache (~> 1.2)
19
- rack-test (~> 0.6.1)
20
- sprockets (~> 2.2.1)
21
- activemodel (3.2.22)
22
- activesupport (= 3.2.22)
23
- builder (~> 3.0.0)
24
- activesupport (3.2.22)
25
- i18n (~> 0.6, >= 0.6.4)
26
- multi_json (~> 1.0)
27
- builder (3.0.4)
28
- coderay (1.1.0)
29
- countries (2.0.8)
30
- i18n_data (~> 0.7.0)
31
- money (~> 6.7)
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
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
+ actionview (7.0.2.3)
19
+ activesupport (= 7.0.2.3)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
+ activesupport (7.0.2.3)
25
+ concurrent-ruby (~> 1.0, >= 1.0.2)
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)
32
34
  sixarm_ruby_unaccent (~> 1.1)
33
- unicode_utils (~> 1.4)
34
- diff-lcs (1.2.5)
35
- erubis (2.7.0)
36
- ffi2-generators (0.1.1)
37
- hike (1.2.3)
38
- i18n (0.7.0)
39
- i18n_data (0.7.0)
40
- journey (1.0.4)
41
- method_source (0.8.2)
42
- money (6.9.0)
43
- i18n (>= 0.6.4, < 0.9)
44
- multi_json (1.11.2)
45
- pry (0.10.1)
46
- coderay (~> 1.1.0)
47
- method_source (~> 0.8.1)
48
- slop (~> 3.4)
49
- psych (2.0.15)
50
- racc (1.4.12)
51
- rack (1.4.7)
52
- rack-cache (1.2)
53
- rack (>= 0.4)
54
- rack-test (0.6.3)
55
- rack (>= 1.0)
56
- rake (10.4.2)
57
- rspec (3.3.0)
58
- rspec-core (~> 3.3.0)
59
- rspec-expectations (~> 3.3.0)
60
- rspec-mocks (~> 3.3.0)
61
- rspec-core (3.3.2)
62
- rspec-support (~> 3.3.0)
63
- rspec-expectations (3.3.1)
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)
44
+ nokogiri (>= 1.5.9)
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)
55
+ rack (>= 1.0, < 3)
56
+ rails-dom-testing (2.0.3)
57
+ activesupport (>= 4.2.0)
58
+ nokogiri (>= 1.6)
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)
64
69
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.3.0)
66
- rspec-mocks (3.3.2)
70
+ rspec-support (~> 3.11.0)
71
+ rspec-mocks (3.11.1)
67
72
  diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.3.0)
69
- rspec-support (3.3.0)
70
- rubysl (2.1.0)
71
- rubysl-abbrev (~> 2.0)
72
- rubysl-base64 (~> 2.0)
73
- rubysl-benchmark (~> 2.0)
74
- rubysl-bigdecimal (~> 2.0)
75
- rubysl-cgi (~> 2.0)
76
- rubysl-cgi-session (~> 2.0)
77
- rubysl-cmath (~> 2.0)
78
- rubysl-complex (~> 2.0)
79
- rubysl-continuation (~> 2.0)
80
- rubysl-coverage (~> 2.0)
81
- rubysl-csv (~> 2.0)
82
- rubysl-curses (~> 2.0)
83
- rubysl-date (~> 2.0)
84
- rubysl-delegate (~> 2.0)
85
- rubysl-digest (~> 2.0)
86
- rubysl-drb (~> 2.0)
87
- rubysl-e2mmap (~> 2.0)
88
- rubysl-english (~> 2.0)
89
- rubysl-enumerator (~> 2.0)
90
- rubysl-erb (~> 2.0)
91
- rubysl-etc (~> 2.0)
92
- rubysl-expect (~> 2.0)
93
- rubysl-fcntl (~> 2.0)
94
- rubysl-fiber (~> 2.0)
95
- rubysl-fileutils (~> 2.0)
96
- rubysl-find (~> 2.0)
97
- rubysl-forwardable (~> 2.0)
98
- rubysl-getoptlong (~> 2.0)
99
- rubysl-gserver (~> 2.0)
100
- rubysl-io-console (~> 2.0)
101
- rubysl-io-nonblock (~> 2.0)
102
- rubysl-io-wait (~> 2.0)
103
- rubysl-ipaddr (~> 2.0)
104
- rubysl-irb (~> 2.1)
105
- rubysl-logger (~> 2.0)
106
- rubysl-mathn (~> 2.0)
107
- rubysl-matrix (~> 2.0)
108
- rubysl-mkmf (~> 2.0)
109
- rubysl-monitor (~> 2.0)
110
- rubysl-mutex_m (~> 2.0)
111
- rubysl-net-ftp (~> 2.0)
112
- rubysl-net-http (~> 2.0)
113
- rubysl-net-imap (~> 2.0)
114
- rubysl-net-pop (~> 2.0)
115
- rubysl-net-protocol (~> 2.0)
116
- rubysl-net-smtp (~> 2.0)
117
- rubysl-net-telnet (~> 2.0)
118
- rubysl-nkf (~> 2.0)
119
- rubysl-observer (~> 2.0)
120
- rubysl-open-uri (~> 2.0)
121
- rubysl-open3 (~> 2.0)
122
- rubysl-openssl (~> 2.0)
123
- rubysl-optparse (~> 2.0)
124
- rubysl-ostruct (~> 2.0)
125
- rubysl-pathname (~> 2.0)
126
- rubysl-prettyprint (~> 2.0)
127
- rubysl-prime (~> 2.0)
128
- rubysl-profile (~> 2.0)
129
- rubysl-profiler (~> 2.0)
130
- rubysl-pstore (~> 2.0)
131
- rubysl-pty (~> 2.0)
132
- rubysl-rational (~> 2.0)
133
- rubysl-resolv (~> 2.0)
134
- rubysl-rexml (~> 2.0)
135
- rubysl-rinda (~> 2.0)
136
- rubysl-rss (~> 2.0)
137
- rubysl-scanf (~> 2.0)
138
- rubysl-securerandom (~> 2.0)
139
- rubysl-set (~> 2.0)
140
- rubysl-shellwords (~> 2.0)
141
- rubysl-singleton (~> 2.0)
142
- rubysl-socket (~> 2.0)
143
- rubysl-stringio (~> 2.0)
144
- rubysl-strscan (~> 2.0)
145
- rubysl-sync (~> 2.0)
146
- rubysl-syslog (~> 2.0)
147
- rubysl-tempfile (~> 2.0)
148
- rubysl-thread (~> 2.0)
149
- rubysl-thwait (~> 2.0)
150
- rubysl-time (~> 2.0)
151
- rubysl-timeout (~> 2.0)
152
- rubysl-tmpdir (~> 2.0)
153
- rubysl-tsort (~> 2.0)
154
- rubysl-un (~> 2.0)
155
- rubysl-uri (~> 2.0)
156
- rubysl-weakref (~> 2.0)
157
- rubysl-webrick (~> 2.0)
158
- rubysl-xmlrpc (~> 2.0)
159
- rubysl-yaml (~> 2.0)
160
- rubysl-zlib (~> 2.0)
161
- rubysl-abbrev (2.0.4)
162
- rubysl-base64 (2.0.0)
163
- rubysl-benchmark (2.0.1)
164
- rubysl-bigdecimal (2.0.2)
165
- rubysl-cgi (2.0.1)
166
- rubysl-cgi-session (2.0.1)
167
- rubysl-cmath (2.0.0)
168
- rubysl-complex (2.0.0)
169
- rubysl-continuation (2.0.0)
170
- rubysl-coverage (2.0.3)
171
- rubysl-csv (2.0.2)
172
- rubysl-english (~> 2.0)
173
- rubysl-curses (2.0.1)
174
- rubysl-date (2.0.9)
175
- rubysl-delegate (2.0.1)
176
- rubysl-digest (2.0.8)
177
- rubysl-drb (2.0.1)
178
- rubysl-e2mmap (2.0.0)
179
- rubysl-english (2.0.0)
180
- rubysl-enumerator (2.0.0)
181
- rubysl-erb (2.0.2)
182
- rubysl-etc (2.0.3)
183
- ffi2-generators (~> 0.1)
184
- rubysl-expect (2.0.0)
185
- rubysl-fcntl (2.0.4)
186
- ffi2-generators (~> 0.1)
187
- rubysl-fiber (2.0.0)
188
- rubysl-fileutils (2.0.3)
189
- rubysl-find (2.0.1)
190
- rubysl-forwardable (2.0.1)
191
- rubysl-getoptlong (2.0.0)
192
- rubysl-gserver (2.0.0)
193
- rubysl-socket (~> 2.0)
194
- rubysl-thread (~> 2.0)
195
- rubysl-io-console (2.0.0)
196
- rubysl-io-nonblock (2.0.0)
197
- rubysl-io-wait (2.0.0)
198
- rubysl-ipaddr (2.0.0)
199
- rubysl-irb (2.1.1)
200
- rubysl-e2mmap (~> 2.0)
201
- rubysl-mathn (~> 2.0)
202
- rubysl-thread (~> 2.0)
203
- rubysl-logger (2.1.0)
204
- rubysl-mathn (2.0.0)
205
- rubysl-matrix (2.1.0)
206
- rubysl-e2mmap (~> 2.0)
207
- rubysl-mkmf (2.0.1)
208
- rubysl-fileutils (~> 2.0)
209
- rubysl-shellwords (~> 2.0)
210
- rubysl-monitor (2.0.0)
211
- rubysl-mutex_m (2.0.0)
212
- rubysl-net-ftp (2.0.1)
213
- rubysl-net-http (2.0.4)
214
- rubysl-cgi (~> 2.0)
215
- rubysl-erb (~> 2.0)
216
- rubysl-singleton (~> 2.0)
217
- rubysl-net-imap (2.0.1)
218
- rubysl-net-pop (2.0.1)
219
- rubysl-net-protocol (2.0.1)
220
- rubysl-net-smtp (2.0.1)
221
- rubysl-net-telnet (2.0.0)
222
- rubysl-nkf (2.0.1)
223
- rubysl-observer (2.0.0)
224
- rubysl-open-uri (2.0.0)
225
- rubysl-open3 (2.0.0)
226
- rubysl-openssl (2.3.0)
227
- rubysl-optparse (2.0.1)
228
- rubysl-shellwords (~> 2.0)
229
- rubysl-ostruct (2.0.4)
230
- rubysl-pathname (2.1.0)
231
- rubysl-prettyprint (2.0.3)
232
- rubysl-prime (2.0.1)
233
- rubysl-profile (2.0.0)
234
- rubysl-profiler (2.0.1)
235
- rubysl-pstore (2.0.0)
236
- rubysl-pty (2.0.3)
237
- rubysl-rational (2.0.1)
238
- rubysl-resolv (2.1.2)
239
- rubysl-rexml (2.0.4)
240
- rubysl-rinda (2.0.1)
241
- rubysl-rss (2.0.0)
242
- rubysl-scanf (2.0.0)
243
- rubysl-securerandom (2.0.0)
244
- rubysl-set (2.0.1)
245
- rubysl-shellwords (2.0.0)
246
- rubysl-singleton (2.0.0)
247
- rubysl-socket (2.0.1)
248
- rubysl-stringio (2.0.0)
249
- rubysl-strscan (2.0.0)
250
- rubysl-sync (2.0.0)
251
- rubysl-syslog (2.1.0)
252
- ffi2-generators (~> 0.1)
253
- rubysl-tempfile (2.0.1)
254
- rubysl-thread (2.0.3)
255
- rubysl-thwait (2.0.0)
256
- rubysl-time (2.0.3)
257
- rubysl-timeout (2.0.0)
258
- rubysl-tmpdir (2.0.1)
259
- rubysl-tsort (2.0.1)
260
- rubysl-un (2.0.0)
261
- rubysl-fileutils (~> 2.0)
262
- rubysl-optparse (~> 2.0)
263
- rubysl-uri (2.0.0)
264
- rubysl-weakref (2.0.0)
265
- rubysl-webrick (2.0.0)
266
- rubysl-xmlrpc (2.0.0)
267
- rubysl-yaml (2.1.0)
268
- rubysl-zlib (2.0.1)
269
- sixarm_ruby_unaccent (1.1.1)
270
- slop (3.6.0)
73
+ rspec-support (~> 3.11.0)
74
+ rspec-support (3.11.0)
75
+ simple_po_parser (1.1.6)
76
+ sixarm_ruby_unaccent (1.2.0)
271
77
  sort_alphabetical (1.1.0)
272
78
  unicode_utils (>= 1.2.2)
273
- sprockets (2.2.3)
274
- hike (~> 1.2)
275
- multi_json (~> 1.0)
276
- rack (~> 1.0)
277
- tilt (~> 1.1, != 1.3.0)
278
- tilt (1.4.1)
79
+ tzinfo (2.0.4)
80
+ concurrent-ruby (~> 1.0)
279
81
  unicode_utils (1.4.0)
280
- wwtd (1.1.1)
281
82
 
282
83
  PLATFORMS
283
- ruby
84
+ x86_64-darwin-21
284
85
 
285
86
  DEPENDENCIES
286
- actionpack (~> 3)
87
+ actionpack (~> 7.0)
287
88
  country_select!
288
89
  pry (~> 0)
289
- psych
290
- racc
291
- rake
90
+ rake (~> 13)
292
91
  rspec (~> 3)
293
- rubysl (~> 2.0)
294
- wwtd
295
92
 
296
93
  BUNDLED WITH
297
- 1.14.4
94
+ 2.3.10
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Rails – Country Select
2
- [![Build Status](https://travis-ci.org/stefanpenner/country_select.svg)](https://travis-ci.org/stefanpenner/country_select)
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/stefanpenner/country_select/issues/new). Ideally provide versions used, and code example that demonstrates the issue.
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:
@@ -75,6 +78,11 @@ Pre-selecting a particular country:
75
78
  country_select("user", "country", selected: "GB")
76
79
  ```
77
80
 
81
+ Changing the divider when priority_countries is active.
82
+ ```ruby
83
+ country_select("user", "country", priority_countries: ["AR", "US"], priority_countries_divider: "~~~~~~")
84
+ ```
85
+
78
86
  Using existing `select` options:
79
87
  ```ruby
80
88
  country_select("user", "country", include_blank: true)
@@ -90,18 +98,46 @@ country_select("user", "country", { priority_countries: ["GB", "FR"], selected:
90
98
  ### Using a custom formatter
91
99
 
92
100
  You can define a custom formatter which will receive an
93
- [`ISO3166::Country`](https://github.com/hexorx/countries/blob/master/lib/countries/country.rb)
101
+ [`ISO3166::Country`](https://github.com/countries/countries/blob/master/lib/countries/country.rb)
94
102
  ```ruby
95
103
  # config/initializers/country_select.rb
104
+
105
+ # Return a string to customize the text in the <option> tag, `value` attribute will remain unchanged
96
106
  CountrySelect::FORMATS[:with_alpha2] = lambda do |country|
97
- "#{country.name} (#{country.alpha2})"
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
+ ]
98
120
  end
99
121
  ```
100
122
 
101
123
  ```ruby
102
124
  country_select("user", "country", format: :with_alpha2)
125
+ country_select("user", "country", format: :with_data_attrs)
103
126
  ```
104
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
+
105
141
  ### ISO 3166-1 alpha-2 codes
106
142
  The `option` tags use ISO 3166-1 alpha-2 codes as values and the country
107
143
  names as display strings. For example, the United States would appear as
@@ -109,7 +145,7 @@ names as display strings. For example, the United States would appear as
109
145
 
110
146
  Country names are automatically localized based on the value of
111
147
  `I18n.locale` thanks to the wonderful
112
- [countries gem](https://github.com/hexorx/countries/).
148
+ [countries gem](https://github.com/countries/countries/).
113
149
 
114
150
  Current translations include:
115
151
 
@@ -144,7 +180,7 @@ class User < ActiveRecord::Base
144
180
  # (usually English) name if no translation is available
145
181
  def country_name
146
182
  country = ISO3166::Country[country_code]
147
- country.translations[I18n.locale.to_s] || country.name
183
+ country.translations[I18n.locale.to_s] || country.common_name || country.iso_short_name
148
184
  end
149
185
 
150
186
  end
@@ -173,7 +209,7 @@ changing the dependencies in the gemspec.
173
209
  ```shell
174
210
  for i in gemfiles/*.gemfile
175
211
  do
176
- BUNDLE_GEMFILE=$i bundle install --no-deployment
212
+ BUNDLE_GEMFILE=$i bundle install --local
177
213
  done
178
214
  ```
179
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: "wwtd:local"
10
+ task default: 'spec'