Class: Bridgetown::Builder

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

Overview

Superclass for a website’s SiteBuilder abstract class

Direct Known Subclasses

SiteBuilder

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

#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

Methods included from Prioritizable

#<=>, included

Constructor Details

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

Class Method Details

.after_buildObject



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

def after_build(...)
  set_callback(:build, :after, ...)
end

.around_buildObject



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

def around_build(...)
  set_callback(:build, :around, ...)
end

.before_buildObject



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

def before_build(...)
  set_callback(:build, :before, ...)
end

.descendantsObject



38
39
40
41
# File 'bridgetown-builder/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 'bridgetown-builder/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 'bridgetown-builder/lib/bridgetown-builder/builder.rb', line 29

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

#inspectObject



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

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