| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"Invisible glob", or "prefix", version matching means that when you specify a
version string to use you can specify as little as one version number out of
the semantic versioning spec.
Matching is done on the prefix; an omitted number is treated as "anything" in
that slot, and we return the highest matching versioned face by that spec.
For example, given the set of versions: 1.0.0, 1.0.1, 1.1.0, 1.1.1, 2.0.0
The following would be matched:
input matched
1 1.1.1
1.0 1.0.1
1.0.1 1.0.1
1.0.2 fail - no match
1.1 1.1.1
1.1.1 1.1.1
1.2 fail - no match
|
|
|
|
|
|
|
|
|
|
| |
We used to flush the loaded face cache, but not the list of 'require' things,
which meant that these tests couldn't work with anything outside their own
setup, which is actually pretty undesirable.
Instead, port the code from the face_collection spec that handles this in a
way that makes me less inclined to weep, and which lets the surrounding code
work as designed.
|
|\
| |
| |
| | |
Fix the conflicts over changes in my previous commit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now we want to support action-based rendering, it is super-hard to define the
semantics around defaulting where things are unspecified: the execution
context (CLI, HTTP, etc) vs the face, vs the action all have different
semantics.
Without solving the problem of how we express all that context and those
semantics down in the action, especially one written by a third party, this
just becomes a box of counter-intuitive and annoying semantics and edge-cases.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| | |
This adds the 'description' method to the faces and actions, as well as
structured testing to ensure that the DSL works as expected.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|/
|
|
|
|
|
|
|
| |
Our summary documentation is used to provide single-line context to faces,
actions, and other items. To support this we hard-fail if someone tries to
use the summary to embed the long documentation, and point them to the right
place to add the extended text.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We implemented the naive version of inheritance in the faces, in which an
action declared on a superclass remains bound to that even when accessed
from a subclass.
As a consequence our visibility of options on inherited classes is actually
much more limited than it should be, and the actions we inherit would never
see the options they should correctly have.
To fix this we correct the binding bug and handle lookup correctly over
inheritance in our code.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
|
|
|
|
|
|
|
| |
After some discussion we decided that most uses of the Puppet Face
infrastructure were about single faces on their own, not about the collection,
and so we were better referring to Puppet::Face[...] in code.
This implements that by translating names and references in the Ruby code to
the new, s-less, name.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the methods to the summary builder and runtime instance to support
setting and getting a summary of the face. This is a short description used
to summarize the purpose of the face in help output.
For example, from the help face:
"Displays help about puppet subcommands"
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
|
|
|
| |
We didn't do much testing here, which was vaguely reasonable when we didn't
distinguish it from the #define method. Now they are split out we need to be
more careful about testing the right things.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that mocking require on objects can cause random "stack depth
exceeded" failures, usually triggered by otherwise innocent changes to load
order or the use of require in the rest of the code.
Disable the currently failing test, which needs rewriting, and let it go for
now. We need to systematically purge these problems once the build is stable.
Paired-With: Dan Bode <dan@puppetlabs.com>
|
|
|
|
|
|
|
|
|
| |
This splits out the plumbing into the Puppet::Interface namespace, and uses
Puppet::Faces for all the public-facing code.
The fault line is "what you care about if you are using or writing a face",
which is public, against "what you care about to enable either of those two",
which is the plumbing.
|
|
|
|
|
|
|
| |
Now that we have settled on the final public name for the API,
"Puppet::String", mass-rename and mass-edit all the files to follow.
Reviewed-By: Randall Hansen <randall@puppetlabs.com>
|
|
|
|
|
|
|
|
|
| |
Specifying a version of `:latest` will find the most recent version of the
named interface installed in your RUBYLIB, and attempt to load that. This is
unlikely to provide a stable dependency in the future, so should be used
sparingly, acknowledging the dangers.
Reviewed-By: Daniel Pittman
|
|
|
|
|
|
|
|
|
| |
P::I#initialize now takes a name and a version (and an optional block). The
options hash has been removed, though it may be reintroduced if a legitimate
use case can be made for it (so far, it's only been used for the version
number).
Reviewed-By: Jacob Helwig
|
|
|
|
|
|
|
| |
Puppet::Interface::interface is now Puppet::Interface::define, also aliased to
Puppet::Interface::[] for convenience.
Paired-With: Nick Lewis
|
|
|
|
|
|
| |
More information about the versioning scheme can be found at http://semver.org.
Paired-With: Nick Lewis
|
|
|
|
| |
Reviewed-By: Nick Lewis
|
|
|
|
|
|
|
|
|
|
|
| |
Having an instance variable on class Interface is insufficient for
Interface::Indirector. This also changes the semantics of "Interface.interface"
to handle registration and loading actions, and for "Interface.new" to only
instantiate an Interface. Thus, consumers of the API should typically use
"Interface.interface", unless they have reasons to not want an interface
automatically registered.
Paired-With: Pieter van de Bruggen
|
|
|
|
|
|
|
|
|
|
|
| |
Ruby's namespace mechanism introduced a number of problems, including
incorrect name resolution for common and simple cases. Given that,
we've refactored back to class-level data structures with accessor
methods available.
The current method names are unlikely to be the final UI.
Reviewed-By: Daniel Pittman
|
|
|
|
| |
Reviewed-By: Nick Lewis
|
|
|
|
|
|
|
|
| |
We didn't do enough input checking and sanitization, and missed some
edge-cases for naming interfaces. This adds testing, and cleans up some edge
cases to handle things better.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
|
|
|
|
|
|
| |
Since constants are already being defined for each
interface, the #interface method does little but
provide another way to access the same data.
Reviewed-By: Nick Lewis
|
|
|
|
|
|
|
|
|
| |
I renamed it to 'info', too.
It only showed indirector-related info, so this
makes sense.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
| |
Also added a test to hopefully confirm it won't
break again.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
They were previously classes, which made a lot of things stupider
than they needed to be.
This will likely involve some porting, but not much.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|