Age | Commit message (Collapse) | Author | Files | Lines |
|
Because of the way rack servers get configured by puppet, the
application system needs to maintain any context information that is
setup while starting even after the application has exited. This is
because the rack app is created by calling the "master" application and
using the return value (which threads all the way back through the
application and command line layers) as the rack app. When the contexts
were removed on the way out of the application they also removed the
setup for how environments were loaded.
This also required that there be a way of undoing a series of context
pushes without knowing how many had been done. For this there is now a
mark and rollback capability in the Puppet::Context system. This is used
in the tests to always return to the context that was present at the
start of every test.
|
|
This makes it possible to store a Proc in the context. On lookup
the Proc is called and the result is memoized for subseqent lookups.
|
|
Puppet::Context can reduce the number of objects that it uses for
tracking contexts by keeping everything internal to it. This actually
results in much less code, but a few more instance variables to track.
Overall is seems like an easier to understand system.
|
|
One does not simply change the current environment!
This replaces use of Environment.current= and Environment.current with
Puppet::Context.lookup(:current_environment). This uncovered a lot of
assumptions about what the current environment is at various times, such
as during startup before initialization. There is now a "bootstrap"
context that is setup as soon as possible which provides a basic setup,
once initialization occures this is overridden with another context that
is able to do more.
|
|
When puppet is initialized it now also sets up a environments service so
that other parts of the code and go about their merry way.
This also changes the handling of component to work the same way as
other types so that an extra, and confusing, require isn't needed.
|
|
Rather than silently accept a root pop and return the root binding, fail
fast with a StackUnderflow exception if attempt to pop the root of
Puppet::Context.
|
|
Previous implementation exposed a bind method allowing you to add
bindings to the current context. This method has been removed. Now
every context is generated only once, either from an initial push or
override, both of which require a hash of bindings which are merged into
the parent's binding state.
|
|
Before it wasn't possible to get a value from the context that might not
have the requested binding. This adds the ability to provide a default
in the case where there is no finding for the name.
|
|
A major problem in puppet is keeping track of contextual information.
The Puppet::Indirector::Request attempts to do this, but it isn't able
to pass that information between indirector requests. This adds a
global context system, where once a value is set it cannot be changed,
but a subcontext can be created.
|