Module: Mat

Defined in:
lib/match.rb,
lib/all_log.rb

Overview

match search loads.

Class Method Summary collapse

Class Method Details

.searchObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/match.rb', line 12

def search
  encoding_style

  one = ARGV[1]

  File.open(one) do |f|
    while (f_open = f.gets)
      str = f_open.chomp!
      twice = ARGV[2]
      three_act = /#{twice}/o

      begin
        if str.match(three_act) || {}[:match]
          printf('%2d : %s', f.lineno, str)
        end
      rescue Timeout::Error
        exit!
      ensure
        GC.compact
      end
    end

    if f.eof?
      f.close
    elsif !f.eof
      begin
        raise All
      rescue StandardError => s
        puts s.backtrace
        tanraku_execute
      ensure
        GC.compact
      end
    end
  end
end