Module: Avm::Sources::Base::Update

Defined in:
lib/avm/sources/base/update.rb

Instance Method Summary collapse

Instance Method Details

#on_sub_updatedObject

To override in subclasses.



10
11
12
# File 'lib/avm/sources/base/update.rb', line 10

def on_sub_updated
  # Do nothing
end

#updateObject



14
15
16
17
# File 'lib/avm/sources/base/update.rb', line 14

def update
  update_self
  update_subs
end

#update_selfObject



19
20
21
22
23
24
# File 'lib/avm/sources/base/update.rb', line 19

def update_self
  scm.commit_if_change(-> { update_self_commit_message }) do
    update_self_content
    parent.if_present(&:on_sub_updated)
  end
end

#update_self_commit_messageObject



33
34
35
# File 'lib/avm/sources/base/update.rb', line 33

def update_self_commit_message
  i18n_translate(__method__)
end

#update_self_contentObject

Update source self content.

To override in subclasses.



29
30
31
# File 'lib/avm/sources/base/update.rb', line 29

def update_self_content
  # Do nothing
end