Class: Shakapacker::MtimeStrategy

Inherits:
BaseStrategy show all
Defined in:
sig/shakapacker/compiler_strategy.rbs,
lib/shakapacker/mtime_strategy.rb

Overview

Mtime-based compiler strategy

Instance Attribute Summary

Attributes inherited from BaseStrategy

#config

Instance Method Summary collapse

Methods inherited from BaseStrategy

#after_compile_hook, #default_watched_paths, #initialize

Constructor Details

This class inherits a constructor from Shakapacker::BaseStrategy

Instance Method Details

#fresh?Boolean

Returns true if manifest file mtime is newer than the timestamp of the last modified watched file

Returns:

  • (Boolean)


6
7
8
# File 'lib/shakapacker/mtime_strategy.rb', line 6

def fresh?
  manifest_mtime > latest_modified_timestamp
end

#stale?Boolean

Returns true if manifest file mtime is older than the timestamp of the last modified watched file

Returns:

  • (Boolean)


11
12
13
# File 'lib/shakapacker/mtime_strategy.rb', line 11

def stale?
  !fresh?
end