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
eac_tools-0.70.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.76.0 lib/avm/sources/base/update.rb
eac_tools-0.69.1 sub/avm/lib/avm/sources/base/update.rb
avm-0.75.0 lib/avm/sources/base/update.rb
eac_tools-0.69.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.74.0 lib/avm/sources/base/update.rb
eac_tools-0.68.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.73.1 lib/avm/sources/base/update.rb
eac_tools-0.67.1 sub/avm/lib/avm/sources/base/update.rb
avm-0.73.0 lib/avm/sources/base/update.rb
eac_tools-0.67.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.72.0 lib/avm/sources/base/update.rb
eac_tools-0.66.0 sub/avm/lib/avm/sources/base/update.rb
eac_tools-0.65.1 sub/avm/lib/avm/sources/base/update.rb
avm-0.71.0 lib/avm/sources/base/update.rb
eac_tools-0.65.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.70.0 lib/avm/sources/base/update.rb
eac_tools-0.64.0 sub/avm/lib/avm/sources/base/update.rb
avm-0.69.0 lib/avm/sources/base/update.rb
eac_tools-0.63.0 sub/avm/lib/avm/sources/base/update.rb