octopress-ink 1.0.0.alpha.25 → 1.0.0.alpha.26

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: de4dedafd926d2d6222ffd41be255ff2c003e0eb
4
- data.tar.gz: c9fa39b81fd8226df9d1184596760e1c232f719b
3
+ metadata.gz: 4041475a8dfd1d7a88ed97361bcff4f2afa13a70
4
+ data.tar.gz: 8b31fd6fdfc677127555bbec33d09474cb61699d
5
5
  SHA512:
6
- metadata.gz: cce34cf01f0ba29e84a53839d8e4ad8d44d44b3ca2528c942f5c06dfa58405e0207c9f9f8d068d50f3fc168255d07bb225ffa3e9168ff0ca51592e3f1f5018b3
7
- data.tar.gz: 2e46aed362277f732cc98ef8bded455359cda4527a6a9c6312c80cd83aa3e302d5e9d89b04bcafe8378f28eff7cc4c25502e19ff76c2a336f3a234d84d14f965
6
+ metadata.gz: e596f3368053dd56fc975e28f9956c488f6d4f58a681843cfbe266812031cf50c9aaf1dea6efeb18310411d546c49abe87942b7070ba4afc9ddba92c764bfe72
7
+ data.tar.gz: f05b1701b00b5737e7dc9003bd2c78f56ffca5916ed0f14d94444f1f6bb3a5f9d64a0117ac587770dac098b97ce837847c2b878fc9ec5cd3aecd78f59ae88a7c
@@ -3,7 +3,7 @@
3
3
  module Octopress
4
4
  module Tags
5
5
  class WrapTag < Liquid::Block
6
- HAS_YIELD = /(.*?)({=\s*yield\s*})(.*)/im
6
+
7
7
  def initialize(tag_name, markup, tokens)
8
8
  super
9
9
  @og_markup = @markup = markup
@@ -11,6 +11,7 @@ module Octopress
11
11
  end
12
12
 
13
13
  def render(context)
14
+ require 'pry-debugger'
14
15
  markup = Helpers::Conditional.parse(@markup, context)
15
16
  return unless markup
16
17
 
@@ -31,13 +32,8 @@ module Octopress
31
32
  end
32
33
  end
33
34
 
34
- wrap = super.strip
35
-
36
- if wrap =~ HAS_YIELD && content != ''
37
- $1 + content + $3
38
- else
39
- ''
40
- end
35
+ context.scopes.first['yield'] = content
36
+ super.strip
41
37
  end
42
38
 
43
39
  def error_msg(error)
@@ -5,6 +5,10 @@ module Octopress
5
5
  class YieldTag < Liquid::Tag
6
6
 
7
7
  def initialize(tag_name, markup, tokens)
8
+ if markup.strip == ''
9
+ raise IOError.new "Yield failed: {% #{tag_name} #{markup}%}. Please provide a block name to yield. - Syntax: {% yield block_name %}"
10
+ end
11
+
8
12
  super
9
13
  @markup = markup
10
14
  if markup =~ Helpers::Var::HAS_FILTERS
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.alpha.25"
3
+ VERSION = "1.0.0.alpha.26"
4
4
  end
5
5
  end
@@ -4,28 +4,28 @@ layout: nil
4
4
  {% assign some_bool = true %}
5
5
 
6
6
  ## Testing a simple wrap
7
- [- Testing Include -] → {% wrap foo.html %}[- {=yield} -]{% endwrap %}
7
+ [- Testing Include -] → {% wrap foo.html %}[- {{ yield }} -]{% endwrap %}
8
8
 
9
9
  ## Local var passing
10
- [- Testing Include var_test -] → {% wrap foo.html some_var="var_test" %}[- {=yield} -]{% endwrap %}
10
+ [- Testing Include var_test -] → {% wrap foo.html some_var="var_test" %}[- {{ yield }} -]{% endwrap %}
11
11
 
12
12
  ## Filter testing
13
- [- TESTING INCLUDE -] → {% wrap foo.html | upcase %}[- {=yield} -]{% endwrap %}
14
- [- TESTING FILTERS -] → {% wrap foo.html | replace:"Include","Filters" | upcase | %}[- {=yield} -]{% endwrap %}
13
+ [- TESTING INCLUDE -] → {% wrap foo.html | upcase %}[- {% assign foo = 'bar' %}{{ yield }} -]{% endwrap %}
14
+ [- TESTING FILTERS -] → {% wrap foo.html | replace:"Include","Filters" | upcase | %}[- {{ yield }} -]{% endwrap %}
15
15
 
16
16
  ## Conditional wrap
17
- '' → '{% wrap foo.html unless true %}[- {=yield} -]{% endwrap %}'
18
- '' → '{% wrap foo.html unless some_bool %}[- {=yield} -]{% endwrap %}'
19
- [- Testing Include -] → {% wrap foo.html if true %}[- {=yield} -]{% endwrap %}
20
- [- Testing Include -] → {% wrap foo.html if some_bool %}[- {=yield} -]{% endwrap %}
17
+ '' → '{% wrap foo.html unless true %}[- {{ yield }} -]{% endwrap %}'
18
+ '' → '{% wrap foo.html unless some_bool %}[- {{ yield }} -]{% endwrap %}'
19
+ [- Testing Include -] → {% wrap foo.html if true %}[- {{ yield }} -]{% endwrap %}
20
+ [- Testing Include -] → {% wrap foo.html if some_bool %}[- {{ yield }} -]{% endwrap %}
21
21
 
22
22
  ## Plugin wraps
23
- [- include from plugin -] → {% wrap awesome-sauce:some-include.html %}[- {=yield} -]{% endwrap %}
24
- [- Yo Dawg, I heard you like includes. -] → {% wrap theme:greet.html greeting="Yo Dawg" %}[- {=yield} -]{% endwrap %}
23
+ [- include from plugin -] → {% wrap awesome-sauce:some-include.html %}[- {{ yield }} -]{% endwrap %}
24
+ [- Yo Dawg, I heard you like includes. -] → {% wrap theme:greet.html greeting="Yo Dawg" %}[- {{ yield }} -]{% endwrap %}
25
25
 
26
26
  ## Wrap render
27
- [- Testing Render -] → {% wrap_render test_render/_f.html %}[- {=yield} -]{% endwrap_render %}
27
+ [- Testing Render -] → {% wrap_render test_render/_f.html %}[- {{ yield }} -]{% endwrap_render %}
28
28
 
29
29
  ## Wrap yield
30
30
  {% content_for test %}Testing wrap yield{% endcontent_for %}
31
- [- Testing wrap yield -] → {% wrap_yield test %}[- {= yield } -]{% endwrap_yield %}
31
+ [- Testing wrap yield -] → {% wrap_yield test %}[- {{ yield }} -]{% endwrap_yield %}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-ink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.25
4
+ version: 1.0.0.alpha.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2014-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll