updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / acoc / fix_class_clash.patch
blob5a12dfe6bdfe8e326c4259c643b9df4f38408ea5
1 --- acoc_ori 2010-10-07 16:03:29.089119182 -0300
2 +++ acoc 2010-10-07 16:05:52.657578887 -0300
3 @@ -83,24 +83,26 @@
5 include Term::ANSIColor
7 -class Config < Hash; end
8 +module Acoc
9 + class Config < Hash; end
11 -class Program
12 - attr_accessor :flags, :specs
13 + class Program
14 + attr_accessor :flags, :specs
16 - def initialize(flags)
17 - @flags = flags || ""
18 - @specs = Array.new
19 + def initialize(flags)
20 + @flags = flags || ""
21 + @specs = Array.new
22 + end
23 end
24 -end
26 -class Rule
27 - attr_reader :regex, :flags, :colours
28 + class Rule
29 + attr_reader :regex, :flags, :colours
31 - def initialize(regex, flags, colours)
32 - @regex = regex
33 - @flags = flags
34 - @colours = colours
35 + def initialize(regex, flags, colours)
36 + @regex = regex
37 + @flags = flags
38 + @colours = colours
39 + end
40 end
41 end
43 @@ -153,7 +155,7 @@
44 # get configuration data
46 def parse_config(*files)
47 - @cmd = Config.new
48 + @cmd = Acoc::Config.new
49 parsed = 0
51 files.each do |file|
52 @@ -161,7 +163,7 @@
53 next unless file && FileTest::file?(file) && FileTest::readable?(file)
55 begin
56 - f = File.open(file) do |f|
57 + fo = File.open(file) do |f|
58 while line = f.gets do
59 next if line =~ /^(#|$)/ # skip blank lines and comments
61 @@ -184,7 +186,7 @@
62 if @cmd.has_key?(invocation)
63 @cmd[invocation].flags += flags unless flags.nil?
64 else
65 - @cmd[invocation] = Program.new(flags)
66 + @cmd[invocation] = Acoc::Program.new(flags)
67 end
68 prog.sub!(%r(/\w+), '')
69 end
70 @@ -205,7 +207,7 @@
71 end
73 progs.each do |prog|
74 - @cmd[prog].specs << Rule.new(Regexp.new(regex), flags, colours)
75 + @cmd[prog].specs << Acoc::Rule.new(Regexp.new(regex), flags, colours)
76 end
77 end
78 end
79 @@ -264,7 +266,7 @@
80 matched = false
82 # act on only the first match unless the /a flag was given
83 - break if matched && ! @cmd[prog].flags.include?('a')
84 + return if matched && ! @cmd[prog].flags.include?('a')
86 # get a pattern and attribute set pairing for this command
87 @cmd[prog].specs.each do |spec|