Class: DatabasePatcher::Fetcher
- Inherits:
-
Object
- Object
- DatabasePatcher::Fetcher
- Defined in:
- lib/database_patcher/fetcher.rb
Instance Method Summary collapse
- #get_intalled_patches ⇒ Object
- #get_pending_patches ⇒ Object
-
#initialize(connection, interface) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(connection, interface) ⇒ Fetcher
Returns a new instance of Fetcher.
3 4 5 6 |
# File 'lib/database_patcher/fetcher.rb', line 3 def initialize(connection, interface) @connection = connection @interface = interface end |
Instance Method Details
#get_intalled_patches ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/database_patcher/fetcher.rb', line 8 def get_intalled_patches patches = get_patches installed_patches = [] uniq_indentifiers = get_already_applied_patch_uniq_indentifiers patches.each do |patch| break unless uniq_indentifiers.include?(patch.uniq_indentifier) installed_patches.push(patch) end installed_patches.reverse end |
#get_pending_patches ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/database_patcher/fetcher.rb', line 21 def get_pending_patches patches = get_patches pending_patches = [] uniq_indentifiers = get_already_applied_patch_uniq_indentifiers patches.each do |patch| break if uniq_indentifiers.include?(patch.uniq_indentifier) pending_patches.push(patch) end pending_patches end |