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
|
# File 'lib/sourcify/spec/proc/raw_scanner/spec_helper.rb', line 26
def self.extended(base)
base.instance_eval do
before do
counter(:DoEndBlockCounter).class_eval do
alias_method :orig_started?, :started?
def started?; true; end
end
end
after do
counter(:DoEndBlockCounter).class_eval do
alias_method :started?, :orig_started?
end
end
def counter(type)
Sourcify::Proc::Parser::RawScanner::Extensions.const_get(type)
end
def kw_block_start_counter(data)
SCANNER.process(data)
SCANNER.do_end_counter.counts
end
def kw_block_start_alias1
%w{class def module begin case module if unless}
end
def kw_block_start_alias2
%w{while until for}
end
end
end
|