trln-chosen-rails 1.30.0.pre.beta → 1.30.0.pre.beta3

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: 9a2a519cd6aabeb11949e84b419f7164bcd407377edf9af4ec681d17755754b1
4
- data.tar.gz: e116100e66af2f9f17c3b3c4434d628d32382dd40c4f48286e6ee3c5fdd7e071
3
+ metadata.gz: ebfd2fd1bca648c424faa4b52323727e26424c05b10d2584208a93adffaa6617
4
+ data.tar.gz: e2828b44f0394b987d0061728c265bf0005ba4c4412764d8e29fa6a77c04cb0f
5
5
  SHA512:
6
- metadata.gz: 73b2361856eae6fff2672e74e4b3f6fb09914e0f09f77654513a9b012ce7c75c270dcd7a5e9315588390c0e7cbe3a6a6c842863638b58414d14da0e685a86a60
7
- data.tar.gz: 55f49773c020454fbb6cf02197f456e1b7ecc672f859fe32905842d729501e9957761d158b24842c1a200557275aec83b7aed997c69c91d46252568add892d32
6
+ metadata.gz: 45374709edbfd144b2e653679f03af29a94f7548f0b1b48704b109a173d3c08a6d8a5d59ac08826746a60959bdab6e89a31bf11f0549167b72de6a87bfb55255
7
+ data.tar.gz: 95bb7f0c81a74827e1bcb28cc773747ef762ddb1112a7a6e3ef94b1492e70eeb0e6f6697746ea5b02dcd23410bec6d450973fc414210b53b004ae2ff79436ab1
data/README.md CHANGED
@@ -2,7 +2,15 @@
2
2
 
