Class: Patches::Pending

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/patches/pending.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ Pending

Returns a new instance of Pending.



6
7
8
# File 'lib/patches/pending.rb', line 6

def initialize(path=nil)
  @path = path || Patches.default_path
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/patches/pending.rb', line 4

def path
  @path
end

Instance Method Details

#eachObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/patches/pending.rb', line 10

def each
  return nil unless files
  new_files = files.reject { |file| already_run?(file) }
  Patches.logger.info("Patches found: #{new_files.join(',')}")

  new_files.each do |file|
    unless already_run?(file)
      yield file
    end
  end
end