webshims-rails 1.15.6 → 1.15.6.2
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.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/README.md +63 -0
- data/lib/webshims-rails.rb +7 -3
- data/lib/webshims-rails/version.rb +1 -1
- metadata +3 -3
- data/readme.textile +0 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdf1f995975ae4c129c02f82c24522642b676fb1
|
4
|
+
data.tar.gz: 753b6472f5f2670b6d6c4e4ca15f5a009ca33a15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57ab7d675bc47b9f9036c487a7b47d325de0141b8e032af26c6665e2ffb7277c0a1324bb051418f9ee9a437550d30b57b2833e17333f645c88b077e429c55c24
|
7
|
+
data.tar.gz: 7566027b1490239a0b57b6620258cbcc463f579f24be88a7a04f4c56da2db953ffe87b12bd08f45eed2c3d9b1c49cb934bc67f14b6d6005451cfda9f93eb1275
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
2015-01-19
|
2
|
+
-------------------
|
3
|
+
* Stopped adding webshims to the default assets-precompile list for Rails 4. This should only affect current Rails 4 users who are working around digest-only precompiling; they will need to add `config.assets.precompile << /webshims/` to their application.rb.
|
4
|
+
|
1
5
|
2015-01-04
|
2
6
|
-------------------
|
3
7
|
* Removed modernizr-custom from documentation, since webshims has removed its custom modernizr build. If your app depends on Modernizr, you'll have to build and include your own version.
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Webshims-rails
|
2
|
+
|
3
|
+
Easily include the "webshims library":http://aFarkas.github.com/webshim/demos/index.html (by Alexander Farkas) in your Rails 3.1+ project with the asset pipeline.
|
4
|
+
|
5
|
+
## Note on Changes in Rails 4
|
6
|
+
|
7
|
+
With the release of Rails 4 and an updated [sprockets-rails](https://github.com/rails/sprockets-rails#changes-from-rails-3x gem), only digest filenames are compiled when running rake assets:precompile (non-digest filenames are no longer compiled).
|
8
|
+
|
9
|
+
Since webshims does not support fingerprinting, this will result in 404s (missing assets) in production mode. To avoid this, you have two options:
|
10
|
+
|
11
|
+
1. Run this rake task every time you update webshims:
|
12
|
+
|
13
|
+
```bash
|
14
|
+
rake webshims:update_public
|
15
|
+
```
|
16
|
+
|
17
|
+
This copies the webshims directory into the public/ directory. Then, alter step 3 below to re-configure your basePath from public/assets (as it was in Rails 3.X) to public/:
|
18
|
+
|
19
|
+
```javascript
|
20
|
+
$.webshims.setOptions('basePath', '/webshims/shims/')
|
21
|
+
```
|
22
|
+
2. Or, turn (back) on asset compiling with non-digest filenames, with, for example, this gist: https://gist.github.com/eric1234/5692456. Don't forget that, if you go this direction, you'll also have to add webshims to the assets that are precompiled by default: `config.assets.precompile << /webshims/` in application.rb.
|
23
|
+
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
1. Add webshims-rails to your Gemfile for bundler: `gem 'webshims-rails'`
|
28
|
+
2. Require the webshims polyfiller, eg, in your application.js:
|
29
|
+
|
30
|
+
```javascript
|
31
|
+
//= require webshims/polyfiller
|
32
|
+
```
|
33
|
+
|
34
|
+
*Update note:* Previous webshims versions included a custom modernizr build; this was removed in webshims 1.14.6, so the (previously necessary) `require webshims/extras/modernizr-custom` line should be removed, and if your app requires modernizr, you'll have to build and require it yourself.
|
35
|
+
|
36
|
+
3. In your javascript, after the polyfiller has been required, set the basePath for webshims as shown below, and then call $.webshims.polyfill(); see webshims docs for more options.
|
37
|
+
(Note that this should be run directly, not in a dom-ready block.)
|
38
|
+
|
39
|
+
```javascript
|
40
|
+
$.webshims.setOptions('basePath', '/assets/webshims/shims/')
|
41
|
+
$.webshims.polyfill()
|
42
|
+
```
|
43
|
+
|
44
|
+
4. For Turbolinks users only: you'll need to update the polyfill on page load:
|
45
|
+
|
46
|
+
```coffeescript
|
47
|
+
$(document).on "page:load", ->
|
48
|
+
$(this).updatePolyfill()
|
49
|
+
```
|
50
|
+
|
51
|
+
## Updating this gem
|
52
|
+
|
53
|
+
This is only in the case this repository is not up-to-date; I try to stay current with webshims but sometimes I miss the webshims releases.
|
54
|
+
|
55
|
+
There's a quick-and-dirty rake task in the repository to checkout webshims from github, checkout a git ref, and copy the required scripts over. You need to specify the Webshims-rails version and the git reference (version/tag/sha) from the webshims repository.
|
56
|
+
|
57
|
+
```bash
|
58
|
+
rake update VERSION=1.14.5 REF=1.14.5
|
59
|
+
```
|
60
|
+
|
61
|
+
## License
|
62
|
+
|
63
|
+
MIT licensed, like the Webshims library.
|
data/lib/webshims-rails.rb
CHANGED
@@ -4,9 +4,13 @@ module Webshims
|
|
4
4
|
module Rails
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
# Everything in the webshims directory should be precompiled, since
|
7
|
-
# it all needs to be accessed dynamically depending on the browser
|
8
|
-
|
9
|
-
|
7
|
+
# it all needs to be accessed dynamically depending on the browser.
|
8
|
+
# Turning this off by default for Rails 4, since in that case, users
|
9
|
+
# are already using a workaround and likely do not need to precompile.
|
10
|
+
unless ::Rails::VERSION::MAJOR >= 4
|
11
|
+
initializer :append_webshims_assets_path, :group => :all do |app|
|
12
|
+
app.config.assets.precompile << /webshims/
|
13
|
+
end
|
10
14
|
end
|
11
15
|
end
|
12
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webshims-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.6
|
4
|
+
version: 1.15.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Reese
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -36,11 +36,11 @@ files:
|
|
36
36
|
- CHANGES.md
|
37
37
|
- Gemfile
|
38
38
|
- MIT_LICENSE.txt
|
39
|
+
- README.md
|
39
40
|
- Rakefile
|
40
41
|
- lib/tasks/webshims.rake
|
41
42
|
- lib/webshims-rails.rb
|
42
43
|
- lib/webshims-rails/version.rb
|
43
|
-
- readme.textile
|
44
44
|
- vendor/assets/javascripts/webshims/polyfiller.js
|
45
45
|
- vendor/assets/javascripts/webshims/shims/FlashCanvas/canvas2png.js
|
46
46
|
- vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.js
|
data/readme.textile
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
h1. Webshims-rails
|
2
|
-
|
3
|
-
Easily include the "webshims library":http://aFarkas.github.com/webshim/demos/index.html (by Alexander Farkas) in your Rails 3.1+ project with the asset pipeline.
|
4
|
-
|
5
|
-
h2. Note on Changes in Rails 4
|
6
|
-
|
7
|
-
With the release of Rails 4 and an updated "sprockets-rails":https://github.com/rails/sprockets-rails#changes-from-rails-3x gem, only digest filenames are compiled when running rake assets:precompile (non-digest filenames are no longer compiled).
|
8
|
-
|
9
|
-
Since webshims does not support fingerprinting, this will result in 404s (missing assets) in production mode. To avoid this, you have two options:
|
10
|
-
|
11
|
-
One, turn (back) on asset compiling with non-digest filenames, with, for example, this gist: https://gist.github.com/eric1234/5692456
|
12
|
-
|
13
|
-
Or two, run
|
14
|
-
<pre>
|
15
|
-
$ rake webshims:update_public
|
16
|
-
</pre>
|
17
|
-
which copies the webshims directory into the public/ directory. Then, alter step 3 below to re-configure your basePath from public/assets (as it was in Rails 3.X) to public/:
|
18
|
-
<pre>
|
19
|
-
$.webshims.setOptions('basePath', '/webshims/shims/')
|
20
|
-
</pre>
|
21
|
-
|
22
|
-
h2. Usage
|
23
|
-
|
24
|
-
1. Add webshims-rails to your Gemfile for bundler: @gem 'webshims-rails'@
|
25
|
-
2. Require the webshims polyfiller, eg, in your application.js:
|
26
|
-
|
27
|
-
<pre>
|
28
|
-
//= require webshims/polyfiller
|
29
|
-
</pre>
|
30
|
-
|
31
|
-
*Update note:* Previous webshims versions included a custom modernizr build; this was removed in webshims 1.14.6, so the (previously necessary) `require webshims/extras/modernizr-custom` line should be removed, and if your app requires modernizr, you'll have to build and require it yourself.
|
32
|
-
|
33
|
-
3. In your javascript, after the polyfiller has been required, set the basePath for webshims as shown below, and then call $.webshims.polyfill(); see webshims docs for more options.
|
34
|
-
(Note that this should be run directly, not in a dom-ready block.)
|
35
|
-
|
36
|
-
<pre>
|
37
|
-
$.webshims.setOptions('basePath', '/assets/webshims/shims/')
|
38
|
-
$.webshims.polyfill()
|
39
|
-
</pre>
|
40
|
-
|
41
|
-
h2. Updating
|
42
|
-
|
43
|
-
There's a quick-and-dirty rake task in the repository to checkout webshims from github, checkout a git ref, and copy the required scripts over. You need to specify the Webshims-rails version and the git reference (version/tag/sha) from the webshims repository.
|
44
|
-
|
45
|
-
<pre>
|
46
|
-
rake update VERSION=1.14.5 REF=1.14.5
|
47
|
-
</pre>
|
48
|
-
|
49
|
-
h2. License
|
50
|
-
|
51
|
-
MIT licensed, like the Webshims library.
|