Skip to content

Commit 6baf5cd

Browse files
committed
make it work using old api
Conflicts: lib/coderay/scanners/bash.rb
1 parent 73ecd3a commit 6baf5cd

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

lib/coderay/scanners/bash.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Scanner for Bash
22
# Author: Petr Kovar <pejuko@gmail.com>
3-
module CodeRay
4-
module Scanners
3+
4+
module CodeRay module Scanners
5+
56
class Bash < Scanner
67

78
register_for :bash
@@ -84,11 +85,15 @@ def scan_tokens tokens, options
8485
elsif match = scan(/"/)
8586
@state = :quote
8687
@quote = match
87-
tokens << [:open, :string]
88+
tokens.begin_group :string
8889
tokens << [match, :delimiter]
8990
next
9091
elsif match = scan(/`/)
91-
tokens << [@shell ? :close : :open, :shell]
92+
if @shell
93+
tokens.end_group :shell
94+
else
95+
tokens.begin_group :shell
96+
end
9297
@shell = (not @shell)
9398
tokens << [match, :delimiter]
9499
next
@@ -165,7 +170,7 @@ def scan_tokens tokens, options
165170
kind = :content
166171
elsif match = scan(/#{@quote}/)
167172
tokens << [match, :delimiter]
168-
tokens << [:close, :string] if @quote == '"'
173+
tokens.end_group :string
169174
@quote = nil
170175
@state = :initial
171176
next

lib/coderay/scanners/erb_bash.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Scanner for Bash
22
# Author: spam+github@codez.ch
3-
require 'coderay/scanners/rhtml'
3+
require 'coderay/scanners/erb'
44

55
module CodeRay
66
module Scanners
7-
class ErbBash < RHTML
7+
class ErbBash < ERB
88
register_for :erb_bash
99

1010
protected

0 commit comments

Comments
 (0)