Class: Enumark::Dir
- Inherits:
-
Object
- Object
- Enumark::Dir
- Defined in:
- lib/enumark/dir.rb
Instance Method Summary collapse
- #added ⇒ Object
- #deleted ⇒ Object
-
#initialize(dir) ⇒ Dir
constructor
A new instance of Dir.
- #static ⇒ Object
- #uniq ⇒ Object
Constructor Details
#initialize(dir) ⇒ Dir
5 6 7 8 |
# File 'lib/enumark/dir.rb', line 5 def initialize(dir) @enumarks = ::Dir.glob(dir).map{ |f| ::Enumark.new(f) } raise 'Not enough to process' if @enumarks.count <= 1 end |
Instance Method Details
#added ⇒ Object
10 11 12 |
# File 'lib/enumark/dir.rb', line 10 def added @added ||= (@enumarks[-1] - @enumarks[-2]) end |
#deleted ⇒ Object
14 15 16 |
# File 'lib/enumark/dir.rb', line 14 def deleted @deleted ||= @enumarks[0..-2].reverse_each.reduce(&:|) - @enumarks[-1] end |
#static ⇒ Object
22 23 24 |
# File 'lib/enumark/dir.rb', line 22 def static @static ||= @enumarks.reverse_each.reduce(&:&) end |
#uniq ⇒ Object
18 19 20 |
# File 'lib/enumark/dir.rb', line 18 def uniq @uniq ||= @enumarks.reverse_each.reduce(&:|) end |