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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30e108dd9c5cf0ddce9202cbf6dc2a0e70e55713
4
- data.tar.gz: 1eb064293baadcf534af30e0a822dd3eab1bd16a
3
+ metadata.gz: 1bbe9451b81dca5fa630efc57220721c08415a61
4
+ data.tar.gz: 2dcc7f4c4d12aa70964410865f73993031595955
5
5
  SHA512:
6
- metadata.gz: 46d607c3b55f54dca6f5770577f0a92ec5ede81efc8fbf43ca8bdf26ec2ac7753080e27c0601899d64e15aa85574576269a1e6f034a8144c09fa76be49977840
7
- data.tar.gz: 6a84ff0d56e26954af4360dd54b76faf21173ad5250005bfcd3207316b57e35afe96ad3329196d56522c6c8db911ba3d3a42e69641a352a87df07b615dd38de3
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 iterations=10000"
29
- - "TASK=bench slow=1 iterations=1000"
28
+ - "TASK=bench"
29
+ - "TASK=bench slow=1"
30
30
 
31
31
  matrix:
32
32
  exclude:
data/Gemfile CHANGED
@@ -48,6 +48,7 @@ gem 'asciidoctor'
48
48
  gem 'org-ruby'
49
49
 
50
50
  if ENV['TASK'] == 'bench'
51
+ gem 'benchmark-ips'
51
52
  gem 'erubis'
52
53
  gem 'haml'
53
54
  end
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 iterations=1000)'
10
- task :bench, :iterations, :slow do
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, iterations)
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
- puts "#{@iterations} Iterations"
94
- Benchmark.bmbm do |x|
92
+ Benchmark.ips do |x|
95
93
  @benches.each do |name, block|
96
- x.report name.to_s do
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'], ENV['iterations']).run
122
+ SlimBenchmarks.new(ENV['slow']).run
data/lib/slim/engine.rb CHANGED
@@ -31,7 +31,6 @@ module Slim
31
31
  filter :ControlFlow
32
32
  filter :MultiFlattener
33
33
  filter :StaticMerger
34
- filter :StaticFreezer
35
34
  use :Generator do
36
35
  options[:generator].new(options.to_hash.reject {|k,v| !options[:generator].options.valid_key?(k) })
37
36
  end
@@ -8,8 +8,7 @@ module Slim
8
8
  #
9
9
  # @api public
10
10
  class ERBConverter < Engine
11
- remove :StaticMerger
12
- replace :StaticFreezer, Temple::Filters::CodeMerger
11
+ replace :StaticMerger, Temple::Filters::CodeMerger
13
12
  replace :Generator, Temple::Generators::ERB
14
13
  end
15
14
  end
data/lib/slim/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Slim
2
2
  # Slim version string
3
3
  # @api public
4
- VERSION = '3.0.0.beta.2'
4
+ VERSION = '3.0.0.beta.3'
5
5
  end
data/slim.gemspec CHANGED
@@ -20,6 +20,6 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.required_ruby_version = '>=1.9.2'
22
22
 
23
- s.add_runtime_dependency('temple', ['~> 0.7.1'])
23
+ s.add_runtime_dependency('temple', ['~> 0.7.2'])
24
24
  s.add_runtime_dependency('tilt', ['>= 1.3.3', '< 2.1'])
25
25
  end
@@ -31,36 +31,36 @@ html
31
31
  p= "dynamic text with\nnewline"
32
32
  }
33
33
 
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>}
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.2
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-04 00:00:00.000000000 Z
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.1
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.1
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: