webshims-rails 1.15.6.3 → 1.15.6.4

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
  SHA1:
3
- metadata.gz: a5829689bd0a6f3ee8efc660c1276e0430056774
4
- data.tar.gz: df26a5f0d38ae3efc4985ed389fbc03e8327b926
3
+ metadata.gz: de20e91955be5fa9ad61b77fc4960f994a343c99
4
+ data.tar.gz: ed5b1591977fa5a2eafd512790dfc29700c78f0d
5
5
  SHA512:
6
- metadata.gz: cd9413291832ab62109f00749984c26311da69906f499aba8a7700204ce11b77faaf302bd144a72ee408b608fbc72ee2fcd130f0a697db6e38cfdc11c4b0f5f6
7
- data.tar.gz: c796167ec25bf7be96eb76bfef9194acde0370f60ec90dbb293e9e3a45b1fa5189eab560da4e216c4e237400cbafff95cfdf231284bde59c7bd8a62ae4ffd378
6
+ metadata.gz: 140ba62bf2a05af0b1c4c7d7180b41695b52bd79c2236ba28e707999786c3aade9dd804b8beabcee2c432eb9497e4ccc64a07e9a8f5ffe012f16b5cb8a2080e3
7
+ data.tar.gz: 2b21cd9cb69b86289d737bfc8e47853f1de2b21713a440d50fc55cb439d1546257d4a68c4037daa2d4aaab279cf9fd7fb426c8d2fbcd72822955e6eb456c484e
data/CHANGES.md CHANGED
@@ -1,6 +1,7 @@
1
1
  2015-04-20
2
2
  -------------------
3
3
  * Added minified version of webshims library to lib/assets; updated the rake task `rake webshims:update_public` to copy the minified versions over to /public, since these files are not precompiled.
4
+ * Added update_public_versioned to copy webshims assets to version-namespaced directory, preventing upstream caching issues
4
5
 
5
6
  2015-01-19
6
7
  -------------------
data/README.md CHANGED
@@ -6,9 +6,30 @@ Easily include the [webshims library](http://aFarkas.github.com/webshim/demos/in
6
6
 
7
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
8
 
9
- Since webshims does not support fingerprinting, this will result in 404s (missing assets) in production mode, since webshims dynamically chooses shim javascript files to request depending on the browser. To avoid this, you have two options:
9
+ Since webshims does not support fingerprinting, this will result in 404s (missing assets) in production mode, since webshims dynamically chooses shim javascript files to request depending on the browser. To avoid this, you have three options:
10
10
 
11
- 1. Run this rake task every time you update webshims:
11
+ 1a. **Recommended**: Versioned-copy to /public. Run this rake task every time you update webshims:
12
+
13
+ ```bash
14
+ rake webshims:update_public_versioned
15
+ ```
16
+
17
+ This copies the webshims files (minified versions) into your Rails public/ directory, at `public/webshims/[webshims.verison]`. Scoping the webshims files to the webshims path will prevent browsers from caching old webshims code.
18
+
19
+ Then, alter step 3 below to re-configure your basePath from public/assets (as it was in Rails 3.X) to public/:
20
+
21
+ ```javascript
22
+ $.webshims.setOptions('basePath', '/webshims/[webshims-version]/shims/')
23
+ ```
24
+
25
+ You can add an .erb extention to your javascript file and have it set the webshims version path.
26
+
27
+ ```javascript
28
+ $.webshims.setOptions('basePath', '/webshims/<%= Webshims::Rails::WEBSHIMS_VERSION %>/shims/')
29
+ ```
30
+
31
+
32
+ 1B. [This is the older, simpler version of 1a.] Copy webshims to the /public directory. Run this rake task every time you update webshims:
12
33
 
13
34
  ```bash
14
35
  rake webshims:update_public
@@ -4,4 +4,20 @@ desc "Copy the webshims to public/webshims so dynamic features will work."
4
4
  task "webshims:update_public" do
5
5
  shim_root = Webshims::Rails::Engine.root.join('lib', 'assets', 'javascripts', 'webshims')
6
6
  FileUtils.cp_r(shim_root, Rails.root.join('public'))
7
+
8
+ puts "Updated webshims files in /public/webshims"
9
+ end
10
+
11
+
12
+ desc "Copy the webshims to public/webshims/[version] for cache-busting."
13
+ task "webshims:update_public_versioned" do
14
+ shim_root = Webshims::Rails::Engine.root.join('lib', 'assets', 'javascripts', 'webshims')
15
+ FileUtils.rm_rf(Rails.root.join('public', 'webshims'))
16
+ FileUtils.mkdir(Rails.root.join('public', 'webshims'))
17
+ FileUtils.cp_r(shim_root, Rails.root.join('public', 'webshims', Webshims::Rails::WEBSHIMS_VERSION))
18
+
19
+ puts "Updated webshims files in /public/webshims/#{Webshims::Rails::WEBSHIMS_VERSION}/"
20
+ puts "\nBe sure your webshims options are set as follows:"
21
+ puts %Q{ $.webshims.setOptions('basePath', '/webshims/#{Webshims::Rails::WEBSHIMS_VERSION}/shims/')}
22
+ puts "\nYou can use ERB to dynamically set this path; See README for more information."
7
23
  end
@@ -1,6 +1,6 @@
1
1
  module Webshims
2
2
  module Rails
3
- VERSION = "1.15.6.3"
3
+ VERSION = "1.15.6.4"
4
4
  WEBSHIMS_VERSION = "1.15.6"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webshims-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.6.3
4
+ version: 1.15.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Reese