Sha256: 8c6a131e51ef3cd6e778f9b74fbc164d4e0abb76fb0796361c0337401a238638

Contents?: true

Size: 965 Bytes

Versions: 76

Compression:

Stored size: 965 Bytes

Contents

# frozen_string_literal: true

require 'avm/eac_generic_base0/file_formats/base'
require 'eac_ruby_utils/core_ext'

module Avm
  module EacAsciidoctorBase0
    module FileFormats
      class Base < ::Avm::EacGenericBase0::FileFormats::Base
        class FileResourceName
          enable_method_class
          common_constructor :file_format, :path do
            self.path = path.to_pathname
          end

          CONTENT_PATTERNS = [%r{content/(.+)\z}].freeze

          # @param path [Pathname]
          # @return [Avm::FileFormats::FileWith]
          def result
            result_from_content || file_format.result_from_superclass(path)
          end

          private

          def result_from_content
            file_format.result_from_patterns(CONTENT_PATTERNS, path) do |m|
              r = ::File.dirname(m[1])
              r = '' if r == '.'
              "Content[/#{r}]"
            end
          end
        end
      end
    end
  end
end

Version data entries

76 entries across 76 versions & 2 rubygems

Version Path
eac_tools-0.79.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.78.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.77.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.77.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.76.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.76.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.75.2 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.75.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.75.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.74.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.74.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.73.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.72.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.70.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.70.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.69.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.69.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.68.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.67.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb
eac_tools-0.67.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/file_formats/base/file_resource_name.rb