slim 3.0.3 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3526425b78d5829bd231ac9a41146c6044b093d3
4
- data.tar.gz: fe4ab15abda376d89008704a2956e2c5e7050f99
3
+ metadata.gz: 62d3292109076e4e06bc239e5f78b6d53b198a34
4
+ data.tar.gz: 0c1e6219507af63490d7de910b2e7e4a478013a5
5
5
  SHA512:
6
- metadata.gz: fa521d0745c0b0a404c512fc22a9dd69643efcfec0827e500ef6b5ad183ef9fdda8a163550ece9ae9d2d7ecbddd3ac32fa13a0edcfdaf824bd4076950c9eb6d4
7
- data.tar.gz: caacf25c2529313fbf6aad2de36e6f5186de76b873819d214f39d982d3e91da7105f1d46ddf144e852f25a53f040ac20c3d8a45ea60c1abcba1967bfd3955b4a
6
+ metadata.gz: 711c54460e79e5191c8662e7c2764cf5b4a019cf65324c9e0ce59c547319903a04803b89ede833a354a80d87a6e2be50bc479a5689b1908acb4bf359b190e734
7
+ data.tar.gz: 13357a0c0ca79b446e29f7f9096a6964a97c0422bdb62f8826ad63ff551dc315633c82dc769d6864c255ae0c41d76e17fc8391d0578dafba64de87f03aca3888
@@ -2,8 +2,8 @@ language: ruby
2
2
 
3
3
  rvm:
4
4
  - ruby-head
5
- - 2.2.0
6
- - 2.1.5
5
+ - 2.2.2
6
+ - 2.1.6
7
7
  - 2.0.0
8
8
  - rbx-2
9
9
  - 1.9.3
@@ -15,21 +15,25 @@ sudo: false
15
15
  script: "bundle exec rake $TASK"
16
16
 
17
17
  env:
18
- - "TASK=test:core_and_plugins TILT=master"
19
- - "TASK=test:core_and_plugins TILT=1.3.7"
20
- - "TASK=test:core_and_plugins TILT=1.4.1"
21
- - "TASK=test:core_and_plugins TILT=2.0.1"
22
- - "TASK=test:rails RAILS=master"
23
- - "TASK=test:rails RAILS=3.1.12 TILT=1.3.4"
24
- - "TASK=test:rails RAILS=3.2.21 TILT=1.3.4"
25
- - "TASK=test:rails RAILS=4.0.12"
26
- - "TASK=test:rails RAILS=4.1.8"
27
- - "TASK=test:rails RAILS=4.2.0"
28
- - "TASK=test:sinatra SINATRA=master"
29
- - "TASK=test:sinatra SINATRA=1.3.6"
30
- - "TASK=test:sinatra SINATRA=1.4.5"
31
- - "TASK=bench"
32
- - "TASK=bench slow=1"
18
+ global:
19
+ # travis encrypt CODECLIMATE_REPO_TOKEN=???
20
+ - secure: "a7sD9iwPJJn3Fj+mn62GAmy/PEguh3elrilsp1KS+WfDiCiIKD8Q5KG2Jv67DGcQAGI3dPWeh7+ZhZ/W7nEipwWUBmSvGYVeoF63y8j6mNRLeekqspj94l47hXyFePj9bCadY1b1/xY4lE1pMEU8eA8AOUHUqCSuH+Kk/MuvyLM="
21
+ matrix:
22
+ - "TASK=test:core_and_plugins TILT=master"
23
+ - "TASK=test:core_and_plugins TILT=1.3.7"
24
+ - "TASK=test:core_and_plugins TILT=1.4.1"
25
+ - "TASK=test:core_and_plugins TILT=2.0.1"
26
+ - "TASK=test:rails RAILS=master"
27
+ - "TASK=test:rails RAILS=3.1.12 TILT=1.3.4"
28
+ - "TASK=test:rails RAILS=3.2.21 TILT=1.3.4"
29
+ - "TASK=test:rails RAILS=4.0.13"
30
+ - "TASK=test:rails RAILS=4.1.10"
31
+ - "TASK=test:rails RAILS=4.2.1"
32
+ - "TASK=test:sinatra SINATRA=master"
33
+ - "TASK=test:sinatra SINATRA=1.3.6"
34
+ - "TASK=test:sinatra SINATRA=1.4.6"
35
+ - "TASK=bench"
36
+ - "TASK=bench slow=1"
33
37
 
34
38
  matrix:
35
39
  exclude:
@@ -46,5 +50,6 @@ matrix:
46
50
  - rvm: ruby-head
47
51
  - rvm: jruby-19mode
48
52
  - rvm: jruby-head
49
- - rvm: rbx-2
50
- env: "TASK=test:rails RAILS=4.1.8"
53
+
54
+ notifications:
55
+ irc: "chat.freenode.net#slim-lang"
data/CHANGES CHANGED
@@ -1,18 +1,28 @@
1
- 3.0.3
1
+ 3.0.6 (2015-06-05)
2
+
3
+ * Fix warnings #625
4
+
5
+ 3.0.4 (2015-06-02)
6
+
7
+ * javascript: doesn't add type='text/javascript' anymore
8
+ * slimrb: --require added
9
+ * Fix #624
10
+
11
+ 3.0.3 (2015-03-06)
2
12
 
3
13
  * Fix #392, capturing for splat attributes didn't work correctly under Rails
4
14
 
5
- 3.0.2
15
+ 3.0.2 (2015-02-02)
6
16
 
7
17
  * slimrb: Add option --locals
8
18
  * Fix issues in the test suite (#576), thanks @dmke!
9
19
 
10
- 3.0.1
20
+ 3.0.1 (2014-12-22)
11
21
 
12
22
  * Allow more special characters in html attribute names (See https://html.spec.whatwg.org/multipage/syntax.html#attributes-2), #567
13
23
  * Fix: Code attributes mutate their argument (#571)
14
24
 
15
- 3.0.0
25
+ 3.0.0 (2014-12-07)
16
26
 
17
27
  * Drop 1.8.7 support
18
28
  * Deprecate default_options in favor of options
@@ -20,7 +30,7 @@
20
30
  * Deprecate `='`, `=='` and `tag'` syntax for trailing whitespace. Use `=<` etc. instead.
21
31
  * slimrb: Remove deprecated plugin options -l and -t
22
32
 
23
- 2.1.0
33
+ 2.1.0 (2014-10-15)
24
34
 
25
35
  * Parser: Require pairwise braces in quoted attributes
26
36
  * Parser: add :attr_list_delims and :code_attr_delims
@@ -43,7 +53,7 @@
43
53
  * Fix rails error reporting #587 (Manipulate stacktrace)
44
54
  * Splat: handle html_safe
45
55
 
46
- 2.0.3
56
+ 2.0.3 (2014-07-04)
47
57
 
48
58
  * slimrb: Don't update HTML output on exceptions
49
59
  * Allow dashes at the beginning of class names (#474)
@@ -52,11 +62,11 @@
52
62
  * Fix #485: missing end for empty `if` control blocks
53
63
  * Fix #510: double dash in class name
54
64
 
55
- 2.0.2
65
+ 2.0.2 (2013-10-27)
56
66
 
57
67
  * Add option :attr_delims
58
68
 
59
- 2.0.1
69
+ 2.0.1 (2013-07-31)
60
70
 
61
71
  * Support multiple attributes per shortcut (See issue #415)
62
72
  * Add support for org-ruby embedded engine
@@ -65,7 +75,7 @@
65
75
  * Fix issue #431
66
76
  * Also escape ' to &#39;
67
77
 
68
- 2.0.0
78
+ 2.0.0 (2013-05-27)
69
79
 
70
80
  * IMPORTANT: Backward incompatible syntax change: '{...}' and '[...]' are not
71
81
  allowed as ruby attribute wrappers anymore. Use parentheses '(...)'
@@ -100,11 +110,11 @@
100
110
  * Add syntax for trailing or leading whitespace after tag, e.g. input>, input<
101
111
  * Add syntax for trailing or leading whitespace after output, e.g. =>, =<
102
112
 
103
- 1.3.8
113
+ 1.3.8 (2013-04-11)
104
114
 
105
115
  * Disable some superflous deprecation warnings
106
116
 
107
- 1.3.7
117
+ 1.3.7 (2013-04-10)
108
118
 
109
119
  * Fixed issue #374, rescue and ensure blocks
110
120
  * Fixed issue #333 (Throw syntax error if you write text after closed tag)
@@ -132,25 +142,25 @@
132
142
  * Support for wrapping javascript in HTML comments or CDATA (Issue #340)
133
143
  * Asciidoc embedded engine added
134
144
 
135
- 1.3.6
145
+ 1.3.6 (2013-01-06)
136
146
 
137
147
  * Allow attribute values to be broken with `\` (Issue #331)
138
148
  * Tag shortcuts implemented (Issue #306)
139
149
  * Hash format of Slim::Parser option :shortcut changed, old configuration deprecated but still supported
140
150
 
141
- 1.3.5
151
+ 1.3.5 (2012-12-19)
142
152
 
143
153
  * Logic-less:
144
154
  - Rewrote logic-less mode (Issue #326, #327)
145
155
  - Logic-less mode supports lambdas
146
156
  - Option :dictionary_access made more powerful, value :wrapped deprecated
147
157
 
148
- 1.3.4
158
+ 1.3.4 (2012-11-15)
149
159
 
150
160
  * Fixed #314
151
161
  * Logic-less test cases added
152
162
 
153
- 1.3.3
163
+ 1.3.3 (2012-10-16)
154
164
 
155
165
  * Attribute handling made consistent:
156
166
  - Splat attributes, static and dynamic attributes are now all handled the same
@@ -162,11 +172,11 @@
162
172
  * Remove UTF BOM when parsing Slim code
163
173
  * Fixed issue #303
164
174
 
165
- 1.3.2
175
+ 1.3.2 (2012-09-26)
166
176
 
167
177
  * Fix boolean attributes #299
168
178
 
169
- 1.3.1
179
+ 1.3.1 (2012-09-23)
170
180
 
171
181
  * Support inline html at the beginning of a line (New line indicator <). No pipe symbol is | necessary.
172
182
  It is even possible to wrap other Slim syntax in such a html block.
@@ -185,22 +195,22 @@
185
195
  * Support thread options Slim::Engine.with_options which especially useful for Rails
186
196
  * Add explicit column number to SyntaxError.to_s
187
197
 
188
- 1.3.0
198
+ 1.3.0 (2012-09-04)
189
199
 
190
200
  * Parser wraps text blocks in [:slim, :text, ...] (Used by Translator/I18n plugin)
191
201
  * Added Translator/I18n plugin which uses GetText or FastGettext (require 'slim/translator')
192
202
  * Moved logic less mode out of the core to plugin (require 'slim/logic_less')
193
203
 
194
- 1.2.2
204
+ 1.2.2 (2012-06-21)
195
205
 
196
206
  * Fix issue #264
197
207
 
198
- 1.2.1
208
+ 1.2.1 (2012-05-22)
199
209
 
200
210
  * Support stylus as embedded engine
201
211
  * Fix issue #257
202
212
 
203
- 1.2.0
213
+ 1.2.0 (2012-03-30)
204
214
 
205
215
  * Add option :shortcut which configures attribute shortcuts
206
216
  Default setting:
@@ -212,14 +222,14 @@
212
222
  * Add syntax for splat attributes (#109)
213
223
  * Support for dynamic tags, e.g. *{:tag => 'img', :src => 'image.jpg'}
214
224
 
215
- 1.1.1
225
+ 1.1.1 (2012-02-29)
216
226
 
217
227
  * Evaluating a html attribute now happens only once (#219)
218
228
  * Code with trailing comma is treated as broken line (#226)
219
229
  * Support option :remove_empty_attrs (default true)
220
230
  * Require temple 0.4.0
221
231
 
222
- 1.1.0
232
+ 1.1.0 (2012-01-06)
223
233
 
224
234
  * Support for special characters in class/id shortcut removed
225
235
  * Do not allow : in class/id shortcut
@@ -227,14 +237,14 @@
227
237
  * Support options :indent, :sort_attrs
228
238
  * Require temple 0.3.5
229
239
 
230
- 1.0.4
240
+ 1.0.4 (2011-11-03)
231
241
 
232
242
  * Pass options to embedded Tilt engine
233
243
  Slim::EmbeddedEngine.set_default_options :markdown => {...}
234
244
  * Add test case for precompiled embedded engine 'builder'
235
245
  * Bug #204 fixed, tabs were not parsed correctly
236
246
 
237
- 1.0.3
247
+ 1.0.3 (2011-10-08)
238
248
 
239
249
  * Fix rubinius test cases
240
250
  * Fix line numbers for embedded engines
@@ -245,20 +255,20 @@
245
255
  * Empty static attributes are not removed anymore
246
256
  * Line indicator =' is supported in tags
247
257
 
248
- 1.0.2
258
+ 1.0.2 (2011-08-26)
249
259
 
250
260
  * Support for Rails 3.1 streaming (Temple > 0.3.2 required)
251
261
  * Switch to default format xhtml (supports all doctypes, including html5)
252
262
  * Improve parsing of #{interpolation} in quoted attributes (issue #159)
253
263
  * Use travis-ci for continous integration testing
254
264
 
255
- 1.0.1
265
+ 1.0.1 (2011-08-07)
256
266
 
257
267
  * Only delimiting brackets must be balanced in ruby attributes
258
268
  e.g this is possible now `a href=(ruby_code "{")
259
269
  * Skip empty lines in text block (#156)
260
270
 
261
- 1.0.0
271
+ 1.0.0 (2011-07-24)
262
272
 
263
273
  * Fixed html attribute issue in sections mode (#127)
264
274
  * Obsolete directive syntax removed
@@ -269,7 +279,7 @@
269
279
  * Dynamic attributes with value true/false are interpreted as boolean
270
280
  * Support boolean attributes without value e.g. option(selected id="abc")
271
281
 
272
- 0.9.3
282
+ 0.9.3 (2011-05-15)
273
283
 
274
284
  * Allow for bypassing escaping in attributes
275
285
  * check if string encoding is valid
@@ -285,7 +295,7 @@
285
295
  * Option :auto_escape replaced with inverse option :disable_escape
286
296
  * Require temple 0.3.0
287
297
 
288
- 0.9.2
298
+ 0.9.2 (2011-03-30)
289
299
 
290
300
  * add SassEngine which respects :pretty
291
301
  * embedded engine code refactored
@@ -295,64 +305,64 @@
295
305
  * add encoding option to Slim::Parser/Slim::Engine to enforce template encoding
296
306
  * vim support is now an external project
297
307
 
298
- 0.9.1
308
+ 0.9.1 (2011-03-10)
299
309
 
300
310
  * add new doctype syntax without !
301
311
  * slim directive expression has type and args
302
312
 
303
- 0.9.0
313
+ 0.9.0 (2011-01-30)
304
314
 
305
315
  * slim should not be registered as the default template handler.
306
316
  * add support for unescaped text interpolation
307
317
 
308
- 0.8.4
318
+ 0.8.4 (2011-01-26)
309
319
 
310
320
  * Added the option to turn off automatic HTML escaping.
311
321
  * update to tilt 1.2.2
312
322
  * allow call to yield in logic less mode
313
323
  * allow doctype declaration to be capitalized
314
324
 
315
- 0.8.3
325
+ 0.8.3 (2010-12-23)
316
326
 
317
327
  * Added support for html comments. The parser uses the :static filter instead of the :comment filter due to the way the parser is constructed.
318
328
 
319
- 0.8.2
329
+ 0.8.2 (2010-12-22)
320
330
 
321
331
  * fix issue #96
322
332
  * Added the Temple Debugger filter.
323
333
  * Rails problems fixed
324
334
 
325
- 0.8.1
335
+ 0.8.1 (2010-12-17)
326
336
 
327
337
  * remove backtick slim syntax -- no longer supported
328
338
  * slim executable conflict. issue #91
329
339
  * vim syntax support improved
330
340
 
331
- 0.8.0
341
+ 0.8.0 (2010-11-29)
332
342
 
333
343
  * rails logic less support
334
344
 
335
- 0.7.4
345
+ 0.7.4 (2010-11-22)
336
346
 
337
347
  * use ' for text block with trailing whitespace
338
348
  * allow to disable/enable embedded engines
339
349
 
340
- 0.7.3
350
+ 0.7.3 (2010-11-16)
341
351
 
342
352
  * fix #82
343
353
  * basic rails test added
344
354
 
345
- 0.7.2
355
+ 0.7.2 (2010-11-09)
346
356
 
347
357
  * get rid of rails deprecation warning
348
358
  * use_html_safe is activated automatically by temple
349
359
 
350
- 0.7.1
360
+ 0.7.1 (2010-11-03)
351
361
 
352
362
  * logic less mode
353
363
  * add syntax for explicitly closed tags
354
364
 
355
- 0.7.0
365
+ 0.7.0 (2010-10-25)
356
366
 
357
367
  * slim-mode.el for emacs added (modified haml-mode.el, needs some work to be fully functional for slim)
358
368
  * embedded engines
@@ -365,21 +375,21 @@
365
375
  * Slim now uses Temple and Tilt.
366
376
  * Choose your own attribute delimiter!
367
377
 
368
- 0.6.1
378
+ 0.6.1 (2010-10-17)
369
379
 
370
380
  * can wrap parens around attributes if you so desire
371
381
  * added erubis to the benchmarks
372
382
 
373
- 0.6.0
383
+ 0.6.0 (2010-10-17)
374
384
 
375
385
  * Added slim itself, haml and mustache to the development env for easier benchmarking.
376
386
  * added escape_html functionality. need to tweak for speed
377
387
 
378
- 0.5.1
388
+ 0.5.1 (2010-10-08)
379
389
 
380
390
  * Consecutive condition statements now working as expected.
381
391
 
382
- 0.5.0
392
+ 0.5.0 (2010-10-07)
383
393
 
384
394
  * Added 'unless' to the list of control words.
385
395
  * Fixes for inline conditions. There must be a better way of doing this??
@@ -388,29 +398,29 @@
388
398
  * Output code (start with '=') can now accept code blocks.
389
399
  * Method calls no longer need parenthesis. We need more tests to ensure the implementation's robustness.
390
400
 
391
- 0.4.1
401
+ 0.4.1 (2010-10-03)
392
402
 
393
403
  * Added '|' as an alias of '`' for parsing plain text. This simulates the syntax of the Jade template engine.
394
404
  * Added instructions of how to use the gem.
395
405
 
396
- 0.4.0
406
+ 0.4.0 (2010-09-21)
397
407
 
398
408
  * support for nesting lines under backtick
399
409
  * make it so that one space is the left margin. any additional spaces will be copied over
400
410
  * support for using indentation after backtick to denote paragraphs. useful for script tags and paragraphs
401
411
 
402
- 0.3.1
412
+ 0.3.1 (2010-09-17)
403
413
 
404
414
  * fix bug with adding end to nesting ruby code
405
415
 
406
- 0.3.0
416
+ 0.3.0 (2010-09-17)
407
417
 
408
418
  * Optimize compiled string to reduce number of concatentations to the buffer
409
419
 
410
- 0.2.0
420
+ 0.2.0 (2010-09-17)
411
421
 
412
422
  * can now make code call on same line as tag
413
423
 
414
- 0.1.0
424
+ 0.1.0 (2010-09-15)
415
425
 
416
426
  * Initial release
data/Gemfile CHANGED
@@ -25,8 +25,8 @@ if ENV['RAILS']
25
25
  end
26
26
  end
27
27
 
28
- #Choose minitest 4.7.x for sinatra or rails 3 and 4.0 otherwise go for newer version
29
- if (ENV['SINATRA'] && ENV['sinatra'] != 'master') || (ENV['RAILS'] && ENV['RAILS'].match(/^(3|4\.0)/))
28
+ #Choose minitest 4.7.x for sinatra < 1.4.6 or rails 3 and 4.0 otherwise go for newer version
29
+ if (ENV['SINATRA'] && ENV['SINATRA'] < '1.4.6') || (ENV['RAILS'] && ENV['RAILS'].match(/^(3|4\.0)/))
30
30
  gem 'minitest', '~> 4.7.4'
31
31
  else
32
32
  gem 'minitest', '~> 5.1'
@@ -37,7 +37,7 @@ if RUBY_VERSION >= '2.2.0'
37
37
  gem 'test-unit', platforms: :mri
38
38
  end
39
39
 
40
- if RUBY_ENGINE == 'rbx' && !ENV.key?('TRAVIS')
40
+ if RUBY_ENGINE == 'rbx' && !ENV['TRAVIS']
41
41
  gem 'psych'
42
42
  end
43
43
 
@@ -63,3 +63,7 @@ if ENV['TASK'] == 'bench'
63
63
  gem 'erubis'
64
64
  gem 'haml'
65
65
  end
66
+
67
+ if ENV['CODECLIMATE_REPO_TOKEN']
68
+ gem 'codeclimate-test-reporter'
69
+ end
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2010 - 2014 Slim Team
3
+ Copyright (c) 2010 - 2015 Slim Team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -754,7 +754,7 @@ end
754
754
  = captured_content
755
755
  ~~~
756
756
 
757
- Another interesting use case is to use an enumerable and capture for each element. The helper could look like this
757
+ 別の興味深いユースケースは、enumerableを使いそれぞれの要素をキャプチャすることです。ヘルパは、このようになります。
758
758
 
759
759
  ~~~ ruby
760
760
  module Capture
@@ -766,7 +766,7 @@ module Capture
766
766
  end
767
767
  ~~~
768
768
 
769
- and it would be used as follows
769
+ そして、次のように使用出来ます。
770
770
 
771
771
  ~~~ slim
772
772
  - links = { 'http://slim-lang.com' => 'The Slim Template Language' }
@@ -774,7 +774,7 @@ and it would be used as follows
774
774
  a href=url = text
775
775
  ~~~
776
776
 
777
- Afterwards, `link_list` contains the captured content.
777
+ その後は、`link_list`はキャプチャしたコンテンツを含みます。
778
778
 
779
779
  ### インクルードヘルパ
780
780
 
@@ -792,8 +792,8 @@ end
792
792
  このヘルパは次のように使用できます
793
793
 
794
794
  ~~~ slim
795
- nav= include_slim 'menu'
796
- section= include_slim 'content'
795
+ nav = include_slim 'menu'
796
+ section = include_slim 'content'
797
797
  ~~~
798
798
 
799
799
  しかし, このヘルパはキャッシュを行いません。その為, 目的にあったよりインテリジェントなバージョンを
@@ -1038,7 +1038,7 @@ Usage: slimrb [options]
1038
1038
  -c, --compile Compile only but do not run
1039
1039
  -e, --erb Convert to ERB
1040
1040
  --rails Generate rails compatible code (Implies --compile)
1041
- -r library Load library or plugin with -r slim/plugin
1041
+ -r, --require library Load library or plugin with -r slim/plugin
1042
1042
  -p, --pretty Produce pretty html
1043
1043
  -o, --option name=code Set slim option
1044
1044
  -l, --locals Hash|YAML|JSON Set local variables
@@ -1116,7 +1116,7 @@ Travis-CI は継続的インテグレーションテストに利用されてい
1116
1116
 
1117
1117
  Slim はすべての主要な Ruby 実装で動作します:
1118
1118
 
1119
- * Ruby 1.9.3, 2.0.0 および 2.1.0
1119
+ * Ruby 1.9.3, 2.0.0, 2.1.0 および 2.2.0
1120
1120
  * Ruby EE
1121
1121
  * JRuby 1.9 mode
1122
1122
  * Rubinius 2.0
@@ -1131,7 +1131,7 @@ $ git clone git://github.com/slim-template/slim
1131
1131
 
1132
1132
  魔法をかけた後 pull request を送ってください。私たちは pull request が大好きです!
1133
1133
 
1134
- Ruby の 2.1.0, 2.0.0, 1.9.3 と 1.8.7 でテストをすることを覚えておいてください。
1134
+ Ruby の 2.2.0, 2.1.0, 2.0.0 と 1.9.3 でテストをすることを覚えておいてください。
1135
1135
 
1136
1136
  もしドキュメントの不足を見つけたら, README.md をアップデートして私たちを助けて下さい。Slim に割く時間がないが, 私たちが知るべきものを何か見つけた場合には issue を送ってください。
1137
1137
 
@@ -1178,6 +1178,10 @@ Slim は [MIT license](http://www.opensource.org/licenses/MIT) に基づいて
1178
1178
  * [Coda](https://github.com/slim-template/Coda-2-Slim.mode)
1179
1179
  * [Atom](https://github.com/slim-template/language-slim)
1180
1180
 
1181
+ 静的コード解析:
1182
+
1183
+ * [Slim-Lint](https://github.com/sds/slim-lint)
1184
+
1181
1185
  テンプレート変換 (HAML, ERB, ...):
1182
1186
 
1183
1187
  * [Haml2Slim converter](https://github.com/slim-template/haml2slim)
@@ -1193,6 +1197,8 @@ Slim は [MIT license](http://www.opensource.org/licenses/MIT) に基づいて
1193
1197
  * [Plim (Python port of Slim)](https://github.com/2nd/plim)
1194
1198
  * [Skim (Slim for Javascript)](https://github.com/jfirebaugh/skim)
1195
1199
  * [Emblem.js (Javascript, similar to Slim)](https://github.com/machty/emblem.js)
1200
+ * [Hamlit (High performance Haml implementation, based on Temple like Slim)](https://github.com/k0kubun/hamlit)
1201
+ * [Faml (Faster Haml implementation, also using Temple like Slim)](https://github.com/eagletmt/faml)
1196
1202
  * [Haml (Older engine which inspired Slim)](https://github.com/haml/haml)
1197
1203
  * [Jade (Similar engine for javascript)](https://github.com/visionmedia/jade)
1198
1204
  * [Sweet (Similar engine which also allows to write classes and functions)](https://github.com/joaomdmoura/sweet)
data/README.md CHANGED
@@ -792,8 +792,8 @@ end
792
792
  This helper can then be used as follows
793
793
 
794
794
  ~~~ slim
795
- nav= include_slim 'menu'
796
- section= include_slim 'content'
795
+ nav = include_slim 'menu'
796
+ section = include_slim 'content'
797
797
  ~~~
798
798
 
799
799
  However this helper doesn't do any caching. You should therefore implement a more intelligent version of the helper which
@@ -883,7 +883,7 @@ Slim::Engine.options[:pretty] = true
883
883
  ### Setting options at runtime
884
884
 
885
885
  There are two ways to set options at runtime. For Tilt templates (`Slim::Template`) you can set
886
- the options when you instatiate the template:
886
+ the options when you instantiate the template:
887
887
 
888
888
  ~~~ ruby
889
889
  Slim::Template.new('template.slim', optional_option_hash).render(scope)
@@ -955,7 +955,7 @@ For developers who know more about Slim and Temple architecture it is possible t
955
955
  options at different positions. Temple uses an inheritance mechanism to allow subclasses to override
956
956
  options of the superclass. The option priorities are as follows:
957
957
 
958
- 1. `Slim::Template` options passed at engine instatination
958
+ 1. `Slim::Template` options passed at engine instantiation
959
959
  2. `Slim::Template.options`
960
960
  3. `Slim::Engine.thread_options`, `Slim::Engine.options`
961
961
  5. Parser/Filter/Generator `thread_options`, `options` (e.g `Slim::Parser`, `Slim::Compiler`)
@@ -1038,7 +1038,7 @@ Usage: slimrb [options]
1038
1038
  -c, --compile Compile only but do not run
1039
1039
  -e, --erb Convert to ERB
1040
1040
  --rails Generate rails compatible code (Implies --compile)
1041
- -r library Load library or plugin with -r slim/plugin
1041
+ -r, --require library Load library or plugin with -r slim/plugin
1042
1042
  -p, --pretty Produce pretty html
1043
1043
  -o, --option name=code Set slim option
1044
1044
  -l, --locals Hash|YAML|JSON Set local variables
@@ -1116,7 +1116,7 @@ Travis-CI is used for continuous integration testing: <http://travis-ci.org/slim
1116
1116
 
1117
1117
  Slim is working well on all major Ruby implementations:
1118
1118
 
1119
- * Ruby 1.9.3, 2.0.0 and 2.1.0
1119
+ * Ruby 1.9.3, 2.0.0, 2.1.0 and 2.2.0
1120
1120
  * Ruby EE
1121
1121
  * JRuby 1.9 mode
1122
1122
  * Rubinius 2.0
@@ -1131,7 +1131,7 @@ $ git clone git://github.com/slim-template/slim
1131
1131
 
1132
1132
  Work your magic and then submit a pull request. We love pull requests!
1133
1133
 
1134
- Please remember to keep the compatibility with Ruby versions 1.9.3, 2.0.0 and 2.1.0.
1134
+ Please remember to keep the compatibility with Ruby versions 1.9.3, 2.0.0, 2.1.0 and 2.2.0.
1135
1135
 
1136
1136
  If you find the documentation lacking, help us out and update this README.md. If you don't have the time to work on Slim, but found something we should know about, please submit an issue.
1137
1137
 
@@ -1178,6 +1178,10 @@ Syntax highlighting:
1178
1178
  * [Coda](https://github.com/slim-template/Coda-2-Slim.mode)
1179
1179
  * [Atom](https://github.com/slim-template/language-slim)
1180
1180
 
1181
+ Static code analysis:
1182
+
1183
+ * [Slim-Lint](https://github.com/sds/slim-lint)
1184
+
1181
1185
  Template Converters (HAML, ERB, ...):
1182
1186
 
1183
1187
  * [Haml2Slim converter](https://github.com/slim-template/haml2slim)
@@ -1193,6 +1197,8 @@ Language ports/Similar languages:
1193
1197
  * [Plim (Python port of Slim)](https://github.com/2nd/plim)
1194
1198
  * [Skim (Slim for Javascript)](https://github.com/jfirebaugh/skim)
1195
1199
  * [Emblem.js (Javascript, similar to Slim)](https://github.com/machty/emblem.js)
1200
+ * [Hamlit (High performance Haml implementation, based on Temple like Slim)](https://github.com/k0kubun/hamlit)
1201
+ * [Faml (Faster Haml implementation, also using Temple like Slim)](https://github.com/eagletmt/faml)
1196
1202
  * [Haml (Older engine which inspired Slim)](https://github.com/haml/haml)
1197
1203
  * [Jade (Similar engine for javascript)](https://github.com/visionmedia/jade)
1198
1204
  * [Sweet (Similar engine which also allows to write classes and functions)](https://github.com/joaomdmoura/sweet)
@@ -25,9 +25,6 @@ class SlimBenchmarks
25
25
  end
26
26
 
27
27
  def init_compiled_benches
28
- erb = ERB.new(@erb_code)
29
- erubis = Erubis::Eruby.new(@erb_code)
30
- fast_erubis = Erubis::FastEruby.new(@erb_code)
31
28
  haml_pretty = Haml::Engine.new(@haml_code, format: :html5)
32
29
  haml_ugly = Haml::Engine.new(@haml_code, format: :html5, ugly: true)
33
30
 
@@ -36,10 +33,10 @@ class SlimBenchmarks
36
33
  haml_pretty.def_method(context, :run_haml_pretty)
37
34
  haml_ugly.def_method(context, :run_haml_ugly)
38
35
  context.instance_eval %{
39
- def run_erb; #{erb.src}; end
40
- def run_erubis; #{erubis.src}; end
36
+ def run_erb; #{ERB.new(@erb_code).src}; end
37
+ def run_erubis; #{Erubis::Eruby.new(@erb_code).src}; end
41
38
  def run_temple_erb; #{Temple::ERB::Engine.new.call @erb_code}; end
42
- def run_fast_erubis; #{fast_erubis.src}; end
39
+ def run_fast_erubis; #{Erubis::FastEruby.new(@erb_code).src}; end
43
40
  def run_slim_pretty; #{Slim::Engine.new(pretty: true).call @slim_code}; end
44
41
  def run_slim_ugly; #{Slim::Engine.new.call @slim_code}; end
45
42
  }
@@ -55,13 +52,13 @@ class SlimBenchmarks
55
52
  end
56
53
 
57
54
  def init_tilt_benches
58
- tilt_erb = Tilt::ERBTemplate.new { @erb_code }
59
- tilt_erubis = Tilt::ErubisTemplate.new { @erb_code }
60
- tilt_temple_erb = Temple::ERB::Template.new { @erb_code }
61
- tilt_haml_pretty= Tilt::HamlTemplate.new(format: :html5){ @haml_code }
62
- tilt_haml_ugly = Tilt::HamlTemplate.new(format: :html5, ugly: true){ @haml_code }
63
- tilt_slim_pretty= Slim::Template.new(pretty: true) { @slim_code }
64
- tilt_slim_ugly = Slim::Template.new { @slim_code }
55
+ tilt_erb = Tilt::ERBTemplate.new { @erb_code }
56
+ tilt_erubis = Tilt::ErubisTemplate.new { @erb_code }
57
+ tilt_temple_erb = Temple::ERB::Template.new { @erb_code }
58
+ tilt_haml_pretty = Tilt::HamlTemplate.new(format: :html5) { @haml_code }
59
+ tilt_haml_ugly = Tilt::HamlTemplate.new(format: :html5, ugly: true) { @haml_code }
60
+ tilt_slim_pretty = Slim::Template.new(pretty: true) { @slim_code }
61
+ tilt_slim_ugly = Slim::Template.new { @slim_code }
65
62
 
66
63
  context = Context.new
67
64
 
@@ -9,7 +9,7 @@
9
9
  include partial
10
10
  include partial.txt
11
11
 
12
- インクルードプラグンを有効化
12
+ インクルードプラグインを有効化
13
13
 
14
14
  require 'slim/include'
15
15
 
@@ -11,6 +11,7 @@ so you can easily type text like this:
11
11
 
12
12
  p
13
13
  This is text.
14
+ This is text, too.
14
15
 
15
16
  Slim will automatically treat any line which doesn't start
16
17
  with a lowercase tag name or any of the special characters as an implicit text line.
@@ -29,10 +29,10 @@ module Slim
29
29
  tmp = unique_name
30
30
  [:multi,
31
31
  [:code, "#{tmp} = #{code}"],
32
- [:case, tmp,
33
- ['true', [:html, :attr, name, [:multi]]],
34
- ['false, nil', [:multi]],
35
- [:else, [:html, :attr, name, [:escape, escape, [:dynamic, tmp]]]]]]
32
+ [:if, tmp,
33
+ [:if, "#{tmp} == true",
34
+ [:html, :attr, name, [:multi]],
35
+ [:html, :attr, name, [:escape, escape, [:dynamic, tmp]]]]]]
36
36
  end
37
37
  else
38
38
  # Attribute with merging
@@ -44,7 +44,7 @@ module Slim
44
44
  @options[:compile] = true
45
45
  end
46
46
 
47
- opts.on('-r library', "Load library or plugin with -r slim/plugin") do |lib|
47
+ opts.on('-r', '--require library', "Load library or plugin with -r slim/plugin") do |lib|
48
48
  require lib.strip
49
49
  end
50
50
 
@@ -226,7 +226,7 @@ module Slim
226
226
  class JavaScriptEngine < TagEngine
227
227
  disable_option_validator!
228
228
 
229
- set_options tag: :script, attributes: { type: 'text/javascript' }
229
+ set_options tag: :script, attributes: {}
230
230
 
231
231
  def on_slim_embedded(engine, body)
232
232
  super(engine, [:html, :js, body])
@@ -1,3 +1,6 @@
1
+ # The Slim module contains all Slim related classes (e.g. Engine, Parser).
2
+ # Plugins might also reside within the Slim module (e.g. Include, Smart).
3
+ # @api public
1
4
  module Slim
2
5
  # Slim engine which transforms slim code to executable ruby code
3
6
  # @api public
@@ -9,9 +9,9 @@ module Slim
9
9
  class Include < Slim::Filter
10
10
  define_options :file, include_dirs: [Dir.pwd, '.']
11
11
 
12
- def on_html_tag(tag, attributes, content)
12
+ def on_html_tag(tag, attributes, content = nil)
13
13
  return super if tag != 'include'
14
- name = content.flatten.select {|s| String === s }.join
14
+ name = content.to_a.flatten.select {|s| String === s }.join
15
15
  raise ArgumentError, 'Invalid include statement' unless attributes == [:html, :attrs] && !name.empty?
16
16
  unless file = find_file(name)
17
17
  name = "#{name}.slim" if name !~ /\.slim\Z/i
@@ -41,7 +41,10 @@ module Slim
41
41
  exp
42
42
  end
43
43
 
44
+ # @api private
44
45
  alias call_without_include call
46
+
47
+ # @api private
45
48
  def call(input)
46
49
  Thread.current[:slim_include_engine] = self
47
50
  Thread.current[:slim_include_level] ||= 0
@@ -73,7 +73,8 @@ module Slim
73
73
  keys = Regexp.escape @attr_list_delims.keys.join
74
74
  @attr_list_delims_re = /\A\s*([#{keys}])/
75
75
  @embedded_re = /\A(#{Regexp.union(Embedded.engines.keys.map(&:to_s))}):(\s*)/
76
- @attr_name = "\\A\\s*([^\0\"'><\/=\s#{(@attr_list_delims.flatten + @code_attr_delims.flatten).map {|x| Regexp.escape(x) }.join}]+)"
76
+ keys = Regexp.escape ('"\'></='.split(//) + @attr_list_delims.flatten + @code_attr_delims.flatten).uniq.join
77
+ @attr_name = "\\A\\s*([^\0\s#{keys}]+)"
77
78
  @quoted_attr_re = /#{@attr_name}\s*=(=?)\s*("|')/
78
79
  @code_attr_re = /#{@attr_name}\s*=(=?)\s*/
79
80
  end
@@ -246,6 +247,9 @@ module Slim
246
247
  @stacks.last << [:newline]
247
248
  end
248
249
 
250
+ # Unknown line indicator found. Overwrite this method if
251
+ # you want to add line indicators to the Slim parser.
252
+ # The default implementation throws a syntax error.
249
253
  def unknown_line_indicator
250
254
  syntax_error! 'Unknown line indicator'
251
255
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Slim
4
4
  module Smart
5
+ # @api private
5
6
  class Parser < ::Slim::Parser
6
7
  define_options implicit_text: true
7
8
 
@@ -1,6 +1,7 @@
1
1
  require 'slim'
2
2
 
3
3
  module Slim
4
+ # @api private
4
5
  class Translator < Filter
5
6
  define_options :tr,
6
7
  tr_mode: :dynamic,
@@ -1,5 +1,5 @@
1
1
  module Slim
2
2
  # Slim version string
3
3
  # @api public
4
- VERSION = '3.0.3'
4
+ VERSION = '3.0.6'
5
5
  end
@@ -11,7 +11,6 @@ Gem::Specification.new do |s|
11
11
  s.summary = 'Slim is a template language.'
12
12
  s.description = 'Slim is a template language whose goal is reduce the syntax to the essential parts without becoming cryptic.'
13
13
  s.homepage = 'http://slim-lang.com/'
14
- s.rubyforge_project = s.name
15
14
  s.license = 'MIT'
16
15
 
17
16
  s.files = `git ls-files`.split("\n")
@@ -1,5 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
+ begin
4
+ require 'codeclimate-test-reporter'
5
+ CodeClimate::TestReporter.start
6
+ rescue LoadError
7
+ end
8
+
3
9
  require 'minitest/autorun'
4
10
  require 'slim'
5
11
  require 'slim/grammar'
@@ -1,5 +1,5 @@
1
+ # coding: utf-8
1
2
  require 'helper'
2
- require 'slim/command'
3
3
  require 'open3'
4
4
  require 'tempfile'
5
5
 
@@ -103,7 +103,7 @@ class TestSlimCommands < Minitest::Test
103
103
 
104
104
  def test_require
105
105
  with_tempfile 'puts "Not in slim"', 'rb' do |lib|
106
- prepare_common_test STATIC_TEMPLATE, '-r', lib, stdin_file: false, file_file: false do |out, err|
106
+ prepare_common_test STATIC_TEMPLATE, '--require', lib, stdin_file: false, file_file: false do |out, err|
107
107
  assert err.empty?
108
108
  assert_equal "Not in slim\n<p>Hello World!</p>\n", out
109
109
  end
@@ -121,7 +121,7 @@ javascript:
121
121
  alert('hello')
122
122
  p Hi
123
123
  }
124
- assert_html %{<script type="text/javascript">$(function() {});\n\n\nalert('hello')</script><p>Hi</p>}, source
124
+ assert_html %{<script>$(function() {});\n\n\nalert('hello')</script><p>Hi</p>}, source
125
125
  end
126
126
 
127
127
  def test_render_with_opal
@@ -141,7 +141,7 @@ opal:
141
141
 
142
142
  def test_render_with_javascript_with_tabs
143
143
  source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
144
- assert_html "<script type=\"text/javascript\">$(function() {});\nalert('hello')</script><p>Hi</p>", source
144
+ assert_html "<script>$(function() {});\nalert('hello')</script><p>Hi</p>", source
145
145
  end
146
146
 
147
147
  def test_render_with_javascript_including_variable
@@ -151,34 +151,34 @@ opal:
151
151
  javascript:
152
152
  $(function() { #{func} });
153
153
  }
154
- assert_html %q|<script type="text/javascript">$(function() { alert(&#39;hello&#39;); });</script>|, source
154
+ assert_html %q|<script>$(function() { alert(&#39;hello&#39;); });</script>|, source
155
155
  end
156
156
 
157
157
  def test_render_with_javascript_with_explicit_html_comment
158
158
  Slim::Engine.with_options(js_wrapper: :comment) do
159
159
  source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
160
- assert_html "<script type=\"text/javascript\"><!--\n$(function() {});\nalert('hello')\n//--></script><p>Hi</p>", source
160
+ assert_html "<script><!--\n$(function() {});\nalert('hello')\n//--></script><p>Hi</p>", source
161
161
  end
162
162
  end
163
163
 
164
164
  def test_render_with_javascript_with_explicit_cdata_comment
165
165
  Slim::Engine.with_options(js_wrapper: :cdata) do
166
166
  source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
167
- assert_html "<script type=\"text/javascript\">\n//<![CDATA[\n$(function() {});\nalert('hello')\n//]]>\n</script><p>Hi</p>", source
167
+ assert_html "<script>\n//<![CDATA[\n$(function() {});\nalert('hello')\n//]]>\n</script><p>Hi</p>", source
168
168
  end
169
169
  end
170
170
 
171
171
  def test_render_with_javascript_with_format_xhtml_comment
172
172
  Slim::Engine.with_options(js_wrapper: :guess, format: :xhtml) do
173
173
  source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
174
- assert_html "<script type=\"text/javascript\">\n//<![CDATA[\n$(function() {});\nalert('hello')\n//]]>\n</script><p>Hi</p>", source
174
+ assert_html "<script>\n//<![CDATA[\n$(function() {});\nalert('hello')\n//]]>\n</script><p>Hi</p>", source
175
175
  end
176
176
  end
177
177
 
178
178
  def test_render_with_javascript_with_format_html_comment
179
179
  Slim::Engine.with_options(js_wrapper: :guess, format: :html) do
180
180
  source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
181
- assert_html "<script type=\"text/javascript\"><!--\n$(function() {});\nalert('hello')\n//--></script><p>Hi</p>", source
181
+ assert_html "<script><!--\n$(function() {});\nalert('hello')\n//--></script><p>Hi</p>", source
182
182
  end
183
183
  end
184
184
 
@@ -229,14 +229,14 @@ ruby:
229
229
  javascript:
230
230
  $(function() {});
231
231
  }
232
- assert_html '<script type="text/javascript">$(function() {});</script>', source, disable_engines: [:ruby]
233
- assert_html '<script type="text/javascript">$(function() {});</script>', source, disable_engines: %w(ruby)
232
+ assert_html '<script>$(function() {});</script>', source, disable_engines: [:ruby]
233
+ assert_html '<script>$(function() {});</script>', source, disable_engines: %w(ruby)
234
234
 
235
235
  source = %q{
236
236
  javascript:
237
237
  $(function() {});
238
238
  }
239
- assert_html '<script type="text/javascript">$(function() {});</script>', source, enable_engines: [:javascript]
240
- assert_html '<script type="text/javascript">$(function() {});</script>', source, enable_engines: %w(javascript)
239
+ assert_html '<script>$(function() {});</script>', source, enable_engines: [:javascript]
240
+ assert_html '<script>$(function() {});</script>', source, enable_engines: %w(javascript)
241
241
  end
242
242
  end
@@ -4,12 +4,13 @@ require 'slim/include'
4
4
  class TestSlimInclude < TestSlim
5
5
  def test_include
6
6
  source = %q{
7
+ br/
7
8
  a: include slimfile
8
9
  b: include textfile
9
10
  c: include slimfile.slim
10
11
  d: include subdir/test
11
12
  }
12
- assert_html '<a>slim1recslim2</a><b>1+2=3</b><c>slim1recslim2</c><d>subdir</d>', source, include_dirs: [File.expand_path('files', File.dirname(__FILE__))]
13
+ assert_html '<br /><a>slim1recslim2</a><b>1+2=3</b><c>slim1recslim2</c><d>subdir</d>', source, include_dirs: [File.expand_path('files', File.dirname(__FILE__))]
13
14
  end
14
15
 
15
16
  def test_include_with_newline
@@ -13,7 +13,7 @@ protected
13
13
 
14
14
  def assert_xpath(xpath, message="Unable to find '#{xpath}' in response body.")
15
15
  assert_response :success, "Response type is not :success (code 200..299)."
16
-
16
+
17
17
  body = @response.body
18
18
  assert !body.empty?, "No response body found."
19
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slim
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Mendler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-03-06 00:00:00.000000000 Z
13
+ date: 2015-06-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: temple
@@ -197,9 +197,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  - !ruby/object:Gem::Version
198
198
  version: '0'
199
199
  requirements: []
200
- rubyforge_project: slim
200
+ rubyforge_project:
201
201
  rubygems_version: 2.2.2
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: Slim is a template language.
205
205
  test_files: []
206
+ has_rdoc: