Class: Puma::Redeploy::BaseHandler
- Inherits:
-
Object
- Object
- Puma::Redeploy::BaseHandler
- Extended by:
- Forwardable
- Defined in:
- lib/puma/redeploy/base_handler.rb
Overview
base redeploy handler
Direct Known Subclasses
Instance Attribute Summary collapse
-
#watch_file ⇒ Object
readonly
Returns the value of attribute watch_file.
Instance Method Summary collapse
-
#initialize(watch_file:, deployer:, logger:) ⇒ BaseHandler
constructor
A new instance of BaseHandler.
- #needs_redeploy? ⇒ Boolean
- #watch_file_data ⇒ Object
Constructor Details
#initialize(watch_file:, deployer:, logger:) ⇒ BaseHandler
Returns a new instance of BaseHandler.
13 14 15 16 17 |
# File 'lib/puma/redeploy/base_handler.rb', line 13 def initialize(watch_file:, deployer:, logger:) @watch_file = watch_file @logger = logger @deployer = deployer end |
Instance Attribute Details
#watch_file ⇒ Object (readonly)
Returns the value of attribute watch_file.
11 12 13 |
# File 'lib/puma/redeploy/base_handler.rb', line 11 def watch_file @watch_file end |
Instance Method Details
#needs_redeploy? ⇒ Boolean
19 20 21 22 23 24 |
# File 'lib/puma/redeploy/base_handler.rb', line 19 def needs_redeploy? return false unless (mtime = touched_at) != @touched_at @touched_at = mtime true end |
#watch_file_data ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/puma/redeploy/base_handler.rb', line 28 def watch_file_data watch_file_content = read_watch_object results = YAML.safe_load(watch_file_content, symbolize_names: true) return results if results.is_a?(Hash) # old style where the file contains only the archive location { commands: [], archive_location: results } rescue StandardError {} end |