bridgetown-builder 0.18.6 → 0.20.0

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
  SHA256:
3
- metadata.gz: c0d75ed6b31b7644966c11eadfdd5c7ec313eb245864b507592ce51822ded2c5
4
- data.tar.gz: 2ce03dd9a1f1a438e4b96ab2394566635565e126e78caed73cceaec4ede59ed1
3
+ metadata.gz: 5de4e75e44d6d399c323bd42e9515ca3a3e079b2f1f3d113e0dad7e1aceca4b1
4
+ data.tar.gz: a196d14c4f9d9a2da5d5459a749ce82b46c56a9872d2877e06343bb137f3fce0
5
5
  SHA512:
6
- metadata.gz: 3bea57f485c649d6063fdb9234946b0816d37159f7536141f842d32cb5dfd84a54126c9e748aa51ef23cf561955a5fc881bfafbb309cbbc0c317f10854168ac1
7
- data.tar.gz: ed9da6ec35cc3d3a6cda7b7b85b8d16ae39c24df45edc07beaa4ee1be3e215b35076f0be87a784203a41eb6de89a956b48b1d7862b33f1e1108a7ae7a3af0909
6
+ metadata.gz: 4795ff6e4dea9efdccbbabc482c38fb85114ac8d63940e145683257498bbd3205a8573ddfb69868104b3539917a849498cf15e7e2d4574d593490b7526645aa8
7
+ data.tar.gz: de0a86da5607451ab2032154962a308dc560d6fd925bfbfc6b08d2a9074b282f7cbaa029b983773cf407851328041c68a290342a41851549e3ca15aa3f3b1052
@@ -3,6 +3,8 @@
3
3
  module Bridgetown
4
4
  # Superclass for a website's SiteBuilder abstract class
5
5
  class Builder < Bridgetown::Builders::PluginBuilder
6
+ extend ActiveSupport::DescendantsTracker
7
+
6
8
  class << self
7
9
  def register
8
10
  Bridgetown::Hooks.register_one :site, :pre_read, reloadable: false do |site|
@@ -21,25 +23,8 @@ module Bridgetown
21
23
  name
22
24
  end
23
25
 
24
- def self.inherited(const)
25
- (@children ||= Set.new).add const
26
- catch_inheritance(const) do |const_|
27
- catch_inheritance(const_)
28
- end
29
- end
30
-
31
- def self.catch_inheritance(const)
32
- const.define_singleton_method :inherited do |const_|
33
- (@children ||= Set.new).add const_
34
- yield const_ if block_given?
35
- end
36
- end
37
-
38
26
  def self.descendants
39
- @children ||= Set.new
40
- out = @children.map(&:descendants)
41
- out << self unless ["SiteBuilder", "Bridgetown::Builder"].include?(name)
42
- Set.new(out).flatten
27
+ super.reject { |klass| ["SiteBuilder"].include?(klass.name) }
43
28
  end
44
29
  end
45
30
  end
@@ -4,16 +4,16 @@ module Bridgetown
4
4
  module Builders
5
5
  module DSL
6
6
  module Liquid
7
- def liquid_filter(filter_name, method_name = nil, &block)
7
+ def liquid_filter(filter_name, method_name = nil, filters_scope: false, &block)
8
8
  builder_self = self
9
9
  m = Module.new
10
10
 
11
- if block
11
+ if block && !filters_scope
12
12
  m.define_method filter_name do |*args|
13
13
  builder_self.instance_exec(*args, &block)
14
14
  end
15
- elsif method_name
16
- block = method(method_name)
15
+ else
16
+ block = method(method_name) if method_name
17
17
  m.define_method filter_name, &block
18
18
  end
19
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.6
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-12 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.18.6
19
+ version: 0.20.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.18.6
26
+ version: 0.20.0
27
27
  description:
28
28
  email: maintainers@bridgetownrb.com
29
29
  executables: []