haml-coderay 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +6 -1
  2. data/lib/haml-coderay.rb +16 -1
  3. metadata +21 -4
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  haml-coderay
2
2
  ============
3
3
 
4
+ * [Homepage](http://github.com/blom/haml-coderay)
5
+ * [Documentation](http://rdoc.info/projects/blom/haml-coderay)
6
+
4
7
  [CodeRay][1] filter for [Haml][2]. Specify which [language][3] to
5
8
  highlight with a shebang followed by the language name:
6
9
 
@@ -11,8 +14,10 @@ highlight with a shebang followed by the language name:
11
14
  puts "hello"
12
15
  end
13
16
 
17
+ Use `:coderay_raw` if you want to disable `#{}` interpolation.
18
+
14
19
  The default [encoder][4] and encoder options are `:div` and `{}`,
15
- respectively, and they are accessible as:
20
+ respectively, and they can be altered through:
16
21
 
17
22
  Haml::Filters::CodeRay.encoder
18
23
  Haml::Filters::CodeRay.encoder_options
data/lib/haml-coderay.rb CHANGED
@@ -19,7 +19,7 @@ module Haml::Filters::CodeRay
19
19
  lazy_require "coderay"
20
20
 
21
21
  defined?(self::VERSION) ||
22
- VERSION = "0.0.2".freeze
22
+ VERSION = "0.1.0".freeze
23
23
 
24
24
  # Encoder (_default_: `:div`).
25
25
  #
@@ -49,3 +49,18 @@ module Haml::Filters::CodeRay
49
49
  ::CodeRay.scan(*prepare(text)).send(encoder, encoder_options)
50
50
  end
51
51
  end
52
+
53
+ # {Haml::Filters::CodeRay} without `#{}` interpolation. Use `:coderay_raw`
54
+ # instead of `:coderay`.
55
+ module Haml::Filters::CodeRay_raw
56
+ include Haml::Filters::Base
57
+ lazy_require "coderay"
58
+
59
+ def compile(precompiler, text)
60
+ precompiler.options[:suppress_eval] = true
61
+ text = Haml::Helpers::find_and_preserve(
62
+ Haml::Filters::CodeRay.render(text).rstrip,
63
+ precompiler.options[:preserve])
64
+ precompiler.send(:push_text, text)
65
+ end
66
+ end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-coderay
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 27
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
8
+ - 1
7
9
  - 0
8
- - 2
9
- version: 0.0.2
10
+ version: 0.1.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - "\xC3\x98rjan Blom"
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-04-16 00:00:00 +02:00
18
+ date: 2010-08-21 00:00:00 +02:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: coderay
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 3
27
30
  segments:
28
31
  - 0
29
32
  version: "0"
@@ -33,9 +36,11 @@ dependencies:
33
36
  name: haml
34
37
  prerelease: false
35
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
36
40
  requirements:
37
41
  - - ">="
38
42
  - !ruby/object:Gem::Version
43
+ hash: 3
39
44
  segments:
40
45
  - 0
41
46
  version: "0"
@@ -45,9 +50,11 @@ dependencies:
45
50
  name: bluecloth
46
51
  prerelease: false
47
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
48
54
  requirements:
49
55
  - - ">="
50
56
  - !ruby/object:Gem::Version
57
+ hash: 3
51
58
  segments:
52
59
  - 0
53
60
  version: "0"
@@ -57,9 +64,11 @@ dependencies:
57
64
  name: mg
58
65
  prerelease: false
59
66
  requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
60
68
  requirements:
61
69
  - - ">="
62
70
  - !ruby/object:Gem::Version
71
+ hash: 3
63
72
  segments:
64
73
  - 0
65
74
  version: "0"
@@ -69,9 +78,11 @@ dependencies:
69
78
  name: rspec
70
79
  prerelease: false
71
80
  requirement: &id005 !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ">="
74
84
  - !ruby/object:Gem::Version
85
+ hash: 3
75
86
  segments:
76
87
  - 0
77
88
  version: "0"
@@ -81,9 +92,11 @@ dependencies:
81
92
  name: yard
82
93
  prerelease: false
83
94
  requirement: &id006 !ruby/object:Gem::Requirement
95
+ none: false
84
96
  requirements:
85
97
  - - ">="
86
98
  - !ruby/object:Gem::Version
99
+ hash: 3
87
100
  segments:
88
101
  - 0
89
102
  version: "0"
@@ -111,23 +124,27 @@ rdoc_options: []
111
124
  require_paths:
112
125
  - lib
113
126
  required_ruby_version: !ruby/object:Gem::Requirement
127
+ none: false
114
128
  requirements:
115
129
  - - ">="
116
130
  - !ruby/object:Gem::Version
131
+ hash: 3
117
132
  segments:
118
133
  - 0
119
134
  version: "0"
120
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
+ none: false
121
137
  requirements:
122
138
  - - ">="
123
139
  - !ruby/object:Gem::Version
140
+ hash: 3
124
141
  segments:
125
142
  - 0
126
143
  version: "0"
127
144
  requirements: []
128
145
 
129
146
  rubyforge_project:
130
- rubygems_version: 1.3.6
147
+ rubygems_version: 1.3.7
131
148
  signing_key:
132
149
  specification_version: 3
133
150
  summary: CodeRay filter for Haml