administrate-field-country 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7d857ac1e478ff4e12c4c309c8c1d28e2799365c
4
- data.tar.gz: f098bc108191709d403d553ac03e81d461a0d356
2
+ SHA256:
3
+ metadata.gz: 4155b16110f307709432c5b634b62da14203f27e775bbc8a5c708c8600f289d7
4
+ data.tar.gz: 714354b24153a14d3e511881815810c0d7f846f71ddcda08e41daad03bb200e1
5
5
  SHA512:
6
- metadata.gz: 34dcc10e58883b70f8de77858e295c80ea40b73e687a8f8f1c9a8d5fd6da638a7da39ff19426ba59f6f0faa695ae850c0f7768917cd2fddc3de2e717987c9455
7
- data.tar.gz: 0c25122f928847401804b1c7d0d366f217759f17f70abd02973016f34a6a3aca4139e712676131a5d180c3fccf8eb434568541b026d63dfdd5690a2bee0313f7
6
+ metadata.gz: bc79159db6c09fbc75297778b7eb20e9931f724597cd45e047324c075c1db006bdd98a6e05f36b022706bfe4a4e025f0ee6270c9beef3ffe021389b3d55e7363
7
+ data.tar.gz: fd841b1ee05bb85b9c854c27612a22e14048a7486d880ae4e368e6b272ba97cc600c59b22bf67bd08e67148f4afeac5ef7b931cf046fb292bef58edcd593a220
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  *.gem
2
+ .ruby-gemset
@@ -0,0 +1 @@
1
+ 2.5.3
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.1.0](https://github.com/zooppa/administrate-field-country/tree/v0.1.0) (2018-10-30)
4
+ [Full Changelog](https://github.com/zooppa/administrate-field-country/compare/v0.0.4...v0.1.0)
5
+
6
+ * Allow customization of `country_select` options (thanks @tuxtux59)
7
+
3
8
  ## [v0.0.4](https://github.com/zooppa/administrate-field-country/tree/v0.0.4) (2017-12-11)
4
9
  [Full Changelog](https://github.com/zooppa/administrate-field-country/compare/v0.0.3...v0.0.4)
5
10
 
@@ -1,55 +1,59 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- administrate-field-country (0.0.4)
4
+ administrate-field-country (0.1.0)
5
5
  administrate (< 1.0.0)
6
6
  country_select (~> 3.1)
7
- rails (>= 4.2)
7
+ rails (>= 4.2, < 6)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.1.4)
13
- actionpack (= 5.1.4)
12
+ actioncable (5.2.1)
13
+ actionpack (= 5.2.1)
14
14
  nio4r (~> 2.0)
15
- websocket-driver (~> 0.6.1)
16
- actionmailer (5.1.4)
17
- actionpack (= 5.1.4)
18
- actionview (= 5.1.4)
19
- activejob (= 5.1.4)
15
+ websocket-driver (>= 0.6.1)
16
+ actionmailer (5.2.1)
17
+ actionpack (= 5.2.1)
18
+ actionview (= 5.2.1)
19
+ activejob (= 5.2.1)
20
20
  mail (~> 2.5, >= 2.5.4)
21
21
  rails-dom-testing (~> 2.0)
22
- actionpack (5.1.4)
23
- actionview (= 5.1.4)
24
- activesupport (= 5.1.4)
22
+ actionpack (5.2.1)
23
+ actionview (= 5.2.1)
24
+ activesupport (= 5.2.1)
25
25
  rack (~> 2.0)
26
26
  rack-test (>= 0.6.3)
27
27
  rails-dom-testing (~> 2.0)
28
28
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.1.4)
30
- activesupport (= 5.1.4)
29
+ actionview (5.2.1)
30
+ activesupport (= 5.2.1)
31
31
  builder (~> 3.1)
32
32
  erubi (~> 1.4)
33
33
  rails-dom-testing (~> 2.0)
34
34
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.1.4)
36
- activesupport (= 5.1.4)
35
+ activejob (5.2.1)
36
+ activesupport (= 5.2.1)
37
37
  globalid (>= 0.3.6)
