bun_bun_bundle 0.8.0 → 0.8.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
  SHA256:
3
- metadata.gz: 17cca9ef2aafb44594e5ea2e2abfcd6dfa4a35b3af61f636a0a90ee57383d21a
4
- data.tar.gz: '08ef01b7f75cb09e069e62cd40c477f58ea5c78da6e16761066e70a4970f8f7f'
3
+ metadata.gz: 9435e9d4af2af89c8e6ab93bf1e52dac88ab0bbcc1e8a9147f8c01ce480fbcf2
4
+ data.tar.gz: c754628a60d0502ccab25fc5ff22579c5b486d2dc74bcdb740bf3a26d5e79f7f
5
5
  SHA512:
6
- metadata.gz: d515a1e655140edc0cfe616ff3aafaada50844eea8941700d406f9a5f560406a0da79302653ee665e0a92051175b364e845fdabfec105ceba13cbf03b30f3029
7
- data.tar.gz: cb9386659db82669c47ec2a82982137d3d5e0b44a95b5c13aee0afcdee7b2a889def2b1dc63f1918fa665b9dac83e9cafd912c2d7d23b37c7748c9b02e0938f4
6
+ metadata.gz: a37e23eee631a44652e88f97397dd0ff78eeae32cc4468d2745f7ce61f8f19249d409d70a1b130c01fcf6cf87520399c4547e6c0cdcc2a90b02bbffb7666da22
7
+ data.tar.gz: 33c67c10d45d14d1161ad1365812acd34062a3a2b630827be75a184e0013dc24d3a694bacac914a426cff5277472e341e9cc7ac4bbfa151571a2ff62cec0c7ec
@@ -87,10 +87,14 @@ module BunBunBundle
87
87
  end
88
88
 
89
89
  def bun_href_with_timestamp(href)
90
- return href unless href.start_with?(BunBunBundle.config.public_path)
90
+ config = BunBunBundle.config
91
+ return href unless href.start_with?(config.public_path)
91
92
  return href if href.match?(/-[0-9a-f]{8}\.css$/)
92
93
 
93
- "#{href}#{href.include?('?') ? '&' : '?'}bust=#{(Time.now.to_f * 1000).to_i}"
94
+ file_path = href.sub(config.public_path, config.out_dir)
95
+ mtime = File.exist?(file_path) ? File.mtime(file_path).to_i : Time.now.to_i
96
+
97
+ "#{href}#{href.include?('?') ? '&' : '?'}bust=#{mtime}"
94
98
  end
95
99
  end
96
100
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunBunBundle
4
- VERSION = '0.8.0'
4
+ VERSION = '0.8.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bun_bun_bundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wout Fierens