Skip to content

Commit

Permalink
Merge pull request #427 from hirose31/file-size
Browse files Browse the repository at this point in the history
Add size method to file type
  • Loading branch information
mizzy committed Jun 11, 2014
2 parents 9d337b2 + c03f67b commit 34a1c79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/serverspec/type/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def mtime
d = backend.get_file_mtime(@name).stdout.strip
DateTime.strptime(d, '%s').new_offset(DateTime.now.offset)
end

def size
backend.get_file_size(@name).stdout.strip.to_i
end
end
end
end

0 comments on commit 34a1c79

Please sign in to comment.