haml-edge 2.1.21 → 2.1.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/EDGE_GEM_VERSION +1 -1
  2. data/FAQ.md +142 -0
  3. data/{README.rdoc → README.md} +141 -141
  4. data/Rakefile +29 -17
  5. data/VERSION +1 -1
  6. data/lib/haml/buffer.rb +63 -27
  7. data/lib/haml/engine.rb +103 -80
  8. data/lib/haml/error.rb +7 -7
  9. data/lib/haml/exec.rb +80 -26
  10. data/lib/haml/filters.rb +106 -40
  11. data/lib/haml/helpers/action_view_extensions.rb +34 -39
  12. data/lib/haml/helpers/action_view_mods.rb +132 -139
  13. data/lib/haml/helpers.rb +207 -153
  14. data/lib/haml/html.rb +40 -21
  15. data/lib/haml/precompiler.rb +2 -0
  16. data/lib/haml/shared.rb +34 -3
  17. data/lib/haml/template/patch.rb +1 -1
  18. data/lib/haml/template/plugin.rb +0 -2
  19. data/lib/haml/template.rb +5 -0
  20. data/lib/haml/util.rb +136 -1
  21. data/lib/haml/version.rb +16 -4
  22. data/lib/haml.rb +502 -481
  23. data/lib/sass/css.rb +106 -68
  24. data/lib/sass/engine.rb +55 -22
  25. data/lib/sass/environment.rb +52 -21
  26. data/lib/sass/error.rb +23 -12
  27. data/lib/sass/files.rb +27 -0
  28. data/lib/sass/plugin/merb.rb +2 -2
  29. data/lib/sass/plugin/rails.rb +0 -2
  30. data/lib/sass/plugin.rb +32 -23
  31. data/lib/sass/repl.rb +7 -0
  32. data/lib/sass/script/bool.rb +9 -5
  33. data/lib/sass/script/color.rb +87 -1
  34. data/lib/sass/script/funcall.rb +23 -2
  35. data/lib/sass/script/functions.rb +93 -44
  36. data/lib/sass/script/lexer.rb +33 -3
  37. data/lib/sass/script/literal.rb +93 -1
  38. data/lib/sass/script/node.rb +14 -0
  39. data/lib/sass/script/number.rb +128 -4
  40. data/lib/sass/script/operation.rb +16 -1
  41. data/lib/sass/script/parser.rb +51 -21
  42. data/lib/sass/script/string.rb +7 -4
  43. data/lib/sass/script/unary_operation.rb +14 -1
  44. data/lib/sass/script/variable.rb +12 -1
  45. data/lib/sass/script.rb +26 -5
  46. data/lib/sass/tree/attr_node.rb +46 -9
  47. data/lib/sass/tree/comment_node.rb +41 -1
  48. data/lib/sass/tree/debug_node.rb +8 -0
  49. data/lib/sass/tree/directive_node.rb +20 -0
  50. data/lib/sass/tree/file_node.rb +12 -0
  51. data/lib/sass/tree/for_node.rb +15 -0
  52. data/lib/sass/tree/if_node.rb +22 -0
  53. data/lib/sass/tree/mixin_def_node.rb +12 -1
  54. data/lib/sass/tree/mixin_node.rb +13 -0
  55. data/lib/sass/tree/node.rb +136 -6
  56. data/lib/sass/tree/rule_node.rb +66 -7
  57. data/lib/sass/tree/variable_node.rb +10 -0
  58. data/lib/sass/tree/while_node.rb +11 -1
  59. data/lib/sass.rb +544 -534
  60. metadata +7 -6
  61. data/FAQ +0 -138
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.21
1
+ 2.1.22
data/FAQ.md ADDED
@@ -0,0 +1,142 @@
1
+ # Frequently Asked Questions
2
+
3
+ ## Haml
4
+
5
+ ### How do I put a punctuation mark after an element, like "`I like <strong>cake</strong>!`"?
6
+ {#q-punctuation}
7
+
8
+ Expressing the structure of a document
9
+ and expressing inline formatting are two very different problems.
10
+ Haml is mostly designed for structure,
11
+ so the best way to deal with formatting is to leave it to other languages
12
+ that are designed for it.
13
+ You could use Textile:
14
+
15
+ %p
16
+ :textile
17
+ I like *cake*!
18
+
19
+ or Markdown:
20
+
21
+ %p
22
+ :markdown
23
+ I like **cake**!
24
+
25
+ or plain old XHTML:
26
+
27
+ %p I like <strong>cake</strong>!
28
+
29
+ If you're inserting something that's generated by a helper, like a link,
30
+ then it's even easier:
31
+
32
+ %p== I like #{link_to 'chocolate', 'http://franschocolates.com'}!
33
+
34
+ ### How do I stop Haml from indenting the contents of my `pre` and `textarea` tags?
35
+ {#q-preserve}
36
+
37
+ Because Haml automatically indents the HTML source code,
38
+ the contents of whitespace-sensitive tags like `pre` and `textarea`
39
+ can get screwed up.
40
+ The solution is to replace the newlines inside these tags
41
+ with HTML newline entities (`&#x000A;`),
42
+ which Haml does using the {Haml::Helpers#preserve} and {Haml::Helpers#find_and_preserve} helpers.
43
+
44
+ Normally, Haml will do this for you automatically
45
+ when you're using a tag that needs it
46
+ (this can be customized using the [`:preserve`](Haml.html#preserve-option) option.
47
+ For example,
48
+
49
+ %p
50
+ %textarea= "Foo\nBar"
51
+
52
+ will be compiled to
53
+
54
+ <p>
55
+ <textarea>Foo&#x000A;Bar</textarea>
56
+ </p>
57
+
58
+ However, if a helper is generating the tag,
59
+ Haml can't detect that and so you'll have to call {Haml::Helpers#find_and_preserve} yourself.
60
+ You can also use `~`, which is the same as `=`
61
+ except that it automatically runs `find_and_preserve` on its input.
62
+ For example:
63
+
64
+ %p= find_and_preserve "<textarea>Foo\nBar</textarea>"
65
+
66
+ is the same as
67
+
68
+ %p~ "<textarea>Foo\nBar</textarea>"
69
+
70
+ and renders
71
+
72
+ <p><textarea>Foo&#x000A;Bar</textarea></p>
73
+
74
+ ### How do I make my long lines of Ruby code look nicer in my Haml document?
75
+ {#q-multiline}
76
+
77
+ Put them in a helper or your model.
78
+
79
+ Haml purposefully makes it annoying to put lots of Ruby code into your templates,
80
+ because lots of code doesn't belong in the view.
81
+ If you take that huge `link_to_remote` call
82
+ and move it to a `update_sidebar_link` helper,
83
+ it'll make your view both easier to read and more semantic.
84
+
85
+ If you absolutely must put lots of code in your template,
86
+ Haml offers a somewhat awkward multiline-continuation tool.
87
+ Put a `|` (pipe character) at the end of each line you want to be merged into one
88
+ (including the last line!).
89
+ For example:
90
+
91
+ %p= @this.is(way.too.much). |
92
+ code("and I should"). |
93
+ really_move.it.into( |
94
+ :a => @helper) |
95
+
96
+ ### I have Haml installed. Why is Rails (only looking for `.html.erb` files | rendering Haml files as plain text | rendering Haml files as blank pages)?
97
+ {#q-blank-page}
98
+
99
+ There are several reasons these things might be happening.
100
+ First of all, make sure `vendor/plugins/haml` really exists
101
+ and has an `init.rb` file in there.
102
+ Then try restarting Mongrel or WEBrick or whatever you might be using.
103
+
104
+ Finally, if none of these work,
105
+ chances are you've got some localization plugin like Globalize installed.
106
+ Such plugins often don't play nicely with Haml.
107
+ Luckily, there's usually an easy fix.
108
+ For Globalize, just edit `globalize/lib/globalize/rails/action_view.rb`
109
+ and change
110
+
111
+ @@re_extension = /\.(rjs|rhtml|rxml)$/
112
+
113
+ to
114
+
115
+ @@re_extension = /\.(rjs|rhtml|rxml|erb|builder|haml)$/
116
+
117
+ For other plugins, a little searching will probably turn up a way to fix them as well.
118
+
119
+ ## Sass
120
+
121
+ ### Can I use a variable from my controller in my Sass file?
122
+ {#q-ruby-code}
123
+
124
+ No. Sass files aren't views.
125
+ They're compiled once into static CSS files,
126
+ then left along until they're changed and need to be compiled again.
127
+ Not only don't you want to be running a full request cycle
128
+ every time someone requests a stylesheet,
129
+ but it's not a great idea to put much logic in there anyway
130
+ due to how browsers handle them.
131
+
132
+ If you really need some sort of dynamic CSS,
133
+ the best thing to do is put only the snippet you need to dynamically set
134
+ in the `head` of your HTML document.
135
+
136
+ ## You still haven't answered my question!
137
+
138
+ Sorry! Try looking at the Haml or Sass references,
139
+ in the doucmentation for the haml and Sass modules, respectively.
140
+ If you can't find an answer there,
141
+ feel free to ask in `#haml` on irc.freenode.net
142
+ or send an email to the [mailing list](http://groups.google.com/group/haml?hl=en).
@@ -1,4 +1,4 @@
1
- = Haml and Sass
1
+ # Haml and Sass
2
2
 
3
3
  Haml and Sass are templating engines
4
4
  for the two most common types of documents on the web:
@@ -9,32 +9,32 @@ by eliminating redundancy,
9
9
  reflecting the underlying structure that the document represents,
10
10
  and providing elegant, easily understandable, and powerful syntax.
11
11
 
12
- == Using
12
+ ## Using
13
13
 
14
14
  There are several ways to use Haml and Sass.
15
15
  They can be used as a plugin for Rails or Merb,
16
16
  or embedded on their own in other applications.
17
17
  The first step of all of these is to install the Haml gem:
18
18
 
19
- gem install haml
19
+ gem install haml
20
20
 
21
21
  To install Haml and Sass as a Rails plugin,
22
- just run <tt>haml --rails path/to/rails/app</tt>
22
+ just run `haml --rails path/to/rails/app`
23
23
  and both Haml and Sass will be installed.
24
- Views with the <tt>.haml</tt> (or <tt>.html.haml</tt> for edge)
24
+ Views with the `.haml` (or `.html.haml` for edge)
25
25
  extension will automatically use Haml.
26
26
  Sass is a little more complicated;
27
- <tt>.sass</tt> files should be placed in public/stylesheets/sass,
27
+ `.sass` files should be placed in public/stylesheets/sass,
28
28
  where they'll be automatically compiled
29
29
  to corresponding CSS files in public/stylesheets when needed
30
30
  (the Sass template directory is customizable...
31
31
  see the Sass module docs for details).
32
32
 
33
- For Merb, <tt>.html.haml</tt> views will work without any further modification.
33
+ For Merb, `.html.haml` views will work without any further modification.
34
34
  To enable Sass, you also need to add a dependency.
35
35
  To do so, just add
36
36
 
37
- dependency "merb-haml"
37
+ dependency "merb-haml"
38
38
 
39
39
  to config/dependencies.rb (or config/init.rb in a flat/very flat Merb application).
40
40
  Then it'll work just like it does in Rails.
@@ -42,31 +42,31 @@ Then it'll work just like it does in Rails.
42
42
  To use Haml and Sass programatically,
43
43
  check out the RDocs for the Haml and Sass modules.
44
44
 
45
- == Formatting
45
+ ## Formatting
46
46
 
47
- === Haml
47
+ ### Haml
48
48
 
49
49
  The most basic element of Haml
50
- is a shorthand for creating HTML tags:
50
+ is a shorthand for creating HTML
51
51
 
52
- %tagname{:attr1 => 'value1', :attr2 => 'value2'} Contents
52
+ %tagname{:attr1 => 'value1', :attr2 => 'value2'} Contents
53
53
 
54
54
  No end-tag is needed; Haml handles that automatically.
55
- Adding <tt>class</tt> and <tt>id</tt> attributes is even easier.
55
+ Adding `class` and `id` attributes is even easier.
56
56
  Haml uses the same syntax as the CSS that styles the document:
57
57
 
58
- %tagname#id.class
58
+ %tagname#id.class
59
59
 
60
- In fact, when you're using the <tt><div></tt> tag,
61
- it becomes <em>even easier</em>.
62
- Because <tt><div></tt> is such a common element,
60
+ In fact, when you're using the `<div>` tag,
61
+ it becomes _even easier_.
62
+ Because `<div>` is such a common element,
63
63
  a tag without a name defaults to a div. So
64
64
 
65
- #foo Hello!
65
+ #foo Hello!
66
66
 
67
67
  becomes
68
68
 
69
- <div id='foo'>Hello!</div>
69
+ <div id='foo'>Hello!</div>
70
70
 
71
71
  Haml uses indentation
72
72
  to bring the individual elements to represent the HTML structure.
@@ -74,40 +74,40 @@ A tag's children are indented beneath than the parent tag.
74
74
  Again, a closing tag is automatically added.
75
75
  For example:
76
76
 
77
- %ul
78
- %li Salt
79
- %li Pepper
77
+ %ul
78
+ %li Salt
79
+ %li Pepper
80
80
 
81
81
  becomes:
82
82
 
83
- <ul>
84
- <li>Salt</li>
85
- <li>Pepper</li>
86
- </ul>
83
+ <ul>
84
+ <li>Salt</li>
85
+ <li>Pepper</li>
86
+ </ul>
87
87
 
88
88
  You can also put plain text as a child of an element:
89
89
 
90
- %p
91
- Hello,
92
- World!
90
+ %p
91
+ Hello,
92
+ World!
93
93
 
94
94
  It's also possible to embed Ruby code into Haml documents.
95
- An equals sign, <tt>=</tt>, will output the result of the code.
96
- A hyphen, <tt>-</tt>, will run the code but not output the result.
95
+ An equals sign, `=`, will output the result of the code.
96
+ A hyphen, `-`, will run the code but not output the result.
97
97
  You can even use control statements
98
- like <tt>if</tt> and <tt>while</tt>:
98
+ like `if` and `while`:
99
99
 
100
- %p
101
- Date/Time:
102
- - now = DateTime.now
103
- %strong= now
104
- - if now > DateTime.parse("December 31, 2006")
105
- = "Happy new " + "year!"
100
+ %p
101
+ Date/Time:
102
+ - now = DateTime.now
103
+ %strong= now
104
+ - if now > DateTime.parse("December 31, 2006")
105
+ = "Happy new " + "year!"
106
106
 
107
107
  Haml provides far more tools than those presented here.
108
108
  Check out the reference documentation in the Haml module.
109
109
 
110
- === Sass
110
+ ### Sass
111
111
 
112
112
  At its most basic,
113
113
  Sass is just another way of writing CSS.
@@ -119,15 +119,15 @@ and newlines indicate the end of an attribute,
119
119
  rather than a semicolon.
120
120
  For example:
121
121
 
122
- #main
123
- :background-color #f00
124
- :width 98%
122
+ #main
123
+ :background-color #f00
124
+ :width 98%
125
125
 
126
126
  becomes:
127
127
 
128
- #main {
129
- background-color: #f00;
130
- width: 98% }
128
+ #main {
129
+ background-color: #f00;
130
+ width: 98% }
131
131
 
132
132
  However, Sass provides much more than a way to make CSS look nice.
133
133
  In CSS, it's important to have accurate selectors,
@@ -144,35 +144,35 @@ Well, Sass gets rid of that.
144
144
  Like Haml, it uses indentation to indicate the structure of the document.
145
145
  So, what was:
146
146
 
147
- #main {
148
- width: 90%;
149
- }
150
- #main p {
151
- border-style: solid;
152
- border-width: 1px;
153
- border-color: #00f;
154
- }
155
- #main p a {
156
- text-decoration: none;
157
- font-weight: bold;
158
- }
159
- #main p a:hover {
160
- text-decoration: underline;
161
- }
147
+ #main {
148
+ width: 90%;
149
+ }
150
+ #main p {
151
+ border-style: solid;
152
+ border-width: 1px;
153
+ border-color: #00f;
154
+ }
155
+ #main p a {
156
+ text-decoration: none;
157
+ font-weight: bold;
158
+ }
159
+ #main p a:hover {
160
+ text-decoration: underline;
161
+ }
162
162
 
