webpack-assets 0.1.0 → 0.2.0

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: d00f84da28bbfed1dbad13321cfe342a49d54cf0
4
- data.tar.gz: aec9cdd15326d352bea1e66555c93f5223caa2e3
3
+ metadata.gz: 05f9c3f4b95117129a589cae8b77941e76f9d2ea
4
+ data.tar.gz: aeb32fd997d155e49b38c7821ad77802170824a0
5
5
  SHA512:
6
- metadata.gz: ea027ecf2b0c27ece780210558ec43d121f318f0e34f1fdccce062023ca4b6070cf8bebb79a62155f5f89798cd44c501ec1722ada91d6accf4ad037217c85f86
7
- data.tar.gz: 835edf46dcbbdaeaa2901eaea5ae29264d65440c86779a1481058a4460a5983e14c9facee560500e273b130654b4cfa31cf64e1fa7aefff862e474127b8ebc5d
6
+ metadata.gz: 73eaaea1d4c2fd0833c63547fd65630ad7d20ba2da6f5d9f02e60a1710c6ec5e7783cd4effc9bb5ccb76fe82a310ddc847bc3b9942b5e56960c67ec1f20a264c
7
+ data.tar.gz: 3b10916911b57fb434225181aa27328a720b5b72d79b1bcdcaa1a52c23d8dbcb22091c99ea73d4409f0753f2d7d04fdda09c1cdd457b1c4794768d599279b24b
data/README.md CHANGED
@@ -61,6 +61,8 @@ Optional settings:
61
61
  end
62
62
  ```
63
63
 
64
+ - `cdn_url` - the base CDN URL (used only in `webpack_static_file_url` for now).
65
+
64
66
  View helpers:
65
67
 
66
68
  - `webpack_js_tag` is a replacement for `javascript_include_tag`.
@@ -1,5 +1,5 @@
1
1
  module Webpack
2
2
  module Assets
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -12,6 +12,9 @@ module Webpack
12
12
  # @attribute static_path [String]
13
13
  attr_accessor :static_path
14
14
 
15
+ # @attribute cdn_url [String]
16
+ attr_accessor :cdn_url
17
+
15
18
  # @attribute use_server [Boolean]
16
19
  attr_accessor :use_server
17
20
 
@@ -46,7 +46,12 @@ module Webpack
46
46
  if Webpack.config.use_server
47
47
  server_url(path)
48
48
  else
49
- Webpack.fetch_static_file("#{Webpack.config.static_path}/#{path}")
49
+ static_file = Webpack.fetch_static_file("#{Webpack.config.static_path}/#{path}")
50
+ if Webpack.config.cdn_url.present?
51
+ "//#{Webpack.config.cdn_url}#{static_file}"
52
+ else
53
+ static_file
54
+ end
50
55
  end
51
56
  end
52
57
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpack-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Nartimov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.4.5.1
127
+ rubygems_version: 2.4.8
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Webpack Assets for Rails.