Class: Bridgetown::Builder

Inherits:
Bridgetown::Builders::PluginBuilder show all
Extended by:
ActiveSupport::DescendantsTracker
Includes:
ActiveSupport::Callbacks
Defined in:
lib/bridgetown-builder/builder.rb

Overview

Superclass for a website’s SiteBuilder abstract class

Instance Attribute Summary

Attributes inherited from Bridgetown::Builders::PluginBuilder

#config, #functions, #name, #site

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Bridgetown::Builders::PluginBuilder

#doc, #initialize, plugin_registrations

Methods included from Bridgetown::Builders::DSL::Resources

#add_resource, #define_resource_method, #permalink_placeholder, #placeholder_processors, #resource

Methods included from Bridgetown::Builders::DSL::Liquid

#filters, #filters_context, #liquid_filter, #liquid_tag

Methods included from Bridgetown::Builders::DSL::HTTP

#connection, #get

Methods included from Bridgetown::Builders::DSL::Inspectors

#inspect_html, #inspect_xml, process_html, process_xml, setup_nokogiri, setup_nokolexbor

Methods included from Bridgetown::Builders::DSL::Hooks

#add_data, #hook

Methods included from Bridgetown::Builders::DSL::Helpers

#helper, #helpers

Methods included from Bridgetown::Builders::DSL::Generators

#generator

Constructor Details

This class inherits a constructor from Bridgetown::Builders::PluginBuilder

Class Method Details

.after_build(*args, **kwargs, &block) ⇒ Object



20
21
22
# File 'lib/bridgetown-builder/builder.rb', line 20

def after_build(*args, **kwargs, &block)
  set_callback :build, :after, *args, **kwargs, &block
end

.around_build(*args, **kwargs, &block) ⇒ Object



24
25
26
# File 'lib/bridgetown-builder/builder.rb', line 24

def around_build(*args, **kwargs, &block)
  set_callback :build, :around, *args, **kwargs, &block
end

.before_build(*args, **kwargs, &block) ⇒ Object



16
17
18
# File 'lib/bridgetown-builder/builder.rb', line 16

def before_build(*args, **kwargs, &block)
  set_callback :build, :before, *args, **kwargs, &block
end

.descendantsObject



38
39
40
41
# File 'lib/bridgetown-builder/builder.rb', line 38

def self.descendants
  site_builder_name = "SiteBuilder"
  super.reject { |klass| [site_builder_name].include?(klass.name) }
end

.registerObject



12
13
14
# File 'lib/bridgetown-builder/builder.rb', line 12

def register
  Bridgetown::Builders::PluginBuilder.plugin_registrations << self
end

Instance Method Details

#build_with_callbacksObject



29
30
31
32
# File 'lib/bridgetown-builder/builder.rb', line 29

def build_with_callbacks
  run_callbacks(:build) { build }
  self
end

#inspectObject



34
35
36
# File 'lib/bridgetown-builder/builder.rb', line 34

def inspect
  "#<#{name}>"
end