Class: FindGrep::Result
- Inherits:
-
Object
- Object
- FindGrep::Result
- Defined in:
- lib/findgrep/result.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.
21 22 23 24 25 26 |
# File 'lib/findgrep/result.rb', line 21 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.
8 9 10 |
# File 'lib/findgrep/result.rb', line 8 def count @count end |
#ignore_files ⇒ Object
Returns the value of attribute ignore_files.
19 20 21 |
# File 'lib/findgrep/result.rb', line 19 def ignore_files @ignore_files end |
#match_count ⇒ Object
Returns the value of attribute match_count.
11 12 13 |
# File 'lib/findgrep/result.rb', line 11 def match_count @match_count end |
#match_file_count ⇒ Object
Returns the value of attribute match_file_count.
10 11 12 |
# File 'lib/findgrep/result.rb', line 10 def match_file_count @match_file_count end |
#match_files ⇒ Object
Returns the value of attribute match_files.
16 17 18 |
# File 'lib/findgrep/result.rb', line 16 def match_files @match_files end |
#prune_dirs ⇒ Object
Returns the value of attribute prune_dirs.
18 19 20 |
# File 'lib/findgrep/result.rb', line 18 def prune_dirs @prune_dirs end |
#search_count ⇒ Object
Returns the value of attribute search_count.
9 10 11 |
# File 'lib/findgrep/result.rb', line 9 def search_count @search_count end |
#search_files ⇒ Object
Returns the value of attribute search_files.
15 16 17 |
# File 'lib/findgrep/result.rb', line 15 def search_files @search_files end |
#search_size ⇒ Object
Returns the value of attribute search_size.
13 14 15 |
# File 'lib/findgrep/result.rb', line 13 def search_size @search_size end |
#size ⇒ Object
Returns the value of attribute size.
12 13 14 |
# File 'lib/findgrep/result.rb', line 12 def size @size end |
#unreadable_files ⇒ Object
Returns the value of attribute unreadable_files.
17 18 19 |
# File 'lib/findgrep/result.rb', line 17 def unreadable_files @unreadable_files end |
Instance Method Details
#print(stdout) ⇒ Object
36 37 38 39 40 |
# File 'lib/findgrep/result.rb', line 36 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 |
#time ⇒ Object
32 33 34 |
# File 'lib/findgrep/result.rb', line 32 def time @end_time - @start_time end |
#time_stop ⇒ Object
28 29 30 |
# File 'lib/findgrep/result.rb', line 28 def time_stop @end_time = Time.now end |