slim 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ 1.2.1
2
+
3
+ * Support stylus as embedded engine
4
+ * Fix issue #257
5
+
1
6
  1.2.0
2
7
 
3
8
  * Add option :shortcut which configures attribute shortcuts
data/README.md CHANGED
@@ -73,7 +73,7 @@ Here's a quick example to demonstrate what a Slim template looks like:
73
73
 
74
74
  = yield
75
75
 
76
- - unless items.empty?
76
+ - if items.any?
77
77
  table
78
78
  - for item in items do
79
79
  tr
@@ -184,6 +184,7 @@ module Slim
184
184
  # These engines are executed at compile time
185
185
  register :coffee, TagEngine, :tag => :script, :attributes => { :type => 'text/javascript' }, :engine => StaticTiltEngine
186
186
  register :less, TagEngine, :tag => :style, :attributes => { :type => 'text/css' }, :engine => StaticTiltEngine
187
+ register :styl, TagEngine, :tag => :style, :attributes => { :type => 'text/css' }, :engine => StaticTiltEngine
187
188
  register :sass, TagEngine, :pretty, :tag => :style, :attributes => { :type => 'text/css' }, :engine => SassEngine
188
189
  register :scss, TagEngine, :pretty, :tag => :style, :attributes => { :type => 'text/css' }, :engine => SassEngine
189
190
 
@@ -25,7 +25,7 @@ module Slim
25
25
  string, code = parse_expression($')
26
26
  escape = code !~ /\A\{.*\}\Z/
27
27
  block << [:slim, :output, escape, escape ? code : code[1..-2], [:multi]]
28
- when /\A(#|[^#]*)/
28
+ when /\A([#\\]|[^#\\]*)/
29
29
  # Static text
30
30
  block << [:static, $&]
31
31
  string = $'
@@ -1,5 +1,5 @@
1
1
  module Slim
2
2
  # Slim version string
3
3
  # @api public
4
- VERSION = '1.2.0'
4
+ VERSION = '1.2.1'
5
5
  end
@@ -561,6 +561,14 @@ h1 *hash This is my title
561
561
  assert_html '<div disabled="disabled" empty1="" empty2="" empty3="">This is my title</div>', source, :remove_empty_attrs => false
562
562
  end
563
563
 
564
+ def test_splat_merging_with_arrays
565
+ source = %q{
566
+ *{:a => 1, :b => 2} *[[:c, 3], [:d, 4]] *[[:e, 5], [:f, 6]] This is my title
567
+ }
568
+
569
+ assert_html '<div a="1" b="2" c="3" d="4" e="5" f="6">This is my title</div>', source
570
+ end
571
+
564
572
  def test_splat_with_other_attributes
565
573
  source = %q{
566
574
  h1 data-id="123" *hash This is my title
@@ -40,9 +40,10 @@ p #{hello_world}
40
40
  def test_escape_interpolation
41
41
  source = %q{
42
42
  p \\#{hello_world}
43
+ p text1 \\#{hello_world} text2
43
44
  }
44
45
 
45
- assert_html '<p>#{hello_world}</p>', source
46
+ assert_html '<p>#{hello_world}</p><p>text1 #{hello_world} text2</p>', source
46
47
  end
47
48
 
48
49
  def test_complex_interpolation
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: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-03-30 00:00:00.000000000 Z
14
+ date: 2012-05-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: temple
18
- requirement: &4011380 !ruby/object:Gem::Requirement
18
+ requirement: &10177380 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 0.4.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *4011380
26
+ version_requirements: *10177380
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tilt
29
- requirement: &4026080 !ruby/object:Gem::Requirement
29
+ requirement: &10143080 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 1.3.3
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *4026080
37
+ version_requirements: *10143080
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: rake
40
- requirement: &4025180 !ruby/object:Gem::Requirement
40
+ requirement: &10142440 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: 0.8.7
46
46
  type: :development
47
47
  prerelease: false
48
- version_requirements: *4025180
48
+ version_requirements: *10142440
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: sass
51
- requirement: &4024320 !ruby/object:Gem::Requirement
51
+ requirement: &10141640 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: 3.1.0
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *4024320
59
+ version_requirements: *10141640
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: minitest
62
- requirement: &4023580 !ruby/object:Gem::Requirement
62
+ requirement: &10140540 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ! '>='
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *4023580
70
+ version_requirements: *10140540
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: kramdown
73
- requirement: &4022620 !ruby/object:Gem::Requirement
73
+ requirement: &10137320 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *4022620
81
+ version_requirements: *10137320
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: creole
84
- requirement: &4021940 !ruby/object:Gem::Requirement
84
+ requirement: &10523440 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *4021940
92
+ version_requirements: *10523440
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: builder
95
- requirement: &4021020 !ruby/object:Gem::Requirement
95
+ requirement: &10521700 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,7 +100,7 @@ dependencies:
100
100
  version: '0'
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *4021020
103
+ version_requirements: *10521700
104
104
  description: Slim is a template language whose goal is reduce the syntax to the essential
105
105
  parts without becoming cryptic.
106
106
  email:
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project: slim
229
- rubygems_version: 1.8.11
229
+ rubygems_version: 1.8.15
230
230
  signing_key:
231
231
  specification_version: 3
232
232
  summary: Slim is a template language.