Class: Milkode::FindGrep::Result
- Inherits:
-
Object
- Object
- Milkode::FindGrep::Result
- Defined in:
- lib/milkode/grep/findgrep.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#ignore_files ⇒ Object
Returns the value of attribute ignore_files.
-
#match_count ⇒ Object
Returns the value of attribute match_count.
-
#match_file_count ⇒ Object
Returns the value of attribute match_file_count.
-
#match_files ⇒ Object
Returns the value of attribute match_files.
-
#prune_dirs ⇒ Object
Returns the value of attribute prune_dirs.
-
#search_count ⇒ Object
Returns the value of attribute search_count.
-
#search_files ⇒ Object
Returns the value of attribute search_files.
-
#search_size ⇒ Object
Returns the value of attribute search_size.
-
#size ⇒ Object
Returns the value of attribute size.
-
#unreadable_files ⇒ Object
Returns the value of attribute unreadable_files.
Instance Method Summary collapse
-
#initialize(start_dir) ⇒ Result
constructor
A new instance of Result.
- #print(stdout) ⇒ Object
- #time ⇒ Object
- #time_stop ⇒ Object
Constructor Details
#initialize(start_dir) ⇒ Result
Returns a new instance of Result.
32 33 34 35 36 37 |
# File 'lib/milkode/grep/findgrep.rb', line 32 def initialize(start_dir) @start_dir = File.(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 |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
19 20 21 |
# File 'lib/milkode/grep/findgrep.rb', line 19 def count @count end |
#ignore_files ⇒ Object
Returns the value of attribute ignore_files.
30 31 32 |
# File 'lib/milkode/grep/findgrep.rb', line 30 def ignore_files @ignore_files end |
#match_count ⇒ Object
Returns the value of attribute match_count.
22 23 24 |
# File 'lib/milkode/grep/findgrep.rb', line 22 def match_count @match_count end |
#match_file_count ⇒ Object
Returns the value of attribute match_file_count.
21 22 23 |
# File 'lib/milkode/grep/findgrep.rb', line 21 def match_file_count @match_file_count end |
#match_files ⇒ Object
Returns the value of attribute match_files.
27 28 29 |
# File 'lib/milkode/grep/findgrep.rb', line 27 def match_files @match_files end |
#prune_dirs ⇒ Object
Returns the value of attribute prune_dirs.
29 30 31 |
# File 'lib/milkode/grep/findgrep.rb', line 29 def prune_dirs @prune_dirs end |
#search_count ⇒ Object
Returns the value of attribute search_count.
20 21 22 |
# File 'lib/milkode/grep/findgrep.rb', line 20 def search_count @search_count end |
#search_files ⇒ Object
Returns the value of attribute search_files.
26 27 28 |
# File 'lib/milkode/grep/findgrep.rb', line 26 def search_files @search_files end |
#search_size ⇒ Object
Returns the value of attribute search_size.
24 25 26 |
# File 'lib/milkode/grep/findgrep.rb', line 24 def search_size @search_size end |
#size ⇒ Object
Returns the value of attribute size.
23 24 25 |
# File 'lib/milkode/grep/findgrep.rb', line 23 def size @size end |
#unreadable_files ⇒ Object
Returns the value of attribute unreadable_files.
28 29 30 |
# File 'lib/milkode/grep/findgrep.rb', line 28 def unreadable_files @unreadable_files end |
Instance Method Details
#print(stdout) ⇒ Object
47 48 49 50 51 |
# File 'lib/milkode/grep/findgrep.rb', line 47 def print(stdout) stdout.puts "dir : #{@start_dir} (#{Gren::Util.time_s(time)})" stdout.puts "files : #{@search_count} in #{@count} (#{Gren::Util.size_s(@search_size)} in #{Gren::Util.size_s(@size)})" stdout.puts "match : #{@match_file_count} files, #{match_count} hit" end |
#time ⇒ Object
43 44 45 |
# File 'lib/milkode/grep/findgrep.rb', line 43 def time @end_time - @start_time end |
#time_stop ⇒ Object
39 40 41 |
# File 'lib/milkode/grep/findgrep.rb', line 39 def time_stop @end_time = Time.now end |