build_groups: rename to build instead of group
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
group
|
build
|
||||||
=====
|
=====
|
||||||
|
|
||||||
Establish a set of commands that can be enabled/disabled together to allow for customized builds. See :doc:`/build_groups` for ways to use this effectively.
|
Establish a set of commands that can be enabled/disabled together to allow for customized builds. See :doc:`/build_groups` for ways to use this effectively.
|
||||||
@@ -6,10 +6,14 @@ Establish a set of commands that can be enabled/disabled together to allow for c
|
|||||||
Required Arguments
|
Required Arguments
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This is an argument, not an option like most DSL methods. See example below.
|
||||||
|
|
||||||
group
|
group
|
||||||
default: ``:all``
|
default: ``:all``
|
||||||
|
|
||||||
The name of the group. Convention is to use a Ruby symbol.
|
The name of the build group. Convention is to use a Ruby symbol.
|
||||||
|
|
||||||
|
|
||||||
&block
|
&block
|
||||||
@@ -22,7 +26,7 @@ Examples
|
|||||||
Use group to organize your Squib code into build groups::
|
Use group to organize your Squib code into build groups::
|
||||||
|
|
||||||
Squib::Deck.new do
|
Squib::Deck.new do
|
||||||
group :pnp do
|
build :pnp do
|
||||||
save_pdf
|
save_pdf
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
groups
|
build_groups
|
||||||
======
|
============
|
||||||
|
|
||||||
Returns the set of group names that have been enabled. See :doc:`/build_groups` for ways to use this effectively.
|
Returns the set of group names that have been enabled. See :doc:`/build_groups` for ways to use this effectively.
|
||||||
|
|
||||||
@@ -15,9 +15,9 @@ Examples
|
|||||||
Use group to organize your Squib code into build groups::
|
Use group to organize your Squib code into build groups::
|
||||||
|
|
||||||
Squib::Deck.new do
|
Squib::Deck.new do
|
||||||
enable_group :pnp
|
enable_build :pnp
|
||||||
group :pnp do
|
build :pnp do
|
||||||
save_pdf
|
save_pdf
|
||||||
end
|
end
|
||||||
puts groups # outputs :all and :pnp
|
puts build_groups # outputs :all and :pnp
|
||||||
end
|
end
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
disable_group
|
disable_build
|
||||||
=============
|
=============
|
||||||
|
|
||||||
Disable the given build group for the rest of the build. Thus, code within the corresponding :doc:`/dsl/group` block will not be executed. See :doc:`/build_groups` for ways to use this effectively.
|
Disable the given build group for the rest of the build. Thus, code within the corresponding :doc:`/dsl/group` block will not be executed. See :doc:`/build_groups` for ways to use this effectively.
|
||||||
@@ -7,10 +7,22 @@ Disable the given build group for the rest of the build. Thus, code within the c
|
|||||||
Required Arguments
|
Required Arguments
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
group
|
build_group_name
|
||||||
|
default: ``:all``
|
||||||
the name of the group to disable. Convention is to use a Ruby symbol.
|
the name of the group to disable. Convention is to use a Ruby symbol.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
Can be used to disable a group (even if it's enabled via command line)::
|
||||||
|
|
||||||
|
Squib::Deck.new do
|
||||||
|
disable_build :pnp
|
||||||
|
build :pnp do
|
||||||
|
save_pdf
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
enable_group
|
enable_build
|
||||||
=============
|
============
|
||||||
|
|
||||||
Enable the given build group for the rest of the build. Thus, code within the corresponding :doc:`/dsl/group` block will be executed. See :doc:`/build_groups` for ways to use this effectively.
|
Enable the given build group for the rest of the build. Thus, code within the corresponding :doc:`/dsl/group` block will be executed. See :doc:`/build_groups` for ways to use this effectively.
|
||||||
|
|
||||||
@@ -7,10 +7,19 @@ Enable the given build group for the rest of the build. Thus, code within the co
|
|||||||
Required Arguments
|
Required Arguments
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
group
|
build_group_name
|
||||||
the name of the group to enable. Convention is to use a Ruby symbol.
|
the name of the group to enable. Convention is to use a Ruby symbol.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
Can be used to disable a group (even if it's enabled via command line)::
|
||||||
|
|
||||||
|
Squib::Deck.new do
|
||||||
|
disable_build :pnp
|
||||||
|
build :pnp do
|
||||||
|
save_pdf
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -13,29 +13,29 @@ module Squib
|
|||||||
class Deck
|
class Deck
|
||||||
|
|
||||||
# DSL method. See http://squib.readthedocs.org
|
# DSL method. See http://squib.readthedocs.org
|
||||||
def group grp = :all, &block
|
def build grp = :all, &block
|
||||||
raise 'Please provide a block' unless block_given?
|
raise 'Please provide a block' unless block_given?
|
||||||
block.yield if groups.include? grp
|
block.yield if groups.include? grp
|
||||||
end
|
end
|
||||||
|
|
||||||
# DSL method. See http://squib.readthedocs.org
|
# DSL method. See http://squib.readthedocs.org
|
||||||
def enable_group grp
|
def enable_build grp
|
||||||
groups # make sure it's initialized
|
build_groups # make sure it's initialized
|
||||||
@build_groups << grp
|
@build_groups << grp
|
||||||
end
|
end
|
||||||
|
|
||||||
# DSL method. See http://squib.readthedocs.org
|
# DSL method. See http://squib.readthedocs.org
|
||||||
def disable_group grp
|
def disable_build grp
|
||||||
groups # make sure it's initialized
|
build_groups # make sure it's initialized
|
||||||
@build_groups.delete grp
|
@build_groups.delete grp
|
||||||
end
|
end
|
||||||
|
|
||||||
# DSL method. See http://squib.readthedocs.org
|
# DSL method. See http://squib.readthedocs.org
|
||||||
def groups
|
def build_groups
|
||||||
@build_groups ||= Set.new.add(:all)
|
@build_groups ||= Set.new.add(:all)
|
||||||
end
|
end
|
||||||
|
|
||||||
# DSL method. See http://squib.readthedocs.org
|
# Not a DSL method, but initialized from Deck.new
|
||||||
def enable_groups_from_env!
|
def enable_groups_from_env!
|
||||||
return if ENV['SQUIB_BUILD'].nil?
|
return if ENV['SQUIB_BUILD'].nil?
|
||||||
ENV['SQUIB_BUILD'].split(',').each do |grp|
|
ENV['SQUIB_BUILD'].split(',').each do |grp|
|
||||||
|
|||||||
+1
-1
Submodule samples/build_groups updated: c58b225851...943d3871f9
Reference in New Issue
Block a user