Sha256: 27ee25757fdf2c31ce17f01e9c6c19e2093eb9a2ccb568e34d0687cda92c9a09

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

module Trifle
  module Docs
    module Harvester
      module File
        class Sieve < Harvester::Sieve
          def match?
            true
          end

          def to_url
            file.gsub(%r{^#{path}/}, '')
          end
        end

        class Conveyor < Harvester::Conveyor
          def content
            data
          end

          def meta
            {
              'path' => file,
              'type' => 'file',
              'updated_at' => ::File.stat(file).mtime
            }
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trifle-docs-0.3.1 lib/trifle/docs/harvester/file.rb
trifle-docs-0.3.0 lib/trifle/docs/harvester/file.rb