-
Notifications
You must be signed in to change notification settings - Fork 1
/
se2.rb
67 lines (56 loc) · 1.32 KB
/
se2.rb
1
2
3
4
5
6
7
8
9
10
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
class StdClass
def initialize
end
def startMe
#filename = "allLogs.txt"
#filename = "allLogsDetailed.txt"
filename = "sample.txt"
revision = ""
date = ""
bug = ""
lines = 0
revisionEx = /^r\d*/
dateEx = /\d{4}-\d{2}-\d{2}/
bugs = []
counter = 1.to_i
f = File.open(filename, "r")
f.each_line do |line|
=begin
puts "-------------"
puts "dash: " + first_dash
puts "info: " + info_line
puts "revision: " + revision
puts "bug: " + bug
puts "-------------"
=end
#read first dashes which contain first line
next if line =~ /^-{20}/ # first_dash == 'no' and line.include? "-----------------------"
if line =~ revisionEx
revision = revisionEx.match(line)
date = dateEx.match(line)
next
end
#now seach for bug
if line =~ /BUG=\d*/ && !(line =~ /BUG=[Nn]/)
bug = line
#once the bug number is found - report it and reinitialize every variable
bugs << revision.to_s + " " + date.to_s + " " + bug
#puts bug
#puts revision
#puts "bug " + counter.to_s + " has been recorder"
#counter = counter + 1.to_i
bug = ""
revision = ""
date = ""
next
end
end
puts "All Bugs"
puts bugs
#puts bugs.inspect
puts "Size: " + bugs.size.to_s
#puts "counter: " + counter.to_s
end
end
x = StdClass.new
x.startMe