adrian 1.1.0 → 1.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.
@@ -21,12 +21,13 @@ module Adrian
21
21
  end
22
22
 
23
23
  def updated_at
24
- File.mtime(path).utc
24
+ @updated_at ||= File.mtime(path).utc
25
25
  rescue Errno::ENOENT
26
26
  nil
27
27
  end
28
28
 
29
29
  def touch(updated_at = Time.new)
30
+ @updated_at = nil
30
31
  File.utime(updated_at, updated_at, path)
31
32
  end
32
33
 
@@ -1,3 +1,3 @@
1
1
  module Adrian
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
@@ -28,11 +28,18 @@ describe Adrian::FileItem do
28
28
  describe 'updated_at' do
29
29
 
30
30
  it 'is nil when moved by another process' do
31
+ File.unlink(@item.path)
32
+ assert_equal false, @item.exist?
33
+ assert_equal nil, @item.updated_at
34
+ end
35
+
36
+ it 'is cached' do
37
+ updated_at = @item.updated_at
31
38
  assert @item.updated_at
32
39
  File.unlink(@item.path)
33
40
  assert_equal false, @item.exist?
34
41
 
35
- assert_equal nil, @item.updated_at
42
+ assert_equal updated_at, @item.updated_at
36
43
  end
37
44
 
38
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adrian
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-18 00:00:00.000000000 Z
13
+ date: 2012-10-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake