lib/buildmaster/cotta/cotta_file.rb in BuildMaster-1.0.9 vs lib/buildmaster/cotta/cotta_file.rb in BuildMaster-1.1.9
- old
+ new
@@ -5,11 +5,11 @@
require 'io_chain'
module BuildMaster
class CottaFile
include IoChain
- attr_reader :system, :path
+ attr_reader :system, :path, :stat
def initialize(system, path)
@path = path
@system = system
end
@@ -31,10 +31,14 @@
end
def stat
@system.file_stat(@path)
end
+
+ def older_than?(file)
+ (stat <=> file.stat) == -1
+ end
def exists?
return @system.file_exists?(@path)
end
@@ -130,10 +134,9 @@
io.binmode
io
end
end
-
def foreach()
open('r') do |file|
file.each {|line| yield line}
end
end
\ No newline at end of file