coderay_bash 1.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/coderay_bash.gemspec CHANGED
@@ -13,7 +13,7 @@ spec = Gem::Specification.new do |s|
13
13
  s.email = "pejuko@gmail.com"
14
14
  s.authors = ["Petr Kovar"]
15
15
  s.name = 'coderay_bash'
16
- s.version = '1.0'
16
+ s.version = '1.0.1'
17
17
  s.date = Time.now.strftime("%Y-%m-%d")
18
18
  s.add_dependency('coderay', '>= 1.0')
19
19
  s.require_path = 'lib'
@@ -97,6 +97,13 @@ module CodeRay module Scanners
97
97
  encoder.begin_group :string
98
98
  encoder.text_token(match, :delimiter)
99
99
  next
100
+ elsif match = scan(/<<\S+/)
101
+ @state = :quote
102
+ match =~ /<<(\S+)/
103
+ @quote = "#{$1}"
104
+ encoder.begin_group :string
105
+ encoder.text_token(match, :delimiter)
106
+ next
100
107
  elsif match = scan(/`/)
101
108
  if @shell
102
109
  encoder.end_group :shell
@@ -106,7 +113,7 @@ module CodeRay module Scanners
106
113
  @shell = (not @shell)
107
114
  encoder.text_token(match, :delimiter)
108
115
  next
109
- elsif match = scan(/'[^']*'/)
116
+ elsif match = scan(/'[^']*'?/)
110
117
  kind = :string
111
118
  elsif match = scan(/(?: \& | > | < | \| >> | << | >\& )/ox)
112
119
  kind = :bin
@@ -222,6 +229,10 @@ module CodeRay module Scanners
222
229
  encoder.text_token(match, kind)
223
230
  end
224
231
 
232
+ if @state == :quote
233
+ encoder.end_group :string
234
+ end
235
+
225
236
  encoder
226
237
  end
227
238
 
metadata CHANGED
@@ -1,89 +1,67 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: coderay_bash
3
- version: !ruby/object:Gem::Version
4
- hash: 15
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- version: "1.0"
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Petr Kovar
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-10-04 00:00:00 +02:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-03-11 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: coderay
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &14527500 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 15
29
- segments:
30
- - 1
31
- - 0
32
- version: "1.0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- description: |
36
- Bash highlighting for coderay. This gem was tested with coderay 1.0 and won't work with coderay < 1.0.
23
+ prerelease: false
24
+ version_requirements: *14527500
25
+ description: ! 'Bash highlighting for coderay. This gem was tested with coderay 1.0
26
+ and won''t work with coderay < 1.0.
37
27
 
28
+ '
38
29
  email: pejuko@gmail.com
39
30
  executables: []
40
-
41
31
  extensions: []
42
-
43
32
  extra_rdoc_files: []
44
-
45
- files:
33
+ files:
46
34
  - README.md
47
35
  - coderay_bash.gemspec
48
36
  - Rakefile
49
- - lib/coderay_bash.rb
50
- - lib/coderay/scanners/bash.rb
51
37
  - lib/coderay/scanners/erb_bash.rb
52
- has_rdoc: true
38
+ - lib/coderay/scanners/bash.rb
39
+ - lib/coderay_bash.rb
53
40
  homepage: http://github.com/pejuko/coderay_bash
54
41
  licenses: []
42
+ post_install_message: ! 'This gem was tested with coderay 1.0 and won''t work with
43
+ coderay 0.9.
55
44
 
56
- post_install_message: |
57
- This gem was tested with coderay 1.0 and won't work with coderay 0.9.
58
-
45
+ '
59
46
  rdoc_options: []
60
-
61
- require_paths:
47
+ require_paths:
62
48
  - lib
63
- required_ruby_version: !ruby/object:Gem::Requirement
49
+ required_ruby_version: !ruby/object:Gem::Requirement
64
50
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 3
69
- segments:
70
- - 0
71
- version: "0"
72
- required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
56
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
79
- - 0
80
- version: "0"
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
81
61
  requirements: []
82
-
83
62
  rubyforge_project:
84
- rubygems_version: 1.6.0
63
+ rubygems_version: 1.8.15
85
64
  signing_key:
86
65
  specification_version: 3
87
66
  summary: Simple bash scanner for highlighting with coderay.
88
67
  test_files: []
89
-