Class: Steam::SentryFile
- Inherits:
-
Object
- Object
- Steam::SentryFile
- Defined in:
- lib/steam/sentry_file.rb
Overview
TODO:
this will overwrite any existing file, namespace to username?
Represents a Sentry file on disk
Instance Method Summary collapse
-
#read ⇒ String?
Read the digest from the sentry file.
-
#write(digest) ⇒ Object
Writes the digest to the sentry file.
Instance Method Details
#read ⇒ String?
Read the digest from the sentry file. Returns nil if the Sentry file does not exist.
29 30 31 32 33 |
# File 'lib/steam/sentry_file.rb', line 29 def read return nil unless File.exist?(path) File.open(path, 'rb', &:read) end |
#write(digest) ⇒ Object
Writes the digest to the sentry file
15 16 17 18 19 |
# File 'lib/steam/sentry_file.rb', line 15 def write(digest) File.open(path, 'wb') do |file| file.write(digest) end end |