Sha256: 41597859391e40aac4aabcaecd8a5f182277d4738e0532f47047d82dc37ac6d6

Contents?: true

Size: 891 Bytes

Versions: 34

Compression:

Stored size: 891 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Avm
  module Scms
    module AutoCommit
      class FileResourceName
        require_sub __FILE__, include_modules: true
        enable_simple_cache
        common_constructor :source_root, :path do
          self.source_root = source_root.to_pathname
          self.path = path.to_pathname
        end

        def class_name
          file_format.file_resource_name(relative_path)
        end

        def commit_message
          r = class_name
          r += ': remove' unless path.file?
          "#{r}."
        end

        def relative_path
          path.expand_path.relative_path_from(source_root.expand_path)
        end

        private

        # @return [Avm::FileFormats::Base]
        def file_format_uncached
          ::Avm::Registry.file_formats.detect(path)
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

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