Skip to content

Commit c2c9e8d

Browse files
committed
make :ignore_errors default option
1 parent c87242a commit c2c9e8d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/coderay/scanners/bash.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ def scan_tokens tokens, options
192192

193193

194194
def handle_error(match, options)
195-
if options[:ignore_errors]
195+
o = {:ignore_errors => true}.merge(options)
196+
if o[:ignore_errors]
196197
[match, :plain]
197198
else
198199
[">>>>>#{match}<<<<<", :error]

test/test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_0010_ErbBash
6363
["other_command", :ident],
6464
["\n", :end_line]
6565
],
66-
CodeRay.scan(File.read(eb_file), :erb_bash) )
66+
CodeRay.scan(File.read(eb_file), :erb_bash, :ignore_errors => false))
6767
end
6868

6969
def test_0011_ErbBash_Ignoring_Errors
@@ -115,7 +115,7 @@ def test_0011_ErbBash_Ignoring_Errors
115115
["other_command", :ident],
116116
["\n", :end_line]
117117
],
118-
CodeRay.scan(File.read(eb_file), :erb_bash, :ignore_errors => true))
118+
CodeRay.scan(File.read(eb_file), :erb_bash))
119119
end
120120

121121
end

0 commit comments

Comments
 (0)