38
- activemodel (5.1.4)
39
- activesupport (= 5.1.4)
40
- activerecord (5.1.4)
41
- activemodel (= 5.1.4)
42
- activesupport (= 5.1.4)
43
- arel (~> 8.0)
44
- activesupport (5.1.4)
38
+ activemodel (5.2.1)
39
+ activesupport (= 5.2.1)
40
+ activerecord (5.2.1)
41
+ activemodel (= 5.2.1)
42
+ activesupport (= 5.2.1)
43
+ arel (>= 9.0)
44
+ activestorage (5.2.1)
45
+ actionpack (= 5.2.1)
46
+ activerecord (= 5.2.1)
47
+ marcel (~> 0.3.1)
48
+ activesupport (5.2.1)
45
49
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
- i18n (~> 0.7)
50
+ i18n (>= 0.7, < 2)
47
51
  minitest (~> 5.1)
48
52
  tzinfo (~> 1.1)
49
- administrate (0.8.1)
50
- actionpack (>= 4.2, < 5.2)
51
- actionview (>= 4.2, < 5.2)
52
- activerecord (>= 4.2, < 5.2)
53
+ administrate (0.11.0)
54
+ actionpack (>= 4.2, < 6.0)
55
+ actionview (>= 4.2, < 6.0)
56
+ activerecord (>= 4.2, < 6.0)
53
57
  autoprefixer-rails (>= 6.0)
54
58
  datetime_picker_rails (~> 0.0.7)
55
59
  jquery-rails (>= 4.0)
@@ -57,12 +61,12 @@ GEM
57
61
  momentjs-rails (~> 2.8)
58
62
  sass-rails (~> 5.0)
59
63
  selectize-rails (~> 0.6)
60
- arel (8.0.0)
61
- autoprefixer-rails (7.2.2)
64
+ arel (9.0.0)
65
+ autoprefixer-rails (9.3.1)
62
66
  execjs
63
67
  builder (3.2.3)
64
68
  concurrent-ruby (1.0.5)
65
- countries (2.1.2)
69
+ countries (2.1.4)
66
70
  i18n_data (~> 0.8.0)
67
71
  money (~> 6.9)
68
72
  sixarm_ruby_unaccent (~> 1.1)
@@ -70,19 +74,19 @@ GEM
70
74
  country_select (3.1.1)
71
75
  countries (~> 2.0)
72
76
  sort_alphabetical (~> 1.0)
73
- crass (1.0.3)
77
+ crass (1.0.4)
74
78
  datetime_picker_rails (0.0.7)
75
79
  momentjs-rails (>= 2.8.1)
76
80
  diff-lcs (1.3)
77
- erubi (1.7.0)
81
+ erubi (1.7.1)
78
82
  execjs (2.7.0)
79
- ffi (1.9.18)
83
+ ffi (1.9.25)
80
84
  globalid (0.4.1)
81
85
  activesupport (>= 4.2.0)
82
- i18n (0.9.1)
86
+ i18n (1.1.1)
83
87
  concurrent-ruby (~> 1.0)
84
88
  i18n_data (0.8.0)
85
- jquery-rails (4.3.1)
89
+ jquery-rails (4.3.3)
86
90
  rails-dom-testing (>= 1, < 3)
87
91
  railties (>= 4.2.0)
88
92
  thor (>= 0.14, < 2.0)
@@ -98,66 +102,70 @@ GEM
98
102
  activerecord
99
103
  kaminari-core (= 1.1.1)
100
104
  kaminari-core (1.1.1)
101
- loofah (2.1.1)
105
+ loofah (2.2.3)
102
106
  crass (~> 1.0.2)
103
107
  nokogiri (>= 1.5.9)
104
- mail (2.7.0)
108
+ mail (2.7.1)
105
109
  mini_mime (>= 0.1.1)
110
+ marcel (0.3.3)
111
+ mimemagic (~> 0.3.2)
106
112
  method_source (0.9.0)
107
- mini_mime (1.0.0)
113
+ mimemagic (0.3.2)
114
+ mini_mime (1.0.1)
108
115
  mini_portile2 (2.3.0)
109
- minitest (5.10.3)
110
- momentjs-rails (2.17.1)
116
+ minitest (5.11.3)
117
+ momentjs-rails (2.20.1)
111
118
  railties (>= 3.1)