163
163
  becomes:
164
164
 
165
- #main
166
- :width 90%
167
- p
168
- :border-style solid
169
- :border-width 1px
170
- :border-color #00f
171
- a
172
- :text-decoration none
173
- :font-weight bold
174
- a:hover
175
- :text-decoration underline
165
+ #main
166
+ :width 90%
167
+ p
168
+ :border-style solid
169
+ :border-width 1px
170
+ :border-color #00f
171
+ a
172
+ :text-decoration none
173
+ :font-weight bold
174
+ a:hover
175
+ :text-decoration underline
176
176
 
177
177
  Pretty nice, no? Well, it gets better.
178
178
  One of the main complaints against CSS is that it doesn't allow variables.
@@ -180,127 +180,127 @@ What if have a color or a width you re-use all the time?
180
180
  In CSS, you just have to re-type it each time,
181
181
  which is a nightmare when you decide to change it later.
182
182
  Not so for Sass!
183
- You can use the "!" character to set variables.
184
- Then, if you put "=" after your attribute name,
183
+ You can use the `!` character to set variables.
184
+ Then, if you put `=` after your attribute name,
185
185
  you can set it to a variable.
186
186
  For example:
187
187
 
188
- !note_bg= #55aaff
188
+ !note_bg= #55aaff
189
189
 
