epitools 0.5.34 → 0.5.35
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 +4 -4
- data/VERSION +1 -1
- data/lib/epitools/path.rb +14 -2
- data/spec/path_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b17c097e07ba3b78b864ba71b04ee4ee1e87fd5
|
|
4
|
+
data.tar.gz: 65ccf4d078f3158dad6d10a838522108c564bec2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f4fc95ba147e3892b1d9bc56dc493ddbc7d2780a5c9dcf443d0c27405381f4a9f942a6ce04b41bfbbd74fb194479f9dba513d7aa32ba99cd609b4cf5fadea96
|
|
7
|
+
data.tar.gz: b9efd1ea37d7ef1cee7beee48f0f5257e36941b0940aef198eaba20058ca940b7f5d11da062840d5706c5fe750537440cea25b68c3ae45c405c474de01476235
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.35
|
data/lib/epitools/path.rb
CHANGED
|
@@ -296,8 +296,8 @@ class Path
|
|
|
296
296
|
end
|
|
297
297
|
|
|
298
298
|
def lstat
|
|
299
|
-
@lstat ||= File.lstat self # to cache or not to cache
|
|
300
|
-
#File.lstat self
|
|
299
|
+
@lstat ||= File.lstat self # to cache, or not to cache? that is the question.
|
|
300
|
+
# File.lstat self # ...answer: not to cache!
|
|
301
301
|
end
|
|
302
302
|
|
|
303
303
|
def mode
|
|
@@ -308,6 +308,12 @@ class Path
|
|
|
308
308
|
lstat.mtime
|
|
309
309
|
end
|
|
310
310
|
|
|
311
|
+
def mtime=(new_mtime)
|
|
312
|
+
File.utime(atime, new_mtime, path)
|
|
313
|
+
@lstat = nil
|
|
314
|
+
new_mtime
|
|
315
|
+
end
|
|
316
|
+
|
|
311
317
|
def ctime
|
|
312
318
|
lstat.ctime
|
|
313
319
|
end
|
|
@@ -316,6 +322,12 @@ class Path
|
|
|
316
322
|
lstat.atime
|
|
317
323
|
end
|
|
318
324
|
|
|
325
|
+
def atime=(new_atime)
|
|
326
|
+
File.utime(new_atime, mtime, path)
|
|
327
|
+
@lstat = nil
|
|
328
|
+
new_atime
|
|
329
|
+
end
|
|
330
|
+
|
|
319
331
|
# FIXME: Does the current user own this file?
|
|
320
332
|
def owner?
|
|
321
333
|
raise "STUB"
|
data/spec/path_spec.rb
CHANGED
|
@@ -477,4 +477,18 @@ describe Path do
|
|
|
477
477
|
lambda { file["blahblahblah"] = "whee" }.should raise_error
|
|
478
478
|
end
|
|
479
479
|
|
|
480
|
+
it "changes mtime/atime" do
|
|
481
|
+
file = Path.tmp
|
|
482
|
+
now = file.mtime
|
|
483
|
+
before = now - 50.days
|
|
484
|
+
|
|
485
|
+
file.mtime = before
|
|
486
|
+
file.mtime.should == before
|
|
487
|
+
|
|
488
|
+
beforebefore = before - 50.days
|
|
489
|
+
|
|
490
|
+
file.atime = beforebefore
|
|
491
|
+
file.atime.should == beforebefore
|
|
492
|
+
end
|
|
493
|
+
|
|
480
494
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: epitools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.35
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- epitron
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-09-
|
|
11
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|