Sha256: f2d1c598e3d2518802864834e6814f5a97030a5f710d95d8f60be20e573dae9e
Contents?: true
Size: 882 Bytes
Versions: 1
Compression:
Stored size: 882 Bytes
Contents
# frozen_string_literal: true require "hearken/paths" require "hearken/indexing/persistant_traverser" module Hearken module Indexing class Indexer include Hearken::Paths def initialize(path) create_paths @path = path end def execute start = Time.now count = 0 traverser = Hearken::Indexing::PersistantTraverser.new @path, index_path traverser.each do |_audio_file| count += 1 show_progress start, count if (count % 1000).zero? end show_progress start, count system "afplay #{File.dirname(__FILE__)}/../../../media/applause.mp3" end private def show_progress(start, count) elapsed = Time.now - start warn "Processed #{count} audio files in #{elapsed} seconds (#{elapsed / count} per file)" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hearken-0.1.3 | lib/hearken/indexing/indexer.rb |