slim 4.0.1 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +17 -14
- data/CHANGES +4 -0
- data/Gemfile +12 -13
- data/lib/slim/command.rb +13 -13
- data/lib/slim/parser.rb +1 -1
- data/lib/slim/version.rb +1 -1
- data/test/literate/TESTS.md +12 -4
- data/test/rails/app/assets/config/manifest.js +1 -0
- data/test/rails/config/application.rb +3 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 374bad17fd98e439f41336ea3a634afd4e918708803ada3d211071e565d3ba34
|
4
|
+
data.tar.gz: 94a7178a4263ec906413f4f5ce921fa2ddb12423fcd6e28bbb8fbd456bc2ebb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 282bb0085cd7e91ddffbc4fc9af6ab82ec4478ef2090a82592bf96a395f2ad172c6af9f1010f5e0e9cee57281c487e5e2bb4b25a75e2eac0df02018bc298faf9
|
7
|
+
data.tar.gz: 7924d7af215643a8207b738f3f97c46f32bb990db7a103987f14b8b9558ec7de9208aaf27c65840d7caa7d60c156e56f6f876dd7ff54190da91fc436ccc75842
|
data/.travis.yml
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
# https://www.ruby-lang.org/en/downloads/releases/
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.5.
|
6
|
-
- 2.4.
|
7
|
-
- 2.
|
8
|
-
- jruby-9.2.0.0
|
4
|
+
- 2.6.1
|
5
|
+
- 2.5.3
|
6
|
+
- 2.4.5
|
7
|
+
- jruby-9.2.6.0
|
9
8
|
- jruby-9.1.17.0
|
10
9
|
|
11
10
|
# Recommend sudo required when using trusty dist
|
@@ -20,16 +19,20 @@ after_success:
|
|
20
19
|
|
21
20
|
env:
|
22
21
|
global:
|
23
|
-
# travis encrypt CODECLIMATE_REPO_TOKEN=???
|
24
22
|
- secure: "a7sD9iwPJJn3Fj+mn62GAmy/PEguh3elrilsp1KS+WfDiCiIKD8Q5KG2Jv67DGcQAGI3dPWeh7+ZhZ/W7nEipwWUBmSvGYVeoF63y8j6mNRLeekqspj94l47hXyFePj9bCadY1b1/xY4lE1pMEU8eA8AOUHUqCSuH+Kk/MuvyLM="
|
25
23
|
matrix:
|
26
24
|
- "TASK=test:core_and_plugins"
|
27
|
-
- "TASK=test:rails RAILS=
|
28
|
-
- "TASK=test:rails RAILS=5.
|
29
|
-
- "TASK=test:
|
30
|
-
- "TASK=test:
|
31
|
-
- "TASK=
|
32
|
-
- "TASK=
|
25
|
+
- "TASK=test:rails RAILS=6.0.0.beta2"
|
26
|
+
- "TASK=test:rails RAILS=5.2.2"
|
27
|
+
- "TASK=test:rails RAILS=5.2.1.1"
|
28
|
+
- "TASK=test:rails RAILS=5.2.1"
|
29
|
+
- "TASK=test:sinatra SINATRA=2.0.5"
|
30
|
+
- "TASK=test:sinatra SINATRA=2.0.4"
|
31
|
+
- "TASK=test:sinatra SINATRA=2.0.3"
|
33
32
|
|
34
|
-
|
35
|
-
|
33
|
+
matrix:
|
34
|
+
exclude:
|
35
|
+
- rvm: 2.4.5
|
36
|
+
env: "TASK=test:rails RAILS=6.0.0.beta2"
|
37
|
+
- rvm: jruby-9.1.17.0
|
38
|
+
env: "TASK=test:rails RAILS=6.0.0.beta2"
|
data/CHANGES
CHANGED
data/Gemfile
CHANGED
@@ -7,6 +7,12 @@ group :test do
|
|
7
7
|
gem 'rack-test'
|
8
8
|
end
|
9
9
|
|
10
|
+
group :perf do
|
11
|
+
gem 'benchmark-ips'
|
12
|
+
gem 'erubis'
|
13
|
+
gem 'haml'
|
14
|
+
end
|
15
|
+
|
10
16
|
if ENV['TRAVIS']
|
11
17
|
gem 'rails-controller-testing'
|
12
18
|
end
|
@@ -30,19 +36,12 @@ if ENV['RAILS']
|
|
30
36
|
else
|
31
37
|
gem 'rails', "= #{ENV['RAILS']}"
|
32
38
|
end
|
33
|
-
end
|
34
39
|
|
35
|
-
|
36
|
-
if (ENV['SINATRA'] && ENV['SINATRA'] < '1.4.6') || (ENV['RAILS'] && ENV['RAILS'].match(/^(3|4\.0)/))
|
37
|
-
gem 'minitest', '~> 4.7.4'
|
38
|
-
else
|
39
|
-
gem 'minitest', '~> 5.1'
|
40
|
+
gem 'slim-rails', require: false
|
40
41
|
end
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
gem 'test-unit', platforms: :mri
|
45
|
-
end
|
43
|
+
gem 'test-unit', '~> 3.3', '>= 3.3.5'
|
44
|
+
gem 'minitest', '~> 5.14'
|
46
45
|
|
47
46
|
if RUBY_ENGINE == 'rbx' && !ENV['TRAVIS']
|
48
47
|
gem 'psych'
|
@@ -56,9 +55,9 @@ if ENV['SINATRA']
|
|
56
55
|
end
|
57
56
|
end
|
58
57
|
|
59
|
-
gem 'rake', '>= 0.
|
60
|
-
gem '
|
61
|
-
gem 'kramdown'
|
58
|
+
gem 'rake', '~> 13.0', '>= 13.0.1'
|
59
|
+
gem 'sassc', '~> 2.2', '>= 2.2.1'
|
60
|
+
gem 'kramdown', '~> 2.1'
|
62
61
|
|
63
62
|
if ENV['TASK'] == 'bench'
|
64
63
|
gem 'benchmark-ips'
|
data/lib/slim/command.rb
CHANGED
@@ -110,19 +110,19 @@ module Slim
|
|
110
110
|
Template.new(@options[:file]) { @options[:input].read }.render(nil, locals)
|
111
111
|
end
|
112
112
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
113
|
+
rescue Exception => ex
|
114
|
+
raise ex if @options[:trace] || SystemExit === ex
|
115
|
+
$stderr.print "#{ex.class}: " if ex.class != RuntimeError
|
116
|
+
$stderr.puts ex.message
|
117
|
+
$stderr.puts ' Use --trace for backtrace.'
|
118
|
+
exit 1
|
119
|
+
else
|
120
|
+
unless @options[:output]
|
121
|
+
file = args.shift
|
122
|
+
@options[:output] = file ? File.open(file, 'w') : $stdout
|
123
|
+
end
|
124
|
+
@options[:output].puts(result)
|
125
|
+
exit 0
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|
data/lib/slim/parser.rb
CHANGED
@@ -70,7 +70,7 @@ module Slim
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
keys = Regexp.union @attr_shortcut.keys.sort_by {|k| -k.size }
|
73
|
-
@attr_shortcut_re = /\A(#{keys}+)((?:\p{Word}|-)*)/
|
73
|
+
@attr_shortcut_re = /\A(#{keys}+)((?:\p{Word}|-|\/\d+|:(\w|-)+)*)/
|
74
74
|
keys = Regexp.union @tag_shortcut.keys.sort_by {|k| -k.size }
|
75
75
|
@tag_re = /\A(?:#{keys}|\*(?=[^\s]+)|(\p{Word}(?:\p{Word}|:|-)*\p{Word}|\p{Word}+))/
|
76
76
|
keys = Regexp.escape @code_attr_delims.keys.join
|
data/lib/slim/version.rb
CHANGED
data/test/literate/TESTS.md
CHANGED
@@ -368,7 +368,7 @@ You don't need the explicit `\` if the line ends with a comma `,`.
|
|
368
368
|
|
369
369
|
~~~ slim
|
370
370
|
ruby:
|
371
|
-
def test(*args)
|
371
|
+
def self.test(*args)
|
372
372
|
args.join('-')
|
373
373
|
end
|
374
374
|
= test('arg1',
|
@@ -961,7 +961,7 @@ You don't need the explicit `\` if the line ends with a comma `,`.
|
|
961
961
|
|
962
962
|
~~~ slim
|
963
963
|
ruby:
|
964
|
-
def test(*args)
|
964
|
+
def self.test(*args)
|
965
965
|
args.join('-')
|
966
966
|
end
|
967
967
|
a href=test('arg1',
|
@@ -1073,7 +1073,7 @@ with the :tag key.
|
|
1073
1073
|
|
1074
1074
|
~~~ slim
|
1075
1075
|
ruby:
|
1076
|
-
def a_unless_current
|
1076
|
+
def self.a_unless_current
|
1077
1077
|
@page_current ? {tag: 'span'} : {tag: 'a', href: 'http://slim-lang.com/'}
|
1078
1078
|
end
|
1079
1079
|
- @page_current = true
|
@@ -1186,13 +1186,15 @@ renders to
|
|
1186
1186
|
|
1187
1187
|
#### ID shortcut and class shortcut `.`
|
1188
1188
|
|
1189
|
-
ID and class shortcuts can contain dashes.
|
1189
|
+
ID and class shortcuts can contain dashes, slashes with digits, and colons.
|
1190
1190
|
|
1191
1191
|
~~~ slim
|
1192
1192
|
.-test text
|
1193
1193
|
#test- text
|
1194
1194
|
.--a#b- text
|
1195
1195
|
.a--test-123#--b text
|
1196
|
+
.a-1/2#b-1/2 text
|
1197
|
+
.ab:c-test#d:e text
|
1196
1198
|
~~~
|
1197
1199
|
|
1198
1200
|
renders as
|
@@ -1210,6 +1212,12 @@ renders as
|
|
1210
1212
|
<div class="a--test-123" id="--b">
|
1211
1213
|
text
|
1212
1214
|
</div>
|
1215
|
+
<div class="a-1/2" id="b-1/2">
|
1216
|
+
text
|
1217
|
+
</div>
|
1218
|
+
<div class="ab:c-test" id="d:e">
|
1219
|
+
text
|
1220
|
+
</div>
|
1213
1221
|
~~~
|
1214
1222
|
|
1215
1223
|
## Text interpolation
|
@@ -0,0 +1 @@
|
|
1
|
+
// file required by sprockets >= 4.0
|
@@ -5,9 +5,10 @@ require 'action_controller/railtie'
|
|
5
5
|
require 'action_view/railtie'
|
6
6
|
#require 'active_record/railtie'
|
7
7
|
#require 'action_mailer/railtie'
|
8
|
-
require
|
8
|
+
require 'sprockets/railtie'
|
9
9
|
|
10
10
|
require 'slim'
|
11
|
+
require 'slim-rails/register_engine'
|
11
12
|
|
12
13
|
module Dummy
|
13
14
|
class Application < Rails::Application
|
@@ -48,7 +49,7 @@ module Dummy
|
|
48
49
|
config.assets.configure do |env|
|
49
50
|
if env.respond_to?(:register_transformer) && Sprockets::VERSION.to_i > 3
|
50
51
|
env.register_mime_type 'text/slim', extensions: ['.slim', '.slim.html']
|
51
|
-
env.register_transformer 'text/slim', 'text/html', RegisterEngine::Transformer
|
52
|
+
env.register_transformer 'text/slim', 'text/html', Slim::Rails::RegisterEngine::Transformer
|
52
53
|
elsif env.respond_to?(:register_engine)
|
53
54
|
args = ['.slim', Slim::Template]
|
54
55
|
args << { silence_deprecation: true } if Sprockets::VERSION.start_with?('3')
|
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: 4.0
|
4
|
+
version: 4.1.0
|
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:
|
13
|
+
date: 2020-05-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: temple
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- test/literate/run.rb
|
149
149
|
- test/logic_less/test_logic_less.rb
|
150
150
|
- test/rails/Rakefile
|
151
|
+
- test/rails/app/assets/config/manifest.js
|
151
152
|
- test/rails/app/controllers/application_controller.rb
|
152
153
|
- test/rails/app/controllers/entries_controller.rb
|
153
154
|
- test/rails/app/controllers/slim_controller.rb
|
@@ -213,8 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
214
|
- !ruby/object:Gem::Version
|
214
215
|
version: '0'
|
215
216
|
requirements: []
|
216
|
-
|
217
|
-
rubygems_version: 2.7.6
|
217
|
+
rubygems_version: 3.1.2
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: Slim is a template language.
|