Class: Invar::PrivateFile
- Inherits:
-
Object
- Object
- Invar::PrivateFile
- Extended by:
- Forwardable
- Defined in:
- lib/invar/private_file.rb
Overview
Verifies a file is secure
Defined Under Namespace
Classes: FilePermissionsError
Constant Summary collapse
- PERMISSIONS_MASK =
Mask for limiting to the lowest three octal digits (which store permissions)
0o777
- ALLOWED_USER_MODES =
[0o600, 0o400].freeze
- ALLOWED_GROUP_MODES =
[0o060, 0o040, 0o000].freeze
- DEFAULT_PERMISSIONS =
0o600
- ALLOWED_MODES =
Allowed permissions modes for lockfile. Readable or read-writable by the user or group only
ALLOWED_USER_MODES.product(ALLOWED_GROUP_MODES).collect do |u, g| u | g # bitwise OR end.freeze
Instance Method Summary collapse
- #binread(**args) ⇒ Object
-
#initialize(file_path) ⇒ PrivateFile
constructor
A new instance of PrivateFile.
- #read(**args) ⇒ Object
Constructor Details
permalink #initialize(file_path) ⇒ PrivateFile
Returns a new instance of PrivateFile.
27 28 29 |
# File 'lib/invar/private_file.rb', line 27 def initialize(file_path) @delegate_sd_obj = file_path end |
Instance Method Details
permalink #binread(**args) ⇒ Object
[View source]
37 38 39 40 41 |
# File 'lib/invar/private_file.rb', line 37 def binread(**args) @delegate_sd_obj.binread(**args) end |
permalink #read(**args) ⇒ Object
[View source]
31 32 33 34 35 |
# File 'lib/invar/private_file.rb', line 31 def read(**args) @delegate_sd_obj.read(**args) end |