webpack-assets 0.3.0 → 0.3.1

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
2
  SHA1:
3
- metadata.gz: 0ab2fc0d5850ec8336921ef93ed7bc141b334096
4
- data.tar.gz: 2bfc978c7ecb48c8d2b02d1c749821cc1c797acc
3
+ metadata.gz: 9ede827fa5e12eaa04d9d43d362074d81ef5bca2
4
+ data.tar.gz: 7d510b3fc8d947b92981c1e1070ee3a8f7e31634
5
5
  SHA512:
6
- metadata.gz: 682f2ce352c5b1b67222779ad8e97dd3302cbc8fd13f2fa3b74bae5c7e61d78118630a64d0d6bcd99255f0a2802895cd96d88d19c71323950df6930013a99e31
7
- data.tar.gz: 92cb7a1e2a3974fb38b71cfe9b6cf57833ce6c3f333766e7148d3ddae4ad2c5118f160a678d1d510afd1307d6ec44a6d6968015bfeff3ab1e86529d70169b297
6
+ metadata.gz: 155c5f5063ae98dd66ee6b3468eb6aed9a8336c721a23dd095d45c75f431946d3b29591d090aeb7a157cd3977ec8ade09e91635e3ae01ddbc61627e508e7841a
7
+ data.tar.gz: 032fe6bfa3a2f3adfbb7297fe6938a091fbb377c2fd8b7b085aa393d6eea349e89397837fe44fb48244c3703345fdd6f9bc49e0680ae30d79c399b70e59d60c3
@@ -1,5 +1,5 @@
1
1
  module Webpack
2
2
  module Assets
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -6,6 +6,9 @@ module Webpack
6
6
  # @attribute host [String]
7
7
  attr_accessor :host
8
8
 
9
+ # @attribute protocol [String]
10
+ attr_accessor :protocol
11
+
9
12
  # @attribute public_path [String]
10
13
  attr_accessor :public_path
11
14
 
@@ -57,16 +57,21 @@ module Webpack
57
57
 
58
58
  private
59
59
 
60
- def protocol
61
- @view_context.request.protocol.presence || '//'
62
- end
63
-
64
60
  def server_url(path)
65
61
  "#{protocol}#{server_host}#{Webpack.config.public_path}/#{path}"
66
62
  end
67
63
 
64
+ def protocol
65
+ return "#{Webpack.config.protocol}://" if Webpack.config.protocol
66
+ view_context.try(:request).try(:protocol) || '//'
67
+ end
68
+
68
69
  def server_host
69
- Webpack.config.host || "#{view_context.request.host}:#{Webpack.config.port}"
70
+ return Webpack.config.host if Webpack.config.host
71
+
72
+ host = view_context.try(:request).try(:host) || 'localhost'
73
+
74
+ "#{host}:#{Webpack.config.port}"
70
75
  end
71
76
  end
72
77
  end
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.3.0
4
+ version: 0.3.1
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-09-09 00:00:00.000000000 Z
11
+ date: 2016-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack