Sha256: 7f1683975bba01ebf490a71e7d25e593f97fad1bea690f29e5d5caa2eb2d496f

Contents?: true

Size: 700 Bytes

Versions: 2

Compression:

Stored size: 700 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
        common_constructor :source_root, :path do
          self.source_root = source_root.to_pathname
          self.path = path.to_pathname
        end

        def class_name
          ruby_class_name || relative_path.to_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
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
avm-0.59.0 lib/avm/scms/auto_commit/file_resource_name.rb
eac_tools-0.50.0 sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb