Sha256: 8d649f5e063522c5ee83594d956c4431c57c177ca7fcd818c5f280de53f394c9

Contents?: true

Size: 523 Bytes

Versions: 3

Compression:

Stored size: 523 Bytes

Contents

# frozen_string_literal: true

require 'digest'
require 'sqlite3'

require_relative 'kitkat/database'
require_relative 'kitkat/reader'

# Main example/easiest entry-point for this application.
module Kitkat
  class << self
    def crawl(path:, db:, io: $stdout)
      reader = Reader.new(path)
      db     = Database.new(db)

      reader.each.with_index(1) do |file_info, index|
        io.puts("[#{index}] #{file_info.relative_path}")

        db.insert(file_info)
      end

      io.puts('Complete')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kitkat-1.0.0 lib/kitkat.rb
kitkat-0.0.2 lib/kitkat.rb
kitkat-0.0.1 lib/kitkat.rb