190
- #main
191
- :width 70%
192
- .note
193
- :background-color= !note_bg
194
- p
195
- :width 5em
196
- :background-color= !note_bg
190
+ #main
191
+ :width 70%
192
+ .note
193
+ :background-color= !note_bg
194
+ p
195
+ :width 5em
196
+ :background-color= !note_bg
197
197
 
198
198
  becomes:
199
199
 
200
- #main {
201
- width: 70%; }
202
- #main .note {
203
- background-color: #55aaff; }
204
- #main p {
205
- width: 5em;
206
- background-color: #55aaff; }
200
+ #main {
201
+ width: 70%; }
202
+ #main .note {
203
+ background-color: #55aaff; }
204
+ #main p {
205
+ width: 5em;
206
+ background-color: #55aaff; }
207
207
 
208
208
  You can even do simple arithmetic operations with variables,
209
209
  adding numbers and even colors together:
210
210
 
211
- !main_bg= #46ar12
212
- !main_width= 40em
211
+ !main_bg= #46ar12
212
+ !main_width= 40em
213
213
 
214
- #main
215
- :background-color= !main_bg
216
- :width= !main_width
217
- .sidebar
218
- :background-color= !main_bg + #333333
219
- :width= !main_width - 25em
214
+ #main
215
+ :background-color= !main_bg
216
+ :width= !main_width
217
+ .sidebar
218
+ :background-color= !main_bg + #333333
219
+ :width= !main_width - 25em
220
220
 
221
221
  becomes:
222
222
 
223
- #main {
224
- background-color: #46a312;
225
- width: 40em; }
226
- #main .sidebar {
227
- background-color: #79d645;
228
- width: 15em; }
223
+ #main {
224
+ background-color: #46a312;
225
+ width: 40em; }
226
+ #main .sidebar {
227
+ background-color: #79d645;
228
+ width: 15em; }
229
229
 
230
230
  Taking the idea of variables a bit further are mixins.
231
231
  These let you group whole swathes of CSS attributes into a single
232
232
  directive and then include those anywhere you want:
233
233
 
234
- =blue-border
235
- :border
236
- :color blue
237
- :width 2px
238
- :style dotted
234
+ =blue-border
235
+ :border
236
+ :color blue
237
+ :width 2px
238
+ :style dotted
239
239
 
240
- .comment
241
- +blue-border
242
- :padding 2px
243
- :margin 10px 0
240
+ .comment
241
+ +blue-border
242
+ :padding 2px
243
+ :margin 10px 0
244
244
 
245
- .reply
246
- +blue-border
245
+ .reply
246
+ +blue-border
247
247
 
248
248
  becomes:
249
249
 
250
- .comment {
251
- border-color: blue;
252
- border-width: 2px;
253
- border-style: dotted;
254
- padding: 2px;
255
- margin: 10px 0;
256
- }
250
+ .comment {
251
+ border-color: blue;
252
+ border-width: 2px;
253
+ border-style: dotted;
254
+ padding: 2px;
255
+ margin: 10px 0;
256
+ }
257
257
 
258
- .reply {
259
- border-color: blue;
260
- border-width: 2px;
261
- border-style: dotted;
262
- }
258
+ .reply {
259
+ border-color: blue;
260
+ border-width: 2px;
261
+ border-style: dotted;
262
+ }
263
263
 
264
264
  A comprehensive list of features is in
265
265
  the documentation for the Sass module.
266
266
 
267
- == Indentation
267
+ ## Indentation
268
268
 
269
269
  Indentation can be made up of one or more tabs or spaces.
270
270
  However, indentation must be consistent within a given document.
271
271
  Hard tabs and spaces can't be mixed,
272
272
  and the same number of tabs or spaces must be used throughout.
273
273
 
274
- == Executables
274
+ ## Executables
275
275
 
276
276
  The Haml gem includes several executables that are useful
277
277
  for dealing with Haml and Sass from the command line.
278
278
 
279
- === +haml+
279
+ ### `haml`
280
280
 
281
- The +haml+ executable transforms a source Haml file into HTML.
282
- See <tt>haml --help</tt> for further information and options.
281
+ The `haml` executable transforms a source Haml file into HTML.
282
+ See `haml --help` for further information and options.
283
283
 
284
- === +sass+
284
+ ### `sass`
285
285
 
286
- The +sass+ executable transforms a source Sass file into CSS.
287
- See <tt>sass --help</tt> for further information and options.
286
+ The `sass` executable transforms a source Sass file into CSS.
287
+ See `sass --help` for further information and options.
288
288
 
289
- === <tt>html2haml</tt>
289
+ ### `html2haml`
290
290
 
291
- The <tt>html2haml</tt> executable attempts to transform HTML,
291
+ The `html2haml` executable attempts to transform HTML,
292
292
  optionally with ERB markup, into Haml code.
293
293
  Since HTML is so variable, this transformation is not always perfect;
294
294
  it's a good idea to have a human check the output of this tool.
295
- See <tt>html2haml --help</tt> for further information and options.
295
+ See `html2haml --help` for further information and options.
296
296
 
297
- === <tt>css2sass</tt>
297
+ ### `css2sass`
298
298
 
299
- The <tt>css2sass</tt> executable attempts to transform CSS into Sass code.
299
+ The `css2sass` executable attempts to transform CSS into Sass code.
300
300
  This transformation attempts to use Sass nesting where possible.
301
- See <tt>css2sass --help</tt> for further information and options.
301
+ See `css2sass --help` for further information and options.
302
302
 
303
- == Authors
303
+ ## Authors
304
304
 
305
305
  Haml and Sass are designed by Hampton Catlin (hcatlin) and he is the author
306
306
  of the original implementation. However, Hampton doesn't even know his way
@@ -329,4 +329,4 @@ buy Nathan some jelly beans. Maybe pet a kitten. Yeah. Pet that kitty.
329
329
  Some of the work on Haml was supported by Unspace Interactive.
330
330
 
331
331
  Beyond that, the implementation is licensed under the MIT License.
332
- Ok, fine, I guess that means compliments aren't *required*.
332
+ Okay, fine, I guess that means compliments aren't __required__.
data/Rakefile CHANGED
@@ -122,25 +122,37 @@ end
122
122
 
123
123
  # ----- Documentation -----
124
124
 
125
- begin
126
- require 'hanna/rdoctask'
127
- rescue LoadError
128
- require 'rake/rdoctask'
125
+ task :rdoc do
126
+ puts '=' * 100, <<END, '=' * 100
127
+ Haml uses the YARD documentation system (http://github.com/lsegal/yard).
128
+ Install the yard gem and then run "rake doc".
129
+ END
129
130
  end
130
131
 
131
- Rake::RDocTask.new do |rdoc|
132
- rdoc.title = 'Haml/Sass'
133
- rdoc.options << '--line-numbers' << '--inline-source'
134
- rdoc.rdoc_files.include(*FileList.new('*') do |list|
135
- list.exclude(/(^|[^.a-z])[a-z]+/)
136
- list.exclude('TODO')
137
- end.to_a)
138
- rdoc.rdoc_files.include('lib/**/*.rb')
139
- rdoc.rdoc_files.exclude('TODO')
140
- rdoc.rdoc_files.exclude('lib/haml/buffer.rb')
141
- rdoc.rdoc_files.exclude('lib/sass/tree/*')
142
- rdoc.rdoc_dir = 'rdoc'
143
- rdoc.main = 'README.rdoc'
132
+ begin
133
+ require 'yard'
134
+
135
+ YARD::Rake::YardocTask.new do |t|
136
+ t.files = FileList.new('lib/**/*.rb') do |list|
137
+ list.exclude('lib/haml/template/*.rb')
138
+ list.exclude('lib/haml/helpers/action_view_mods.rb')
139
+ end.to_a
140
+ t.options += FileList.new('yard/*.rb').to_a.map {|f| ['-e', f]}.flatten
141
+ t.options << '--files' << FileList.new('*') do |list|
142
+ list.exclude(/(^|[^.a-z])[a-z]+/)
143
+ list.exclude('README.md')
144
+ list.exclude('REVISION')
145
+ list.exclude('TODO')
146
+ end.to_a.join(',')
147
+ end
148
+ Rake::Task['yardoc'].instance_variable_set('@comment', nil)
149
+
150
+ desc "Generate Documentation"
151
+ task :doc => :yardoc
152
+ rescue LoadError
153
+ desc "Generate Documentation"
154
+ task :doc => :rdoc
155
+ task :yardoc => :rdoc
144
156
  end
145
157
 
146
158
  # ----- Coverage -----
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.21
1
+ 2.1.22