clarify documentation about cloning Environments

This commit is contained in:
Josh Holtrop 2013-11-08 15:45:24 -05:00
parent d01767981c
commit 72558391a2
2 changed files with 7 additions and 7 deletions

View File

@ -127,9 +127,9 @@ An Rscons::Environment consists of:
* a collection of targets to build * a collection of targets to build
* a collection of build hooks * a collection of build hooks
When cloning an environment, the construction variables, builders, and build When cloning an environment, the construction variables and builders are
directories are cloned, but the new environment does not inherit any of the cloned, but the new environment does not inherit any of the targets, build
targets or build hooks from the source environment. hooks, build directories, or the build root from the source environment.
Cloned environments contain "deep copies" of construction variables. Cloned environments contain "deep copies" of construction variables.
For example, in: For example, in:

View File

@ -45,10 +45,10 @@ module Rscons
# Make a copy of the Environment object. # Make a copy of the Environment object.
# The cloned environment will contain a copy of all environment options, # The cloned environment will contain a copy of all environment options,
# construction variables, builders, and build directories. It will not # construction variables, and builders. It will not contain a copy of the
# contain a copy of the targets or build hooks. # targets, build hooks, build directories, or the build root. If a block
# If a block is given, the Environment object is yielded to the block and # is given, the Environment object is yielded to the block and when the
# when the block returns, the {#process} method is automatically called. # block returns, the {#process} method is automatically called.
def clone(variables = {}) def clone(variables = {})
env = Environment.new() env = Environment.new()
@builders.each do |builder_name, builder| @builders.each do |builder_name, builder|