Sha256: 84847103262bec52d311128fa678c0080c3aff6e2c62223408d8d8be3bd60392

Contents?: true

Size: 1.16 KB

Versions: 14

Compression:

Stored size: 1.16 KB

Contents

# -*- coding: utf-8 -*-
require 'find'
require 'milkode/common/util'
include Gren

module FindGrep
  class Result
    attr_accessor :count
    attr_accessor :search_count
    attr_accessor :match_file_count
    attr_accessor :match_count
    attr_accessor :size
    attr_accessor :search_size
    
    attr_accessor :search_files
    attr_accessor :match_files
    attr_accessor :unreadable_files
    attr_accessor :prune_dirs
    attr_accessor :ignore_files

    def initialize(start_dir)
      @start_dir = File.expand_path(start_dir)
      @count, @search_count, @match_file_count, @match_count, @size, @search_size = 0, 0, 0, 0, 0, 0
      @start_time = Time.now
      @search_files, @match_files, @unreadable_files, @prune_dirs, @ignore_files  = [], [], [], [], []
    end

    def time_stop
      @end_time = Time.now
    end

    def time
      @end_time - @start_time 
    end

    def print(stdout)
      stdout.puts "dir   : #{@start_dir} (#{Util::time_s(time)})"
      stdout.puts "files : #{@search_count} in #{@count} (#{Util::size_s(@search_size)} in #{Util::size_s(@size)})"
      stdout.puts "match : #{@match_file_count} files, #{match_count} hit"
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
milkode-0.2.4 lib/milkode/findgrep/result.rb
milkode-0.2.2 lib/milkode/findgrep/result.rb
milkode-0.2.1 lib/milkode/findgrep/result.rb
milkode-0.2.0 lib/milkode/findgrep/result.rb
milkode-0.1.9 lib/milkode/findgrep/result.rb
milkode-0.1.8 lib/milkode/findgrep/result.rb
milkode-0.1.7 lib/milkode/findgrep/result.rb
milkode-0.1.6 lib/milkode/findgrep/result.rb
milkode-0.1.5 lib/milkode/findgrep/result.rb
milkode-0.1.4 lib/milkode/findgrep/result.rb
milkode-0.1.3 lib/milkode/findgrep/result.rb
milkode-0.1.2 lib/milkode/findgrep/result.rb
milkode-0.1.1 lib/milkode/findgrep/result.rb
milkode-0.1.0 lib/milkode/findgrep/result.rb