knockout-assets 0.0.4 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ba1bc4fa60bd970e93f6dfcfc0dfb9f53675452b
4
- data.tar.gz: 967c46875db3cbdab77f87add574b4ec17d8208a
2
+ SHA256:
3
+ metadata.gz: 8b79568942bc8c6284247958f7254348fe075dde34e21dcc02f09f1836648f83
4
+ data.tar.gz: fb08f41a2c513a26e464f4bc53324235e9745167db049e287e83fd8ca7a32d34
5
5
  SHA512:
6
- metadata.gz: 023b20a422f13db66b402fd28aa1f9e14a8e862ef9073a620db4228e6bef6f9d95cb964161aeac01f322acac719d0858ddd09dd0f6af6f63a473c0647737a8a9
7
- data.tar.gz: 847df5549d1e0bebe272a09e1f40593fe5ff8d917a53ee463f473d9333c652d48305f9096500a64910c27d9c8029eae2277cb293103e9a9f307f6f837f65b8bb
6
+ metadata.gz: c3c9903a1398e1dc8a3316edbde20bda4c69e079a13af72f73aedb139b1a36daf0c936a914d8115167a1884f20a1435d98a83c68925f99abbfc48a3eda4ef328
7
+ data.tar.gz: b52fe09197f98641911aa2d4c56a5a67dd39cbaea43c10a798b92348a09cc7d639cc523bd44af53f84b0aecf5d1a97ab47f0214e821398b5f08bfb20504f9fc7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## Version 0.0.6
2
+
3
+ Add the ability to specify a nonce.
4
+
5
+ ## Version 0.0.5
6
+
7
+ Updating to support Rails 5
8
+
1
9
  ## Version 0.0.4
2
10
 
3
11
  Allow specifying `include` file regex.
data/README.md CHANGED
@@ -26,7 +26,7 @@ this method, unless the templates are generated in the first place using erb or
26
26
 
27
27
  Using [Knockout Assets](https://github.com/hlascelles/knockout-assets) has three advantages over using a standard _image_tag_ in knockout templates.
28
28
 
29
- * The knockout templates files need not be processed on the server side at all. This means that testing them (for example with [Jasmine](http://pivotal.github.io/jasmine)) becomes possible.
29
+ * The knockout templates files need not be processed on the server side at all. This means that testing them (for example with [Jasmine](https://jasmine.github.io/)) becomes possible.
30
30
  * The templates may be served up from a CDN using [Knockout.js-External-Template-Engine](https://github.com/ifandelse/Knockout.js-External-Template-Engine).
31
31
  * The images are preloaded by default so templates render with the correct layout instantly (but this can be optionally disabled).
32
32
 
@@ -4,6 +4,7 @@ module KnockoutAssets
4
4
  exclude: nil,
5
5
  preload: true,
6
6
  include: /.*\.(png|gif|jpg|jpeg|bmp|svg)/,
7
+ nonce: nil,
7
8
  }.merge(options)
8
9
 
9
10
  files = {}
@@ -16,6 +17,6 @@ module KnockoutAssets
16
17
  }
17
18
  }
18
19
 
19
- render :partial => '/knockout_assets', locals: {asset_files: files, preload: options[:preload]}
20
+ render :partial => '/knockout_assets', locals: {asset_files: files, preload: options[:preload], nonce: options[:nonce]}
20
21
  end
21
22
  end
@@ -1,5 +1,5 @@
1
1
  <% # Prepare the asset hash and populate it %>
2
- <script type="text/javascript">
2
+ <script type="text/javascript"<% if nonce %> nonce="<%= nonce %>"<% end %>>
3
3
  var knockout_assets = {};
4
4
 
5
5
  <% asset_files.each { |k,v| %>
@@ -7,5 +7,5 @@ module KnockoutAssets
7
7
  end
8
8
 
9
9
  ActiveSupport.on_load :action_controller do
10
- helper KnockoutAssets
11
- end
10
+ ::ActionController::Base.helper(KnockoutAssets)
11
+ end
@@ -1,3 +1,3 @@
1
1
  module KnockoutAssets
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,29 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knockout-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Lascelles
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2016-06-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - ">"
18
17
  - !ruby/object:Gem::Version
19
- version: '0'
18
+ version: '5.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">="
23
+ - - ">"
25
24
  - !ruby/object:Gem::Version
26
- version: '0'
25
+ version: '5.0'
27
26
  description: Prepares the SHA values of CDN assets in a JS hash. Knockout templates
28
27
  can then refer to them without being rendered by erb or haml every time.
29
28
  email:
@@ -44,7 +43,6 @@ homepage: https://github.com/hlascelles/knockout-assets
44
43
  licenses:
45
44
  - MIT
46
45
  metadata: {}
47
- post_install_message:
48
46
  rdoc_options: []
49
47
  require_paths:
50
48
  - lib
@@ -59,10 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
57
  - !ruby/object:Gem::Version
60
58
  version: '0'
61
59
  requirements: []
62
- rubyforge_project:
63
- rubygems_version: 2.4.5.1
64
- signing_key:
60
+ rubygems_version: 4.0.6
65
61
  specification_version: 4
66
62
  summary: Prepares the SHA values of CDN assets for inclusion in templates.
67
63
  test_files: []
68
- has_rdoc: