sigmund_liquid 1.0.9 → 1.0.10

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDQxOWRkYWI4MjdmMGZiNjAzNzhmNjliYzFiN2Q1MjI4ZTBiYTgxNw==
4
+ MTE2ZDcyZGJlMjMxOTEwM2JkY2YzNjlhNTJkNDEyNGMyY2JkN2U1Nw==
5
5
  data.tar.gz: !binary |-
6
- MzMxNGYyN2YwNDc1NTIwN2YyM2QwZWU4ZDNhZWYwZTIzMTcwNmUzOA==
6
+ MjBlM2E3Y2Y5ZjUxZjZmNDYwNmYxOWNkNTJlYTJlODg0MGFhOGQ5OA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZTMzZTZmMDY3MGZkZGEwYWZlNzgwZDJhNGUxNDc4YWVhMmYwMjA1OWFjMjFj
10
- OWNhY2IzZTUwYTNkYjI5MDg4MGQyYmNjODYxZmVmZWQwMzc0YjMxOWEyMWNh
11
- MjRmMDgzZWFkNzc5NWIwYzk0OGU3ZDIzMzViMDkzNmY1NTE0Y2Y=
9
+ NGVjZWJjMDQ0NWQ3YTYyOTc5ODYzOWQ1NzI2MjNjM2RiYTUzYjMyZTEwMDk3
10
+ M2FkNGVjNTk1MTI5OGNkYTEyMDk2NzQ1MzliZjJjZWE3NGY2ZTEwNTFjMTk2
11
+ ZjEzNmZiY2E0ODM0YzUzODc0MTg5YzIyYzJkOWE2NGE4NGU0NGQ=
12
12
  data.tar.gz: !binary |-
13
- MzhlN2I3MzQ1NGQzMmVkNzhkY2UwZDMwODM4MWU3OGEzZmIwMmIwZTVmOTA0
14
- MWVkOTBhYzI5NDA5N2MyMjljMjg5NTVhNjA0NzhmN2E5NjgwNzI2ODYyNWQ1
15
- M2JhYmQ5ZDU3Y2Q0ZTljNTg5MDkzMjAyYmVhNjg3NTJjNzI0ZGM=
13
+ NTEzMWYxYTI3YjU3ZDA0Y2U4ZTNmMDI1ZjRjZjhmMDk5MTgyZmQ3Nzc3ODAy
14
+ OWRkNWQyOTg5MjNiNjI0ZTBlNTE3ZTg2ZWI0Mjk1NzQ4YjZiZTY4ZTQwYTdh
15
+ MTA2ODAzN2ZhZmU0NDI1ZDlhYzBjYzU0NmFjZTFjYmNiOWE4M2M=
@@ -7,13 +7,17 @@ module Sigmund
7
7
 
8
8
  def initialize(tag_name, markup, tokens, context)
9
9
  if markup =~ Syntax
10
- @options = { id: 'nav', depth: 1, class: '', active_class: 'active'}
11
- markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/"|'/, '') }
12
- @options[:exclude] = Regexp.new(@options[:exclude]) if @options[:exclude]
13
-
14
- if @options[:snippet]
15
- template = @options[:snippet].include?('{') ? @options[:snippet] : context[:site].snippets.where(slug: @options[:snippet] ).try(:first).try(:template)
16
- @options[:liquid_render] = ::Liquid::Template.parse(template) unless template.blank?
10
+ begin
11
+ @options = { id: 'nav', depth: 1, class: '', active_class: 'active'}
12
+ markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/"|'/, '') }
13
+ @options[:exclude] = Regexp.new(@options[:exclude]) if @options[:exclude]
14
+
15
+ if @options[:snippet]
16
+ template = @options[:snippet].include?('{') ? @options[:snippet] : context[:site].snippets.where(slug: @options[:snippet] ).try(:first).try(:template)
17
+ @options[:liquid_render] = ::Liquid::Template.parse(template) unless template.blank?
18
+ end
19
+ rescue
20
+ nil
17
21
  end
18
22
  else
19
23
  raise ::Liquid::SyntaxError.new("Syntax Error in 'children_nav ' - Valid syntax: children_nav <options>")
@@ -18,21 +18,24 @@ module Sigmund
18
18
 
19
19
  def initialize(tag_name, markup, tokens, context)
20
20
  if markup =~ Syntax
21
- @source = ($1 || 'page').gsub(/"|'/, '')
22
- @options = { id: 'nav', depth: 1, class: '', active_class: 'on', bootstrap: false }
23
- markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/"|'/, '') }
24
-
25
- @options[:exclude] = Regexp.new(@options[:exclude]) if @options[:exclude]
26
-
27
- @options[:add_attributes] = []
28
- if @options[:snippet]
29
- template = @options[:snippet].include?('{') ? @options[:snippet] : context[:site].snippets.where(slug: @options[:snippet] ).try(:first).try(:template)
30
- unless template.blank?
31
- @options[:liquid_render] = ::Liquid::Template.parse(template)
32
- @options[:add_attributes] = ['editable_elements']
21
+ begin
22
+ @source = ($1 || 'page').gsub(/"|'/, '')
23
+ @options = { id: 'nav', depth: 1, class: '', active_class: 'on', bootstrap: false }
24
+ markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/"|'/, '') }
25
+
26
+ @options[:exclude] = Regexp.new(@options[:exclude]) if @options[:exclude]
27
+
28
+ @options[:add_attributes] = []
29
+ if @options[:snippet]
30
+ template = @options[:snippet].include?('{') ? @options[:snippet] : context[:site].snippets.where(slug: @options[:snippet] ).try(:first).try(:template)
31
+ unless template.blank?
32
+ @options[:liquid_render] = ::Liquid::Template.parse(template)
33
+ @options[:add_attributes] = ['editable_elements']
34
+ end
33
35
  end
36
+ rescue
37
+ nil
34
38
  end
35
-
36
39
  else
37
40
  raise ::Liquid::SyntaxError.new("Syntax Error in 'nav' - Valid syntax: nav <page|site> <options>")
38
41
  end
@@ -1,5 +1,5 @@
1
1
  module Sigmund
2
2
  module Liquid
3
- VERSION = "1.0.9"
3
+ VERSION = "1.0.10"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sigmund_liquid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - amainguy