112
- money (6.10.0)
113
- i18n (>= 0.6.4, < 1.0)
114
- nio4r (2.1.0)
115
- nokogiri (1.8.1)
119
+ money (6.13.1)
120
+ i18n (>= 0.6.4, <= 2)
121
+ nio4r (2.3.1)
122
+ nokogiri (1.8.5)
116
123
  mini_portile2 (~> 2.3.0)
117
- rack (2.0.3)
118
- rack-test (0.8.2)
124
+ rack (2.0.5)
125
+ rack-test (1.1.0)
119
126
  rack (>= 1.0, < 3)
120
- rails (5.1.4)
121
- actioncable (= 5.1.4)
122
- actionmailer (= 5.1.4)
123
- actionpack (= 5.1.4)
124
- actionview (= 5.1.4)
125
- activejob (= 5.1.4)
126
- activemodel (= 5.1.4)
127
- activerecord (= 5.1.4)
128
- activesupport (= 5.1.4)
127
+ rails (5.2.1)
128
+ actioncable (= 5.2.1)
129
+ actionmailer (= 5.2.1)
130
+ actionpack (= 5.2.1)
131
+ actionview (= 5.2.1)
132
+ activejob (= 5.2.1)
133
+ activemodel (= 5.2.1)
134
+ activerecord (= 5.2.1)
135
+ activestorage (= 5.2.1)
136
+ activesupport (= 5.2.1)
129
137
  bundler (>= 1.3.0)
130
- railties (= 5.1.4)
138
+ railties (= 5.2.1)
131
139
  sprockets-rails (>= 2.0.0)
132
140
  rails-dom-testing (2.0.3)
133
141
  activesupport (>= 4.2.0)
134
142
  nokogiri (>= 1.6)
135
- rails-html-sanitizer (1.0.3)
136
- loofah (~> 2.0)
137
- railties (5.1.4)
138
- actionpack (= 5.1.4)
139
- activesupport (= 5.1.4)
143
+ rails-html-sanitizer (1.0.4)
144
+ loofah (~> 2.2, >= 2.2.2)
145
+ railties (5.2.1)
146
+ actionpack (= 5.2.1)
147
+ activesupport (= 5.2.1)
140
148
  method_source
141
149
  rake (>= 0.8.7)
142
- thor (>= 0.18.1, < 2.0)
143
- rake (10.5.0)
144
- rb-fsevent (0.10.2)
150
+ thor (>= 0.19.0, < 2.0)
151
+ rake (12.3.1)
152
+ rb-fsevent (0.10.3)
145
153
  rb-inotify (0.9.10)
146
154
  ffi (>= 0.5.0, < 2)
147
- rspec (3.5.0)
148
- rspec-core (~> 3.5.0)
149
- rspec-expectations (~> 3.5.0)
150
- rspec-mocks (~> 3.5.0)
151
- rspec-core (3.5.4)
152
- rspec-support (~> 3.5.0)
153
- rspec-expectations (3.5.0)
155
+ rspec (3.8.0)
156
+ rspec-core (~> 3.8.0)
157
+ rspec-expectations (~> 3.8.0)
158
+ rspec-mocks (~> 3.8.0)
159
+ rspec-core (3.8.0)
160
+ rspec-support (~> 3.8.0)
161
+ rspec-expectations (3.8.2)
154
162
  diff-lcs (>= 1.2.0, < 2.0)
155
- rspec-support (~> 3.5.0)
156
- rspec-mocks (3.5.0)
163
+ rspec-support (~> 3.8.0)
164
+ rspec-mocks (3.8.0)
157
165
  diff-lcs (>= 1.2.0, < 2.0)
158
- rspec-support (~> 3.5.0)
159
- rspec-support (3.5.0)
160
- sass (3.5.3)
166
+ rspec-support (~> 3.8.0)
167
+ rspec-support (3.8.0)
168
+ sass (3.6.0)
161
169
  sass-listen (~> 4.0.0)
162
170
  sass-listen (4.0.0)
163
171
  rb-fsevent (~> 0.9, >= 0.9.4)
@@ -168,11 +176,11 @@ GEM
168
176
  sprockets (>= 2.8, < 4.0)
169
177
  sprockets-rails (>= 2.0, < 4.0)
