Skip to content

Commit

Permalink
Add size method to file type
Browse files Browse the repository at this point in the history
  • Loading branch information
mizzy committed Jun 11, 2014
1 parent 0e2d3ce commit d93ed92
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 d93ed92

Please sign in to comment.