Sha256: ea907ba50c1ed483d48e81a17743525476b8bd38a5fb5621b1c6d5eb949ccae7

Contents?: true

Size: 891 Bytes

Versions: 78

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

78 entries across 78 versions & 2 rubygems

Version Path
avm-0.84.0 lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.83.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
avm-0.83.0 lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.82.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
avm-0.82.0 lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.81.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.80.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
avm-0.81.0 lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.79.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
avm-0.80.0 lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.78.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.77.1 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.77.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.76.1 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.76.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.75.2 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.75.1 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.75.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.74.1 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.74.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb