slim 3.0.0.beta.2 → 3.0.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/Gemfile +1 -0
- data/Rakefile +2 -2
- data/benchmarks/run-benchmarks.rb +5 -9
- data/lib/slim/engine.rb +0 -1
- data/lib/slim/erb_converter.rb +1 -2
- data/lib/slim/version.rb +1 -1
- data/slim.gemspec +1 -1
- data/test/core/test_erb_converter.rb +30 -30
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bbe9451b81dca5fa630efc57220721c08415a61
|
4
|
+
data.tar.gz: 2dcc7f4c4d12aa70964410865f73993031595955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ad8be63f3d3fe1b8460106f507fd00027c4d1a3482e045a25df6dc4313aaff9b8832cf2c1463e704adfee96623b8dbded7776d2c77896f42e06eb54a2ea199
|
7
|
+
data.tar.gz: ed9fb4a5cfbf8e29b0a6b754e9d5a312c2be35c094ff61d7424b2d789ea59e5fb04b34ec2461d0ef6d294bc03f34902a76ef10e21719f521cfb7cdadefd353d2
|
data/.travis.yml
CHANGED
@@ -25,8 +25,8 @@ env:
|
|
25
25
|
- "TASK=test:sinatra SINATRA=master"
|
26
26
|
- "TASK=test:sinatra SINATRA=1.3.6"
|
27
27
|
- "TASK=test:sinatra SINATRA=1.4.5"
|
28
|
-
- "TASK=bench
|
29
|
-
- "TASK=bench slow=1
|
28
|
+
- "TASK=bench"
|
29
|
+
- "TASK=bench slow=1"
|
30
30
|
|
31
31
|
matrix:
|
32
32
|
exclude:
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -6,8 +6,8 @@ end
|
|
6
6
|
|
7
7
|
require 'rake/testtask'
|
8
8
|
|
9
|
-
desc 'Run Slim benchmarks! (default parameters slow=false
|
10
|
-
task :bench, :
|
9
|
+
desc 'Run Slim benchmarks! (default parameters slow=false)'
|
10
|
+
task :bench, :slow do
|
11
11
|
ruby('benchmarks/run-benchmarks.rb')
|
12
12
|
end
|
13
13
|
|
@@ -5,15 +5,14 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'), File.dirname(__FILE__
|
|
5
5
|
require 'slim'
|
6
6
|
require 'context'
|
7
7
|
|
8
|
-
require 'benchmark'
|
8
|
+
require 'benchmark/ips'
|
9
9
|
require 'tilt'
|
10
10
|
require 'erubis'
|
11
11
|
require 'erb'
|
12
12
|
require 'haml'
|
13
13
|
|
14
14
|
class SlimBenchmarks
|
15
|
-
def initialize(slow
|
16
|
-
@iterations = (iterations || 1000).to_i
|
15
|
+
def initialize(slow)
|
17
16
|
@benches = []
|
18
17
|
|
19
18
|
@erb_code = File.read(File.dirname(__FILE__) + '/view.erb')
|
@@ -90,12 +89,9 @@ class SlimBenchmarks
|
|
90
89
|
end
|
91
90
|
|
92
91
|
def run
|
93
|
-
|
94
|
-
Benchmark.bmbm do |x|
|
92
|
+
Benchmark.ips do |x|
|
95
93
|
@benches.each do |name, block|
|
96
|
-
x.report
|
97
|
-
@iterations.to_i.times { block.call }
|
98
|
-
end
|
94
|
+
x.report(name.to_s, &block)
|
99
95
|
end
|
100
96
|
end
|
101
97
|
puts "
|
@@ -123,4 +119,4 @@ overhead added by the Temple framework compared to ERB.
|
|
123
119
|
end
|
124
120
|
end
|
125
121
|
|
126
|
-
SlimBenchmarks.new(ENV['slow']
|
122
|
+
SlimBenchmarks.new(ENV['slow']).run
|
data/lib/slim/engine.rb
CHANGED
data/lib/slim/erb_converter.rb
CHANGED
data/lib/slim/version.rb
CHANGED
data/slim.gemspec
CHANGED
@@ -31,36 +31,36 @@ html
|
|
31
31
|
p= "dynamic text with\nnewline"
|
32
32
|
}
|
33
33
|
|
34
|
-
result = %q{
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
with long explanatory
|
42
|
-
|
43
|
-
multiline comment
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
World!</p
|
62
|
-
|
63
|
-
|
34
|
+
result = %q{
|
35
|
+
<!DOCTYPE html>
|
36
|
+
<html>
|
37
|
+
<head>
|
38
|
+
<title>Hello World!</title>
|
39
|
+
<!--Meta tags
|
40
|
+
|
41
|
+
with long explanatory
|
42
|
+
|
43
|
+
multiline comment-->
|
44
|
+
<meta content="template language" name="description" />
|
45
|
+
<!--Stylesheets-->
|
46
|
+
<link href="style.css" media="screen" rel="stylesheet" type="text/css" />
|
47
|
+
<link href="colors.css" media="screen" rel="stylesheet" type="text/css" />
|
48
|
+
<!--Javascripts-->
|
49
|
+
<script src="jquery.js">
|
50
|
+
</script><script src="jquery.ui.js">
|
51
|
+
</script><!--[if lt IE 9]>
|
52
|
+
<script src="old-ie1.js">
|
53
|
+
</script><script src="old-ie2.js">
|
54
|
+
</script><![endif]--><style type="text/css">body{background-color:red}
|
55
|
+
|
56
|
+
</style>
|
57
|
+
</head><body>
|
58
|
+
<div id="container">
|
59
|
+
<p>Hello
|
60
|
+
|
61
|
+
World!</p>
|
62
|
+
<p><%= ::Temple::Utils.escape_html(("dynamic text with\nnewline")) %>
|
63
|
+
</p></div></body></html>}
|
64
64
|
|
65
65
|
assert_equal result, Slim::ERBConverter.new.call(source)
|
66
66
|
end
|
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.0.beta.
|
4
|
+
version: 3.0.0.beta.3
|
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: 2014-12-
|
13
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: temple
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.7.
|
21
|
+
version: 0.7.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.7.
|
28
|
+
version: 0.7.2
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: tilt
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,4 +201,3 @@ signing_key:
|
|
201
201
|
specification_version: 4
|
202
202
|
summary: Slim is a template language.
|
203
203
|
test_files: []
|
204
|
-
has_rdoc:
|