3
3
  [Chosen](https://github.com/harvesthq/chosen) is a library for making long, unwieldy select boxes more user friendly.
4
4
 
5
- The `trln-chosen-rails` gem integrates the `Chosen` with the Rails asset pipeline. This project is a fork of the original `chosen-rails` which removes the dependency on the now deprecated `sass` gem.
5
+ The `trln-chosen-rails` gem is a fork of the original `chosen-rails`
6
+ gem and integrates the `Chosen` with the Rails asset pipeline. This fork removes dependencies on `coffee-rails` and on any particular Sass implementation (the original had a dependency on `sassc-rails`).
7
+
8
+ One tradeoff is that the version of the `chosen` library is frozen at version 1.8.7.
9
+
10
+ To make full use of this gem you will need to either add a Sass compilation
11
+ step to your asset handling or compile the bundled
12
+ `vendor/assets/stylesheets/chosen-base.scss` file you can find in this gem's
13
+ directory and add that to your Rails application's `assets/stylesheets` directory. Since the TRLN Blacklight implementations all employ the use of Sass, this should be unnecessary for members of the consortium.
6
14
 
7
15
  ## Usage
8
16
 
@@ -20,8 +28,6 @@ Then run `bundle install`
20
28
 
21
29
  You can get jquery via [jquery-rails](https://github.com/rails/jquery-rails).
22
30
 
23
- Please consider [jquery-turbolinks](https://github.com/kossnocorp/jquery.turbolinks) if you have turbolinks issues for Rails 4 +.
24
-
25
31
  ### Include chosen javascript assets
26
32
 
27
33
  Add to your `app/assets/javascripts/application.js` if use with jQuery
@@ -31,13 +37,6 @@ Add to your `app/assets/javascripts/application.js` if use with jQuery
31
37
  //= require chosen-jquery
32
38
  ```
33
39
 
34
- Or with Prototype
35
-
36
- ```coffee
37
- //= require jquery
38
- //= require chosen-prototype
39
- ```
40
-
41
40
  ### Include chosen stylesheet assets
42
41
 
43
42
  Add to your `app/assets/stylesheets/application.css`
@@ -54,27 +53,7 @@ For rails 6, remember to add `javascript_include_tag` in `app/views/layouts/appl
54
53
  <%= javascript_include_tag 'application' %>
55
54
  ```
56
55
 
57
- Add to one coffee script file, like `scaffold.js.coffee`
58
-
59
- ```coffee
60
- $ ->
61
- # enable chosen js
62
- $('.chosen-select').chosen
63
- allow_single_deselect: true
64
- no_results_text: 'No results matched'
65
- width: '200px'
66
- ```
67
-
68
- Notice: `width` option is required since `Chosen 0.9.15`.
69
-
70
- And this file must be included in `application.js`
71
-
72
- ```coffee
73
- //= require chosen-jquery
74
- //= require scaffold
75
- ```
76
-
77
- Also add the class to your form field
56
+ Add the class to your form field
78
57
 
79
58
  ```erb
80
59
  <%= f.select :author,
@@ -96,7 +75,7 @@ If you use simple form as form builder
96
75
 
97
76
  ### Deployment
98
77
 
99
- Since version 0.13.0, non-digested assets of `chosen-rails` will simply be copied from digested assets.
78
+ Non-digested assets of `trln-chosen-rails` will simply be copied from digested assets.
100
79
 
101
80
  ## RSpec helpers
102
81
  `chosen-rails` provides RSpec feature helper methods that allow users to select or unselect options from both single and multiple chosen elements. Add the following to your `spec/rails_helper.rb` (or `spec/spec_helper.rb`):
@@ -10,10 +10,6 @@ class SourceFile < Thor
10
10
  get "#{remote}/raw/#{branch}/public/chosen-sprite.png", 'images/chosen-sprite.png'
11
11
  get "#{remote}/raw/#{branch}/public/chosen-sprite@2x.png", 'images/chosen-sprite@2x.png'
12
12
  get "#{remote}/raw/#{branch}/sass/chosen.scss", 'stylesheets/chosen-base.scss'
13
- get "#{remote}/raw/#{branch}/coffee/lib/abstract-chosen.coffee", 'javascripts/lib/abstract-chosen.coffee'
14
- get "#{remote}/raw/#{branch}/coffee/lib/select-parser.coffee", 'javascripts/lib/select-parser.coffee'
15
- get "#{remote}/raw/#{branch}/coffee/chosen.jquery.coffee", 'javascripts/chosen.jquery.coffee'
16
- get "#{remote}/raw/#{branch}/coffee/chosen.proto.coffee", 'javascripts/chosen.proto.coffee'
17
13
  get "#{remote}/raw/#{branch}/package.json", 'package.json'
18
14
  bump_version
19
15
  end
@@ -21,11 +17,10 @@ class SourceFile < Thor
21
17
  desc 'eject class from closure', 'eject javascript library class from closure'
22
18
  def eject_javascript_class_from_closure
23
19
  self.destination_root = 'vendor/assets'
24
- inside destination_root do
25
- append_to_file 'javascripts/lib/abstract-chosen.coffee' do
20
+ append_to_file 'javascripts/lib/abstract-chosen.js' do
26
21
  "\nwindow.AbstractChosen = AbstractChosen\n"
27
22
  end
28
- append_to_file 'javascripts/lib/select-parser.coffee' do
23
+ append_to_file 'javascripts/lib/select-parser.js' do
29
24
  "\n\nwindow.SelectParser = SelectParser\n"
30
25
  end
31
26
  end
@@ -1,6 +1,6 @@
1
1
  module Chosen
2
2
  module Rails
3
- VERSION = '1.30.0-beta'
3
+ VERSION = '1.30.0-beta3'
4
4
  CHOSEN_VERSION = '1.8.7'
5
5
  end
6
6
  end
@@ -13,12 +13,13 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
14
  gem.name = 'trln-chosen-rails'
15
15
  gem.require_paths = ['lib']
16
+ gem.required_ruby_version = '>= 3.0'
16
17
  gem.version = Chosen::Rails::VERSION
17
18
  gem.license = 'MIT'
18
19
 
19
- gem.add_dependency 'railties', '>= 3.0'
20
- gem.add_dependency 'coffee-rails', '>= 3.2'
21
- gem.add_development_dependency 'bundler', '>= 1.0'
22
- gem.add_development_dependency 'rails', '>= 3.0'
23
- gem.add_development_dependency 'thor', '>= 0.14'
20
+ gem.add_dependency 'railties', '>= 6.0', '< 8'
21
+ #gem.add_dependency 'coffee-rails', '>= 3.2'
22
+ gem.add_development_dependency 'bundler', '>= 2.0', '< 3'
23
+ gem.add_development_dependency 'rails', '>= 6.0', '< 8'
24
+ gem.add_development_dependency 'thor', '>= 0.14', '< 2'
24
25
  end