activeadmin-searchable_select 1.2.1 → 1.3.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
2
  SHA256:
3
- metadata.gz: 0f06a7e42bdf09260f9581eb93b9b53254410068c9f0748d958621b75b47a1d9
4
- data.tar.gz: 7a735aed9e7a2bd6da9c7702407a318dd0740f1b3d519bf220513163ddf848a9
3
+ metadata.gz: 6a0f1ed4c7ca3f0b20a9a1844aa46ecf2693b5b91f447874cbfbc013d5a84e31
4
+ data.tar.gz: cdca70eae83da1caf578f39957b66fe30cec69a76c67f7f06d2a45bb3c680f7d
5
5
  SHA512:
6
- metadata.gz: 10cf476611bc7d46a2c39d8db812c1638de6d4484e6cd522962ab951a97ffb1353fc23313df5bf47cbb417176f0d3df9bb2de5557f5e7f33d650df4e27366bcb
7
- data.tar.gz: 2bb155897e057ca7c073677cc232ccfdde3c761e463ee261382fed82f020921fa2b80e26a10dd8494650b21b0d1b0696934762a9f9e2d817d0f79a4bc9274dad
6
+ metadata.gz: b509e473b24b32cad8c401f197413c7b01c7de196aaf0a2a4a735f7f6bd40d4ea76ed7733f9b00f87ecf23e6d3aba0bceee599f85c4e39fb1a17639b4234d94f
7
+ data.tar.gz: f224c6cc6fe60af0373b1d82c9d57a43282c3f327bf5c3c295d2b1d17ce5f9aace56aa0d4320405f40783a270fedaa8137496712091fc167712b9b1e1364a029
@@ -0,0 +1,34 @@
1
+ name: tests
2
+ on: [push, pull_request]
3
+
4
+ jobs:
5
+ rspec:
6
+ runs-on: ubuntu-latest
7
+
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby-version:
12
+ - '2.6'
13
+ - '2.7'
14
+ gemfile:
15
+ - gemfiles/rails_5.1_active_admin_1.x.gemfile
16
+ - gemfiles/rails_5.x_active_admin_1.x.gemfile
17
+ - gemfiles/rails_5.x_active_admin_2.x.gemfile
18
+ - gemfiles/rails_6.x_active_admin_2.x.gemfile
19
+ include:
20
+ - ruby-version: '3.0'
21
+ gemfile: gemfiles/rails_6.x_active_admin_2.x.gemfile
22
+
23
+ env:
24
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
25
+
26
+ steps:
27
+ - uses: actions/checkout@v2
28
+ - name: Set up Ruby
29
+ uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby-version }}
32
+ bundler-cache: true
33
+ - name: Run tests
34
+ run: bundle exec rspec
data/Appraisals CHANGED
@@ -1,10 +1,3 @@
1
- appraise 'rails-4.2-active-admin-1.0.0.pre4' do
2
- gem 'rails', '~> 4.2'
3
- gem 'activeadmin', '1.0.0.pre4'
4
- gem 'jquery-ui-rails', '~> 5.0'
5
- gem 'sqlite3', '~> 1.3.6'
6
- end
7
-
8
1
  appraise 'rails-5.1-active-admin-1.x' do
9
2
  gem 'rails', '~> 5.1.0'
10
3
  gem 'activeadmin', '~> 1.0'
@@ -18,4 +11,9 @@ end
18
11
  appraise 'rails-5.x-active-admin-2.x' do
19
12
  gem 'rails', '~> 5.2'
20
13
  gem 'activeadmin', '~> 2.0'
14
+ end
15
+
16
+ appraise 'rails-6.x-active-admin-2.x' do
17
+ gem 'rails', '~> 6.1'
18
+ gem 'activeadmin', '~> 2.0'
21
19
  end
data/CHANGELOG.md CHANGED
@@ -1,25 +1,20 @@
1
1
  # CHANGELOG
2
2
 
3
- ### Version 1.2.1
3
+ ### Version 1.3.0
4
4
 
5
- 2020-12-08
5
+ 2021-02-03
6
6
 
