cdn_asset_gem 1.0.14 → 1.0.15

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: 8e826b34af0f54768a3fc98449ebc203a35d5cf34b39d6c2d484840bbf57e9a0
4
- data.tar.gz: dab135468d131d9a781acd600ded2b942c6d74f6d4277fcc53e08488fa42992c
3
+ metadata.gz: a2a61e0f8b167ab57242c3aaf4c7d8786e25071905816e57d1efa31c1204bfd6
4
+ data.tar.gz: 65d84d1ce5a5a3f31e8bf5d227f35697dfc31e701ab08c99395fbfb90c16b2f0
5
5
  SHA512:
6
- metadata.gz: 17c585a3c851ac6348b68b02cb6b9e041d24725c7dbb264431bf10c58d6654221d287c00c8dd34ee83ee37618c2793f907a18c33163131677d51c3739bee1289
7
- data.tar.gz: 72042b3a19be3236cc302bdece4b66afccc0005ace2623286b99b41b826c00a7010b1534bd55b3707a1ea67684a944bfad0063ff984eb0e0993cd1ef4878fe6b
6
+ metadata.gz: 87cf01ae7f7b71de0a0d3d27fad48d0c9650ce13569ca09f15279adc67241c02b1ef9fa04bb4e7298c34697cb46a6197ce7bd4360455e22bd36927eeba0c01b9
7
+ data.tar.gz: 7f821143370c77b0726e4522b5ed40c60c8e835f3da139247469c550fadeeaf43dff1c0c86cffdbca7813732c8b248449496d690ed2f7f3b6bae1abd53c94a3d
@@ -3,18 +3,18 @@ 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
- assets_path = if root_path.blank? || root_path == '/'
6
+ assets_path = if root_path.empty? || root_path == '/'
7
7
  'assets'
8
8
  else
9
9
  "#{root_path}/assets"
10
10
  end
11
11
  manifest_hash = Rails.cache.fetch("cdn-asset-#{root_path}-#{asset_name}", expires_in: 5.minutes) do
12
12
  response = HTTP.get("#{ENV['CDN_URL']}#{assets_path}/rev-manifest.json")
13
- Rails.logger.info "CdnAssetGem INFO: response #{response}"
13
+ puts "CdnAssetGem INFO: response #{response}"
14
14
  if response.code == '200'
15
15
  JSON.parse(response)
16
16
  else
17
- JSON.parse("{}")
17
+ JSON.parse('{}')
18
18
  end
19
19
  end
20
20
  if manifest_hash[file]
@@ -22,8 +22,7 @@ module CdnAssetGem
22
22
  else
23
23
  "#{ENV['CDN_URL']}#{assets_path}/#{file}"
24
24
  end
25
- resuce StandardError => e
26
- Rails.logger.error "CdnAssetGem Error: #{e}"
25
+ resuce
27
26
  "#{ENV['CDN_URL']}#{assets_path}/#{file}"
28
27
  end
29
28
  end
data/lib/cdn_asset_gem.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'cdn_asset_gem/view/helpers'
2
-
3
2
  module CdnAssetGem
4
3
  module View
5
4
  module Helpers
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.14
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Baker