170
178
  tilt (>= 1.1, < 3)
171
- selectize-rails (0.12.4.1)
179
+ selectize-rails (0.12.5)
172
180
  sixarm_ruby_unaccent (1.2.0)
173
181
  sort_alphabetical (1.1.0)
174
182
  unicode_utils (>= 1.2.2)
175
- sprockets (3.7.1)
183
+ sprockets (3.7.2)
176
184
  concurrent-ruby (~> 1.0)
177
185
  rack (> 1, < 3)
178
186
  sprockets-rails (3.2.1)
@@ -182,10 +190,10 @@ GEM
182
190
  thor (0.20.0)
183
191
  thread_safe (0.3.6)
184
192
  tilt (2.0.8)
185
- tzinfo (1.2.4)
193
+ tzinfo (1.2.5)
186
194
  thread_safe (~> 0.1)
187
195
  unicode_utils (1.4.0)
188
- websocket-driver (0.6.5)
196
+ websocket-driver (0.7.0)
189
197
  websocket-extensions (>= 0.1.0)
190
198
  websocket-extensions (0.1.3)
191
199
 
@@ -194,9 +202,8 @@ PLATFORMS
194
202
 
195
203
  DEPENDENCIES
196
204
  administrate-field-country!
197
- bundler (~> 1.13)
198
- rake (~> 10.0)
199
- rspec (~> 3.0)
205
+ rake (~> 12.3)
206
+ rspec (~> 3.8)
200
207
 
201
208
  BUNDLED WITH
202
- 1.16.0
209
+ 1.16.2
data/README.md CHANGED
@@ -1,15 +1,18 @@
1
1
  # Administrate::Field::Country
2
2
 
