Sha256: 1de1213359af1da80a78cfa90975d9af66b287c9f2edf0de53a01c2db6496624

Contents?: true

Size: 439 Bytes

Versions: 1

Compression:

Stored size: 439 Bytes

Contents

module Puma
  class StateFile
    def initialize
      @options = {}
    end

    def save(path)
      File.write path, YAML.dump(@options)
    end

    def load(path)
      @options = YAML.load File.read(path)
    end

    FIELDS = %w!control_url control_auth_token pid!

    FIELDS.each do |f|
      define_method f do
        @options[f]
      end

      define_method "#{f}=" do |v|
        @options[f] = v
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
puma-3.0.0.rc1 lib/puma/state_file.rb