Class: Puma::StateFile
- Inherits:
-
Object
- Object
- Puma::StateFile
- Defined in:
- lib/puma/state_file.rb
Constant Summary collapse
- FIELDS =
%w!control_url control_auth_token pid running_from!
Instance Method Summary collapse
-
#initialize ⇒ StateFile
constructor
A new instance of StateFile.
- #load(path) ⇒ Object
- #save(path, permission = nil) ⇒ Object
Constructor Details
#initialize ⇒ StateFile
Returns a new instance of StateFile.
7 8 9 |
# File 'lib/puma/state_file.rb', line 7 def initialize @options = {} end |
Instance Method Details
#load(path) ⇒ Object
20 21 22 |
# File 'lib/puma/state_file.rb', line 20 def load(path) @options = YAML.load File.read(path) end |
#save(path, permission = nil) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/puma/state_file.rb', line 11 def save(path, = nil) contents =YAML.dump @options if File.write path, contents, mode: 'wb:UTF-8' else File.write path, contents, mode: 'wb:UTF-8', perm: end end |