Class: Coyote::FSListeners::Base
- Inherits:
-
Object
- Object
- Coyote::FSListeners::Base
- Defined in:
- lib/coyote/fs_listeners/base.rb
Instance Attribute Summary collapse
-
#last_event ⇒ Object
readonly
Returns the value of attribute last_event.
-
#sha1_checksums_hash ⇒ Object
readonly
Returns the value of attribute sha1_checksums_hash.
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #modified_files(dirs, options = {}) ⇒ Object
- #update_last_event ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/coyote/fs_listeners/base.rb', line 7 def initialize @sha1_checksums_hash = {} update_last_event end |
Instance Attribute Details
#last_event ⇒ Object (readonly)
Returns the value of attribute last_event.
5 6 7 |
# File 'lib/coyote/fs_listeners/base.rb', line 5 def last_event @last_event end |
#sha1_checksums_hash ⇒ Object (readonly)
Returns the value of attribute sha1_checksums_hash.
5 6 7 |
# File 'lib/coyote/fs_listeners/base.rb', line 5 def sha1_checksums_hash @sha1_checksums_hash end |
Instance Method Details
#modified_files(dirs, options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/coyote/fs_listeners/base.rb', line 16 def modified_files(dirs, = {}) files = potentially_modified_files(dirs, ).select { |path| File.file?(path) && file_modified?(path) && file_content_modified?(path) } files.map! { |file| file.gsub("#{Dir.pwd}/", '') } end |
#update_last_event ⇒ Object
12 13 14 |
# File 'lib/coyote/fs_listeners/base.rb', line 12 def update_last_event @last_event = Time.now end |