skim 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # master
2
2
 
3
+ # 0.9.2
4
+
5
+ * Performance improvements
6
+
3
7
  # 0.9.1
4
8
 
5
9
  * Fix 'SyntaxError: unexpected LOGIC' bug (#30)
data/lib/skim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Skim
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
@@ -7,10 +7,7 @@ module Temple
7
7
 
8
8
  def call(exp)
9
9
  @indent = options[:indent]
10
- compile [:multi,
11
- [:code, "#{buffer} = []"],
12
- exp,
13
- [:code, "#{buffer}.join('')"]]
10
+ compile [:multi, [:code, "#{buffer} = ''"], exp, [:code, "#{buffer}"]]
14
11
  end
15
12
 
16
13
  def on_multi(*exp)
@@ -41,7 +38,7 @@ module Temple
41
38
  end
42
39
 
43
40
  def concat(str)
44
- indent("#{buffer}.push(#{str})")
41
+ indent "#{buffer} += #{str}"
45
42
  end
46
43
 
47
44
  def indent(str, indent = @indent)
@@ -66,6 +66,15 @@ p
66
66
  assert_html '<p>Hey!Hey!Hey!</p>', source
67
67
  end
68
68
 
69
+ def test_render_with_control_code_for_in_loop_without_parent
70
+ source = %q{
71
+ - for i in [0..2]
72
+ p Hey!
73
+ }
74
+
75
+ assert_html '<p>Hey!</p><p>Hey!</p><p>Hey!</p>', source
76
+ end
77
+
69
78
  def test_render_with_control_code_for_own_of_loop
70
79
  source = %q{
71
80
  p
@@ -35,8 +35,10 @@ this.Skim =
35
35
 
36
36
  context.escape ||= @escape || (string) ->
37
37
  return '' unless string?
38
- return string if string.skimSafe
39
- @safe (''+string)
38
+ if string.skimSafe or not /[&<>\"]/.test(string)
39
+ return string
40
+
41
+ @safe ('' + string)
40
42
  .replace(/&/g, '&amp;')
41
43
  .replace(/</g, '&lt;')
42
44
  .replace(/>/g, '&gt;')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-02 00:00:00.000000000 Z
12
+ date: 2013-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: slim