asset_timestamps_cache 0.1.0 → 0.1.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.
data/.gitignore CHANGED
@@ -1 +1,3 @@
1
+ *.gem
2
+ *.gemspec
1
3
  public/*
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -25,10 +25,14 @@ module AssetTimestampsCache
25
25
  @@asset_timestamps_cache.clear
26
26
  end
27
27
 
28
+ def self.timestamped_asset_path(asset_path)
29
+ timestamp = self[asset_path]
30
+ "#{asset_path}?#{timestamp}"
31
+ end
32
+
28
33
  module ViewHelper
29
34
  def timestamped_asset_path(asset_path)
30
- timestamp = AssetTimestampsCache[asset_path]
31
- "#{asset_path}?#{timestamp}"
35
+ AssetTimestampsCache.timestamped_asset_path(asset_path)
32
36
  end
33
37
  end
34
38
 
@@ -8,10 +8,10 @@ class TestAssetTimestampsCache < Test::Unit::TestCase
8
8
  def setup
9
9
  AssetTimestampsCache.clear
10
10
  FileUtils.mkdir_p 'public'
11
+ FileUtils.touch 'public/fixture.txt'
11
12
  end
12
13
 
13
14
  def test_returns_mtime_for_file
14
- FileUtils.touch 'public/fixture.txt'
15
15
  mtime = File.mtime('public/fixture.txt').to_i.to_s
16
16
  assert_equal mtime, AssetTimestampsCache['fixture.txt']
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asset_timestamps_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Buesing