3
+ [![Build Status](https://semaphoreci.com/api/v1/zooppa/administrate-field-country/branches/master/badge.svg)](https://semaphoreci.com/zooppa/administrate-field-country)
3
4
  [![Code Climate](https://codeclimate.com/github/zooppa/administrate-field-country/badges/gpa.svg)](https://codeclimate.com/github/zooppa/administrate-field-country)
4
5
 
5
6
  A plugin to deal with country selection in [Administrate], with the help of [country_select] gem.
6
7
 
8
+ You can customize any [country_select options] by passing a `country_select_options` hash in your dashboard configuration (see below).
9
+
7
10
  ## Usage
8
11
 
9
12
  Add it to your `Gemfile`:
10
13
 
11
14
  ```ruby
12
- gem 'administrate-field-country', '~> 0.0.1'
15
+ gem 'administrate-field-country', '~> 0.1.0'
13
16
  ```
14
17
 
15
18
  Run:
@@ -22,14 +25,15 @@ Add to your `FooDashboard`:
22
25
 
23
26
  ```ruby
24
27
  ATTRIBUTE_TYPES = {
25
- bar: Field::Country
28
+ bar: Field::Country.with_options(country_select_options: { priority_countries: %w[US IT GB], include_blank: true })
26
29
  }.freeze
27
30
  ```
28
31
 
29
32
  ## About
30
33
 
31
- Administrate::Field::Country is maintained by [Zooppa].
34
+ This gem is maintained by [Zooppa].
32
35
 
33
36
  [administrate]: https://github.com/thoughtbot/administrate
34
37
  [country_select]: https://github.com/stefanpenner/country_select
35
- [zooppa]: https://www.zooppa.com/
38
+ [country_select options]: https://github.com/stefanpenner/country_select#usage
39
+ [zooppa]: https://github.com/zooppa
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -4,12 +4,12 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'administrate-field-country'
7
- gem.version = '0.0.4'
8
- gem.authors = ['Marco Arduini']
9
- gem.email = ['mar.arduini@gmail.com']
7
+ gem.version = '0.1.0'
8
+ gem.authors = ['Zooppa']
9
+ gem.email = ['dev@zooppa.com']
10
10
 
11
- gem.summary = 'A plugin to deal with country selection in Administrate'
12
- gem.description = gem.summary
11
+ gem.summary = 'Country field plugin for Administrate'
12
+ gem.description = 'A plugin to deal with country selection in Administrate'
13
13
  gem.homepage = 'https://github.com/zooppa/administrate-field-country'
14
14
  gem.license = 'MIT'
15
15
 
@@ -19,10 +19,9 @@ Gem::Specification.new do |gem|
19
19
  end
20
20
 
21
21
  gem.add_runtime_dependency 'administrate', '< 1.0.0'
22
- gem.add_runtime_dependency 'rails', '>= 4.2'
22
+ gem.add_runtime_dependency 'rails', '>= 4.2', '< 6'
23
23
  gem.add_runtime_dependency 'country_select', '~> 3.1'
24
24
 
25
- gem.add_development_dependency 'bundler', '~> 1.13'
26
- gem.add_development_dependency 'rake', '~> 10.0'
27
- gem.add_development_dependency 'rspec', '~> 3.0'
25
+ gem.add_development_dependency 'rake', '~> 12.3'
26
+ gem.add_development_dependency 'rspec', '~> 3.8'
28
27
  end
@@ -2,5 +2,5 @@
2
2
  <%= f.label field.attribute %>
3
3
  </div>
4
4
  <div class="field-unit__field">
5
- <%= f.country_select field.attribute, priority_countries: %w(US IT GB), include_blank: true %>
5
+ <%= f.country_select field.attribute, field.country_select_options %>
6
6
  </div>
@@ -1,5 +1,5 @@
1
- require 'administrate/field/base'
2
1
  require 'rails'
2
+ require 'administrate/field/base'
3
3
 
4
4
  module Administrate
5
5
  module Field
@@ -9,6 +9,10 @@ module Administrate
9
9
  def to_s
10
10
  data
11
11
  end
12
+
13
+ def country_select_options
14
+ options.fetch(:country_select_options, {})
15
+ end
12
16
  end
13
17
  end
14
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-country
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Marco Arduini
7
+ - Zooppa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-11 00:00:00.000000000 Z
11
+ date: 2018-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '4.2'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '6'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@ dependencies:
38
41
  - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: '4.2'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '6'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: country_select
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -52,57 +58,44 @@ dependencies:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '3.1'
55
- - !ruby/object:Gem::Dependency
56
- name: bundler
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.13'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.13'
69
61
  - !ruby/object:Gem::Dependency
70
62
  name: rake
71
63
  requirement: !ruby/object:Gem::Requirement
72
64
  requirements:
73
65
  - - "~>"
74
66
  - !ruby/object:Gem::Version
75
- version: '10.0'
67
+ version: '12.3'
76
68
  type: :development
77
69
  prerelease: false
78
70
  version_requirements: !ruby/object:Gem::Requirement
79
71
  requirements:
80
72
  - - "~>"
81
73
  - !ruby/object:Gem::Version
82
- version: '10.0'
74
+ version: '12.3'
83
75
  - !ruby/object:Gem::Dependency
84
76
  name: rspec
85
77
  requirement: !ruby/object:Gem::Requirement
86
78
  requirements:
87
79
  - - "~>"
88
80
  - !ruby/object:Gem::Version
89
- version: '3.0'
81
+ version: '3.8'
90
82
  type: :development
91
83
  prerelease: false
92
84
  version_requirements: !ruby/object:Gem::Requirement
93
85
  requirements:
94
86
  - - "~>"
95
87
  - !ruby/object:Gem::Version
96
- version: '3.0'
88
+ version: '3.8'
97
89
  description: A plugin to deal with country selection in Administrate
98
90
  email:
99
- - mar.arduini@gmail.com
91
+ - dev@zooppa.com
100
92
  executables: []
101
93
  extensions: []
102
94
  extra_rdoc_files: []
103
95
  files:
104
96
  - ".gitignore"
105
97
  - ".rspec"
98
+ - ".ruby-version"
106
99
  - ".travis.yml"
107
100
  - CHANGELOG.md
108
101
  - Gemfile
@@ -135,8 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
128
  version: '0'
136
129
  requirements: []
137
130
  rubyforge_project:
138
- rubygems_version: 2.6.13
131
+ rubygems_version: 2.7.7
139
132
  signing_key:
140
133
  specification_version: 4
141
- summary: A plugin to deal with country selection in Administrate
134
+ summary: Country field plugin for Administrate
142
135
  test_files: []