cdn_asset_gem 1.0.9 → 1.0.10

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
  SHA256:
3
- metadata.gz: 24fe5a0cd5c5e4feebd0ebc3b0435403f453d02e0189597678e20b99e4ea37c7
4
- data.tar.gz: bb0b9a01742329769cc42ca21635bf0030acebe24ae8e95d04245ee38a4770a4
3
+ metadata.gz: 80d38e94872ec129213f3efa13dd6f267d9828bac56263e1072773a961780068
4
+ data.tar.gz: 1e57df88dca6335f9991c495a19ccb85d6a5b9cfd867201611d097680a756642
5
5
  SHA512:
6
- metadata.gz: 02e2311913dace352638a07a76a5f9efea01feef411edb9502a031240ae8cd739b5729f1bcfbb7cb0a4b1bf2ad2dd1b31e67a6481bb5b10f4edfe387ad37d056
7
- data.tar.gz: b343dde741bda438c85fa555bf45bcfd7434fbf6337db5531c15b3e9ecc0e9f34e05e86084216f62f6ac7549eca699173d07055cbb595f05dc6848735ca00299
6
+ metadata.gz: df112e100ee82c599b1ba0b89ec9a641cdd2880ec48c94ce52320102ae00209e9c9e927a067fd370a2800f3ee60d8f1717355a13515a8c9e04cb86016b2a2f83
7
+ data.tar.gz: 0d2dc015025474fad3fc724f49ff93c16f8b103874944a05ad9fefa5117179b982997fd4891eb1667944ed82fdf9147b9daa2697e24d4c21e8049cef30e3afda
@@ -3,7 +3,6 @@ module CdnAssetGem
3
3
  module Helpers
4
4
  def map_asset(root_path: '', asset_name:, file_type:)
5
5
  file = "#{file_type}/#{asset_name}.min.#{file_type}"
6
-
7
6
  if manifest_hash(root_path)[file]
8
7
  "#{ENV['CDN_URL']}#{root_path}/assets/#{manifest_hash(root_path)[file]}"
9
8
  else
@@ -13,7 +12,7 @@ module CdnAssetGem
13
12
  Rails.logger.error "CdnAssetGem Error: #{e}"
14
13
  "#{ENV['CDN_URL']}#{root_path}/assets/#{file}"
15
14
  end
16
-
15
+
17
16
  def manifest_hash(root_path)
18
17
  if root_path.blank? || root_path == '/'
19
18
  assets_path = '/assets'
@@ -24,6 +23,7 @@ module CdnAssetGem
24
23
  Rails.cache.fetch("cdn-asset-#{root_path}", expires_in: 5.minutes) do
25
24
  uri = URI("#{ENV['CDN_URL']}#{assets_path}/rev-manifest.json")
26
25
  response = HTTP.get(uri)
26
+ Rails.logger.info "CdnAssetGem INFO: #{response}"
27
27
  JSON.parse(response) if response.code == '200'
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cdn_asset_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Baker