jquery-minicolors-rails 2.1.4.0 → 2.2.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NDcyOTk0YzJlZGE3ZTJjNTIxYTY0NDAxMWU3ZjQ0MTNkZDkzMjU0Yg==
5
- data.tar.gz: !binary |-
6
- YjA2NDU1ZjkxODA2MmI1YjQ0NjZlYTgxYjM4MzY3NDczMGQ3Y2E3MQ==
2
+ SHA256:
3
+ metadata.gz: 2c450478ebe0642c8b1fcb91a37390d2e1cd35f3af460819160c37afde0f4f5c
4
+ data.tar.gz: c610702e688b8ce49fe620cc0044ec97c7fe09a5c6a815dca2bab40d17f0a0d8
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- OGMwNDI5NGZjZjk4MzQ3NmU3MTMwYzZiY2YzOWEyMzFiZGY4ZjM2ZjQ5NGUy
10
- YjNiYTljNTM1ZGZlMWU2YjAzNTdkNjY2ZDg0NmI5OThhYjczZTIzMmM5MjFk
11
- ZWQ5YjdiMDJmNTZmMWQyMjgzYzBkMzRmOTg1YTZhYWJjNTg3MDQ=
12
- data.tar.gz: !binary |-
13
- YzQyNGFjNjNmYzgwOTdjYjdmOTFhODkxMTA2OTgxN2MyNTExNzBiODAxOGI5
14
- ZDkxNjkwODBjNTg0MTQ3NzRmZDVmZGI4ZDI2OGFiZmZmYmE1ZDQzOTJiMzBj
15
- ZGYyNGExNzAxY2NlYzNmYWQ1MjlkMTI3NTUwYTRjNTA1ZjMzOGU=
6
+ metadata.gz: 9ef32c8f7f4d5d9d852a9bf0665650ab6cd913df7edd0dd48d7a111825a350cf515a7ce21756c2142fa8404430a9f0fd667cb2c11788e61969d1ab4ac8a8eb31
7
+ data.tar.gz: 8f7b6e5f35955aaa8baa382f7e588d9ca27cd3a81d8b38debb52ca7a9d853598b29790d784fbd8672788917de72f2a09aac6386938ebd5c05df93487b2ddce56
data/README.md CHANGED
@@ -73,26 +73,28 @@ See https://github.com/plataformatec/simple_form
73
73
  <% end %>
74
74
  ```
75
75
 
76
- ## Configuration
76
+ ## Testing
77
77
 
78
- As of https://github.com/rails/rails/pull/7968 (Rails > 4.*) the asset pipeline precompile command will ignore the images.
79
- Since `jquery.minicolors` uses an image for backgrounds, the image is by default splitted into chunks of data URLs and embedded into the CSS directly.
80
- This results in a slightly bigger compiled CSS (~50k bigger), but avoids unnecessary image request to the server and headache on deployment.
81
- You can still instruct `JqueryMinicolorsRails` to use the original image instead of the data URLs:
82
-
83
- ```ruby
84
- # config/initializers/jquery_minicolors_rails.rb
85
- JqueryMinicolorsRails.use_data_urls = false
78
+ ```bash
79
+ bundle exec rspec
86
80
  ```
87
81
 
88
- Additionally you would also have to copy the image to the deployment target:
82
+ Since this gem uses a lot of different frameworks, anything is possible. So despite the specs are
83
+ "green", please verify manually:
89
84
 
90
- ```ruby
91
- # config/deploy.rb
92
- after :deploy do
93
- target = File.join(%W[#{release_path} public assets])
94
- run "cp -r `cd #{release_path} && bundle show jquery-minicolors-rails`/vendor/assets/images/jquery.minicolors.png #{target}"
95
- end
85
+ ```bash
86
+ cd test_app
87
+ bundle
88
+ rails s
89
+ open http://localhost:3000/ # Assert everything looks & works good.
90
+ ```
91
+
92
+ ```bash
93
+ rm -rf tmp/cache
94
+ rm -rf public/assets
95
+ RAILS_ENV=production bundle exec rake assets:precompile
96
+ rails s -eproduction
97
+ open http://localhost:3000/ # Assert everything looks & works good.
96
98
  ```
97
99
 
98
100
  ## Versioning
@@ -9,4 +9,6 @@ if defined? SimpleForm
9
9
 
10
10
  def input_type; :string end
11
11
  end
12
+ else
13
+ class MinicolorsInput; end
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module JqueryMinicolorsRails
2
- VERSION = '2.1.4.0'
2
+ VERSION = '2.2.6.2'
3
3
  end
@@ -1,27 +1,4 @@
1
1
  require 'jquery-minicolors-rails/engine'
2
2
 
3
3
  module JqueryMinicolorsRails
4
- class << self
5
- attr_writer :use_data_urls
6
-
7
- def use_data_urls?
8
- defined?(@use_data_urls) ? !!@use_data_urls : true
9
- end
10
-
11
- def image_data_url(name)
12
- image_data_url_cache.fetch(name) do
13
- image_data_url_cache[:name] = load_image_data_url(name)
14
- end
15
- end
16
-
17
- private
18
-
19
- def image_data_url_cache
20
- @image_data_url_cache ||= {}
21
- end
22
-
23
- def load_image_data_url(name)
24
- File.read(File.expand_path("../../vendor/assets/images/jquery.minicolors.#{name}", __FILE__))
25
- end
26
- end
27
4
  end