Sha256: 0aadc87a9814203016c13cad27b1431d66598247e05504787248cd0080a73bcd

Contents?: true

Size: 774 Bytes

Versions: 108

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Avm
  module Sources
    class Base
      module Update
        # To override in subclasses.
        def on_sub_updated
          # Do nothing
        end

        def update
          update_self
          update_subs
        end

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

        # Update source self content.
        #
        # To override in subclasses.
        def update_self_content
          # Do nothing
        end

        def update_self_commit_message
          i18n_translate(__method__)
        end
      end
    end
  end
end

Version data entries

108 entries across 108 versions & 2 rubygems

Version Path
avm-0.94.1 lib/avm/sources/base/update.rb
eac_tools-0.98.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.94.0 lib/avm/sources/base/update.rb
eac_tools-0.94.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.93.0 lib/avm/sources/base/update.rb
eac_tools-0.92.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.92.0 lib/avm/sources/base/update.rb
eac_tools-0.91.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.90.1 lib/avm/sources/base/update.rb
eac_tools-0.87.1 sub/avm/lib/avm/sources/base/update.rb
avm-0.90.0 lib/avm/sources/base/update.rb
eac_tools-0.87.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.89.0 lib/avm/sources/base/update.rb
eac_tools-0.86.12 sub/avm/lib/avm/sources/base/update.rb
avm-0.88.0 lib/avm/sources/base/update.rb
eac_tools-0.86.11 sub/avm/lib/avm/sources/base/update.rb
avm-0.87.0 lib/avm/sources/base/update.rb
eac_tools-0.86.8 sub/avm/lib/avm/sources/base/update.rb
avm-0.86.2 lib/avm/sources/base/update.rb
eac_tools-0.86.7 sub/avm/lib/avm/sources/base/update.rb