bun_bun_bundle 0.6.1 → 0.6.2

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: c36f2a8b4d7d9445dff7ceeade7c98961444b924b114ea349390fc1dd89e6ed7
4
- data.tar.gz: 8e8022b3e594234cb560d0065463cc3b74c2cf2a97b39271e0c0949ac8d5ff3b
3
+ metadata.gz: 1f4dcc9509182f2d2ec29dd730105ee97e2ea09ff2fc6616cc8be058fa2d42e6
4
+ data.tar.gz: 65e0b037c905673c1908e7c36a0a7608023573c83c253973a83cab7cbe1502d9
5
5
  SHA512:
6
- metadata.gz: df41b2fb7d57d8922330e501a21b4b4418340c204537d3b74af94ebe6ea4b9b07ebfcd239e8bd51c17d8aef5100ad396a4252cde1804297165c029081ec2fc62
7
- data.tar.gz: 6b875cc9aa5b5c8d8c1ab1a2e13c5a5e2348e00b8585a13837dd454b3e78a1230ba25297371936f45757dcd1ce2ec451f24652a4582e9efa3edaa13100132f51
6
+ metadata.gz: b72290a4bd264be9472c590bfbe0f7bd83b70570738c066ddf518c874c297ade588baa9c89cd0abd975172d7a0cdbee7427f72eae4436bac95c438abe0467480
7
+ data.tar.gz: 64a3a0269699b338d02bd4c8dc02bcaca038ab7d757937591034d074e107b6d0c35df1b1b93419d413c1b9d0109a750fc72c289cc2ee948ff91c8b9b141558fe
@@ -44,8 +44,9 @@ module BunBunBundle
44
44
  # # => '<link href="/assets/css/app.css" type="text/css" rel="stylesheet">'
45
45
  #
46
46
  def bun_css_tag(source, **options)
47
- href = bun_asset(source)
48
- attrs = { type: 'text/css', rel: 'stylesheet' }.merge(options).merge(href: href)
47
+ attrs = { type: 'text/css', rel: 'stylesheet' }
48
+ .merge(options)
49
+ .merge(href: bun_href_with_timestamp(bun_asset(source)))
49
50
  bun_safe(%(<link #{bun_html_attrs(attrs)}>))
50
51
  end
51
52
 
@@ -84,5 +85,11 @@ module BunBunBundle
84
85
  def bun_escape_attr(value)
85
86
  value.to_s.gsub('&', '&amp;').gsub('"', '&quot;').gsub('<', '&lt;').gsub('>', '&gt;')
86
87
  end
88
+
89
+ def bun_href_with_timestamp(href)
90
+ return href unless BunBunBundle.development?
91
+
92
+ "#{href}#{href.include?('?') ? '&' : '?'}bust=#{(Time.now.to_f * 1000).to_i}"
93
+ end
87
94
  end
88
95
  end
@@ -41,7 +41,7 @@ module BunBunBundle
41
41
  const linkPath = new URL(link.href).pathname.split('?')[0]
42
42
  if (cssPaths.some(p => linkPath.startsWith(p))) {
43
43
  const url = new URL(link.href)
44
- url.searchParams.set('r', Date.now())
44
+ url.searchParams.set('bust', Date.now())
45
45
  link.href = url.toString()
46
46
  }
47
47
  })
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunBunBundle
4
- VERSION = '0.6.1'
4
+ VERSION = '0.6.2'
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.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wout Fierens