Sha256: 4b5fe3c287d255124fc613e37d6a3987cb64944067cd6ddc1a9150292771aab3

Contents?: true

Size: 776 Bytes

Versions: 1

Compression:

Stored size: 776 Bytes

Contents

# frozen_string_literal: true

module ROM
  module Files
    module Extensions
      module Gem
        module Relations
          class Specifications < ROM::Files::Relation
            dataset { select('*_spec.rb').recursive.inside('spec') }

            schema 'application/x-ruby', as: :specifications, infer: true do
              use :stat

              attribute :specification_path, Types::Path
              attribute :implementation_path, Types.ForeignKey(
                :implementations,
                map: ->(path) { path.pathmap('%{^spec,}X.rb') }
              )

              associations do
                has_one :implementation, foreign_key: :implementation_path
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rom-files-0.2.0 lib/rom/files/extensions/gem/relations/specifications.rb