Module: Mail

Defined in:
lib/mail.rb

Overview

Mail search loads.

Class Method Summary collapse

Class Method Details

.searchObject



11
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
# File 'lib/mail.rb', line 11

def search
  encoding_style

  one = ARGV[1]

  File.open(one) do |f|
    while (str2 = f.gets)
      str = str2.chomp!
      three_act = /^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/o

      begin
        if str =~ three_act
          printf('%2d : %s', f.lineno, str)
          puts ''
        end
      rescue Timeout::Error
        exit!
      end
    end

    if f.eof?
      f.close
    elsif !f.eof
      begin
        raise Mail
      rescue StandardError => ee
        puts ee.backtrace
        puts ee.backtrace_locations
      end
    end
  end
end