Sha256: dcc7f375453bafc6261e672b57a3ac884b140b2a18cd2779d66278d748178dd2

Contents?: true

Size: 832 Bytes

Versions: 36

Compression:

Stored size: 832 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Avm
  module Sources
    class Base
      class Sub
        class Remove
          acts_as_instance_method

          # !method initialize(sub)
          # @param sub [Avm::Sources::Base::Sub]
          common_constructor :sub
          delegate :source, to: :sub

          # @return [void]
          def result
            source.scm.commit_if_change(commit_message) { do_changes }
          end

          private

          # @return [String]
          def commit_message
            sub.i18n_translate(:remove_commit_message, sub_path: sub.sub_path)
          end

          # @return [void]
          def do_changes
            ::FileUtils.rm_rf(sub.absolute_path)
            source.on_sub_updated
          end
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

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