7
- [Compare changes](https://github.com/codevise/activeadmin-searchable_select/compare/v1.2.0...v1.2.1)
7
+ [Compare changes](https://github.com/codevise/activeadmin-searchable_select/compare/1-2-stable...v1.3.0)
8
8
 
9
- - Fix ajax url when active admin namespace is set to false
10
- ([#22](https://github.com/codevise/activeadmin-searchable_select/pull/22))
11
-
12
- ### Version 1.2.0
13
-
14
- 2019-05-10
15
-
16
- [Compare changes](https://github.com/codevise/activeadmin-searchable_select/compare/1-1-stable...v1.2.0)
17
-
18
- - Add support for Active Admin 2.0
19
- ([#13](https://github.com/codevise/activeadmin-searchable_select/pull/13))
20
- - Improve Appraisal setup
21
- ([#12](https://github.com/codevise/activeadmin-searchable_select/pull/12))
9
+ - Add support for Ruby 3
10
+ ([#26](https://github.com/codevise/activeadmin-searchable_select/pull/26))
11
+ - Add a small description of how to pass options to Select2
12
+ ([#27](https://github.com/codevise/activeadmin-searchable_select/pull/27))
13
+ - Update CI Setup
14
+ ([#25](https://github.com/codevise/activeadmin-searchable_select/pull/25))
15
+ - Allow Bundler 2 in development dependencies
16
+ ([#18](https://github.com/codevise/activeadmin-searchable_select/pull/18))
22
17
 
23
18
  See
24
- [1-1-stable branch](https://github.com/codevise/activeadmin-searchable_select/blob/1-1-stable/CHANGELOG.md)
19
+ [1-2-stable branch](https://github.com/codevise/activeadmin-searchable_select/blob/1-2-stable/CHANGELOG.md)
25
20
  for previous changes.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # ActiveAdmin Searchable Select
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/activeadmin-searchable_select.svg)](http://badge.fury.io/rb/activeadmin-searchable_select)
4
- [![Build Status](https://travis-ci.org/codevise/activeadmin-searchable_select.svg?branch=master)](https://travis-ci.org/codevise/activeadmin-searchable_select)
4
+ [![Build Status](https://github.com/codevise/activeadmin-searchable_select.svg?branch=master)](https://github.com/codevise/activeadmin-searchable_select/actions)
5
5
 
6
6
  Searchable select boxes (via [Select2](https://select2.org/)) for
7
7
  ActiveAdmin forms and filters. Extends the ActiveAdmin resource DSL to
@@ -12,7 +12,7 @@ allow defining JSON endpoints to fetch options from asynchronously.
12
12
  Add `activeadmin-searchable_select` to your Gemfile:
13
13
 
14
14
  ```ruby
15
- gem 'activeadmin-searchable_select
15
+ gem 'activeadmin-searchable_select'
16
16
  ```
17
17
 
18
18
  Import stylesheets and require javascripts:
@@ -244,6 +244,29 @@ for feature specs:
244
244
 
245
245
  ```
246
246
 
247
+ ### Passing options to Select2
248
+
249
+ It is possible to pass and define configuration options to Select2
250
+ via `data-attributes` using nested (subkey) options.
251
+
252
+ Attributes need to be added to the `input_html` option in the form input.
253
+ For example you can tell Select2 how long to wait after a user
254
+ has stopped typing before sending the request:
255
+
256
+ ```ruby
257
+ ...
258
+ f.input(:category,
259
+ as: :searchable_select,
260
+ ajax: true,
261
+ input_html: {
262
+ data: {
263
+ 'ajax--delay' => 500
264
+ }
265
+ })
266
+ ...
267
+ ```
268
+
269
+
247
270
  ## Development
248
271
 
249
272
  To run the tests install bundled gems and invoke RSpec:
@@ -14,20 +14,26 @@ Gem::Specification.new do |spec|
14
14
  spec.files = `git ls-files -z`.split("\x0")
15
15
  spec.require_paths = ['lib']
16
16
 
17
- spec.required_ruby_version = '~> 2.1'
17
+ spec.required_ruby_version = ['>= 2.1', '< 4']
18
18
 
19
- spec.add_development_dependency 'bundler', '~> 1.5'
19
+ spec.add_development_dependency 'bundler', ['>= 1.5', '< 3']
20
20
  spec.add_development_dependency 'rake'
21
21
  spec.add_development_dependency 'appraisal', '~> 2.2'
22
22
  spec.add_development_dependency 'rspec-rails', '~> 3.6'
23
23
  spec.add_development_dependency 'combustion', '~> 1.0'
24
24
  spec.add_development_dependency 'database_cleaner', '~> 1.6'
25
25
  spec.add_development_dependency 'sqlite3', '~> 1.3'
26
- spec.add_development_dependency 'capybara', '~> 2.15'
27
- spec.add_development_dependency 'poltergeist', '~> 1.15'
26
+
27
+ spec.add_development_dependency 'capybara', '~> 3.9'
28
+ spec.add_development_dependency 'puma', '~> 5.0'
29
+ spec.add_development_dependency 'selenium-webdriver', '~> 3.6'
30
+ spec.add_development_dependency 'webdrivers', '~> 4.0'
31
+
32
+ spec.add_development_dependency 'coffee-rails'
33
+ spec.add_development_dependency 'rails'
28
34
  spec.add_development_dependency 'rubocop', '~> 0.42.0'
29
35
  spec.add_development_dependency 'semmy', '~> 1.0'
30
- spec.add_development_dependency 'rails'
36
+ spec.add_development_dependency 'sprockets', '~> 3.7'
31
37
 
32
38
  spec.add_runtime_dependency 'activeadmin', ['>= 1.x', '< 3']
33
39
  spec.add_runtime_dependency 'jquery-rails', ['>= 3.0', '< 5']
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "sass-rails"
6
+ gem "rails", "~> 6.1"
7
+ gem "activeadmin", "~> 2.0"
8
+
9
+ gemspec path: "../"
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module SearchableSelect
3
- VERSION = '1.2.1'.freeze
3
+ VERSION = '1.3.0'.freeze
4
4
  end
5
5
  end
@@ -1,7 +1,8 @@
1
1
  require 'capybara/rspec'
2
- require 'capybara/poltergeist'
2
+ require 'selenium-webdriver'
3
+ require 'webdrivers/chromedriver'
3
4
 
4
- Capybara.javascript_driver = :poltergeist
5
+ Capybara.javascript_driver = :selenium_chrome_headless
5
6
 
6
7
  RSpec.configure do |config|
7
8
  config.include Capybara::RSpecMatchers, type: :request
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-searchable_select
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-08 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.5'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -114,28 +120,84 @@ dependencies:
114
120
  requirements:
115
121
  - - "~>"
116
122
  - !ruby/object:Gem::Version
117
- version: '2.15'
123
+ version: '3.9'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '3.9'
131
+ - !ruby/object:Gem::Dependency
132
+ name: puma
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '5.0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '5.0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: selenium-webdriver
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '3.6'
118
152
  type: :development
119
153
  prerelease: false
120
154
  version_requirements: !ruby/object:Gem::Requirement
121
155
  requirements:
122
156
  - - "~>"
123
157
  - !ruby/object:Gem::Version
124
- version: '2.15'
158
+ version: '3.6'
125
159
  - !ruby/object:Gem::Dependency
126
- name: poltergeist
160
+ name: webdrivers
127
161
  requirement: !ruby/object:Gem::Requirement
128
162
  requirements:
129
163
  - - "~>"
130
164
  - !ruby/object:Gem::Version
131
- version: '1.15'
165
+ version: '4.0'
132
166
  type: :development
133
167
  prerelease: false
134
168
  version_requirements: !ruby/object:Gem::Requirement
135
169
  requirements:
136
170
  - - "~>"
137
171
  - !ruby/object:Gem::Version
138
- version: '1.15'
172
+ version: '4.0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: coffee-rails
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ - !ruby/object:Gem::Dependency
188
+ name: rails
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
139
201
  - !ruby/object:Gem::Dependency
140
202
  name: rubocop
141
203
  requirement: !ruby/object:Gem::Requirement
@@ -165,19 +227,19 @@ dependencies:
165
227
  - !ruby/object:Gem::Version
166
228
  version: '1.0'
167
229
  - !ruby/object:Gem::Dependency
168
- name: rails
230
+ name: sprockets
169
231
  requirement: !ruby/object:Gem::Requirement
170
232
  requirements:
171
- - - ">="
233
+ - - "~>"
172
234
  - !ruby/object:Gem::Version
173
- version: '0'
235
+ version: '3.7'
174
236
  type: :development
175
237
  prerelease: false
176
238
  version_requirements: !ruby/object:Gem::Requirement
177
239
  requirements:
178
- - - ">="
240
+ - - "~>"
179
241
  - !ruby/object:Gem::Version
180
- version: '0'
242
+ version: '3.7'
181
243
  - !ruby/object:Gem::Dependency
182
244
  name: activeadmin
183
245
  requirement: !ruby/object:Gem::Requirement
@@ -238,10 +300,10 @@ executables: []
238
300
  extensions: []
239
301
  extra_rdoc_files: []
240
302
  files:
303
+ - ".github/workflows/tests.yml"
241
304
  - ".gitignore"
242
305
  - ".rspec"
243
306
  - ".rubocop.yml"
244
- - ".travis.yml"
245
307
  - ".yardopts"
246
308
  - Appraisals
247
309
  - CHANGELOG.md
@@ -254,10 +316,10 @@ files:
254
316
  - app/assets/javascripts/active_admin/searchable_select/init.js
255
317
  - app/assets/stylesheets/active_admin/searchable_select.scss
256
318
  - bin/rspec
257
- - gemfiles/rails_4.2_active_admin_1.0.0.pre4.gemfile
258
319
  - gemfiles/rails_5.1_active_admin_1.x.gemfile
259
320
  - gemfiles/rails_5.x_active_admin_1.x.gemfile
260
321
  - gemfiles/rails_5.x_active_admin_2.x.gemfile
322
+ - gemfiles/rails_6.x_active_admin_2.x.gemfile
261
323
  - lib/activeadmin-searchable_select.rb
262
324
  - lib/activeadmin/inputs/filters/searchable_select_input.rb
263
325
  - lib/activeadmin/inputs/searchable_select_input.rb
@@ -301,17 +363,19 @@ require_paths:
301
363
  - lib
302
364
  required_ruby_version: !ruby/object:Gem::Requirement
303
365
  requirements:
304
- - - "~>"
366
+ - - ">="
305
367
  - !ruby/object:Gem::Version
306
368
  version: '2.1'
369
+ - - "<"
370
+ - !ruby/object:Gem::Version
371
+ version: '4'
307
372
  required_rubygems_version: !ruby/object:Gem::Requirement
308
373
  requirements:
309
374
  - - ">="
310
375
  - !ruby/object:Gem::Version
311
376
  version: '0'
312
377
  requirements: []
313
- rubyforge_project:
314
- rubygems_version: 2.7.5
378
+ rubygems_version: 3.2.3
315
379
  signing_key:
316
380
  specification_version: 4
317
381
  summary: Use searchable selects based on Select2 in Active Admin forms and filters.
data/.travis.yml DELETED
@@ -1,17 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.4
4
-
5
- # Use container based travis infrastructure which allows caching
6
- # features for open source projects.
7
- sudo: false
8
- cache:
9
- bundler: true
10
-
11
- gemfile:
12
- - gemfiles/rails_4.2_active_admin_1.0.0.pre4.gemfile
13
- - gemfiles/rails_5.1_active_admin_1.x.gemfile
14
- - gemfiles/rails_5.x_active_admin_1.x.gemfile
15
- - gemfiles/rails_5.x_active_admin_2.x.gemfile
16
-
17
- script: bundle exec rspec
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sass-rails"
6
- gem "rails", "~> 4.2"
7
- gem "activeadmin", "1.0.0.pre4"
8
- gem "jquery-ui-rails", "~> 5.0"
9
- gem "sqlite3", "~> 1.3.6"
10
-
11
- gemspec path: "../"