epitools 0.5.34 → 0.5.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f282bea8aea914ccdd0930cd854a7923843f735c
4
- data.tar.gz: 5a62ed975b9862079425b8b32789533995dfaa85
3
+ metadata.gz: 8b17c097e07ba3b78b864ba71b04ee4ee1e87fd5
4
+ data.tar.gz: 65ccf4d078f3158dad6d10a838522108c564bec2
5
5
  SHA512:
6
- metadata.gz: 67e406669118cbeaa5538fc4edb530bc0407a3c066efc5e13f34b598219001ddb700cf3038087e21e055b146bcb8c699cc4a1812889c4d3b25ef02496c6e8c12
7
- data.tar.gz: 13a943e596d4944fb5f2c81939f707773a2404a1c333f07362143aa9db8816f0ce42dec7c79e9129c279dd5117957fa499cad64211da43d521f207775dd9d8f6
6
+ metadata.gz: 2f4fc95ba147e3892b1d9bc56dc493ddbc7d2780a5c9dcf443d0c27405381f4a9f942a6ce04b41bfbbd74fb194479f9dba513d7aa32ba99cd609b4cf5fadea96
7
+ data.tar.gz: b9efd1ea37d7ef1cee7beee48f0f5257e36941b0940aef198eaba20058ca940b7f5d11da062840d5706c5fe750537440cea25b68c3ae45c405c474de01476235
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.34
1
+ 0.5.35
@@ -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 -- that is the question.
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"
@@ -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.34
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-22 00:00:00.000000000 Z
11
+ date: 2013-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec