<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet.git/spec/lib, branch master</title>
<subtitle>Puppet repo</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/'/>
<entry>
<title>Consolidate test logic determining if a registered file is in the temp directory</title>
<updated>2011-08-02T23:33:47+00:00</updated>
<author>
<name>Jacob Helwig</name>
<email>jacob@puppetlabs.com</email>
</author>
<published>2011-08-02T17:46:53+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=3aec02ba0e4bda8ba4e9fffbc6defaae4e4e2ba1'/>
<id>3aec02ba0e4bda8ba4e9fffbc6defaae4e4e2ba1</id>
<content type='text'>
Previously, we were always using string comparisons, and hard-coded
paths to temp locations on non-Windows platforms.  This was
problematic for a few reasons.  We had to maintain a list of temp
locations for the various platforms, and the string comparisons were
unreliable on Windows, since paths have two string representations
(the "short" name containing a ~ followed by a number, and the "full"
name).

By getting the current temp location using Dir.tempdir (the same
mechanism our temp creation code uses), we no longer need to maintain
the list of temp locations.  Also, rather than doing string
comparisons on file paths, we can use a combination of
Pathname#ascend, and File.identical? to determine if the path
registered as a temp file for deletion was actually created in the
temp location.

With this refactoring, the same code now works for both Windows, and
non-Windows platforms.

Reviewed-by: Nick Lewis &lt;nick@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, we were always using string comparisons, and hard-coded
paths to temp locations on non-Windows platforms.  This was
problematic for a few reasons.  We had to maintain a list of temp
locations for the various platforms, and the string comparisons were
unreliable on Windows, since paths have two string representations
(the "short" name containing a ~ followed by a number, and the "full"
name).

By getting the current temp location using Dir.tempdir (the same
mechanism our temp creation code uses), we no longer need to maintain
the list of temp locations.  Also, rather than doing string
comparisons on file paths, we can use a combination of
Pathname#ascend, and File.identical? to determine if the path
registered as a temp file for deletion was actually created in the
temp location.

With this refactoring, the same code now works for both Windows, and
non-Windows platforms.

Reviewed-by: Nick Lewis &lt;nick@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch '2.7.x'</title>
<updated>2011-07-26T00:02:24+00:00</updated>
<author>
<name>Nick Lewis</name>
<email>nick@puppetlabs.com</email>
</author>
<published>2011-07-26T00:02:24+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=b13427b56d8529731d0334d420b24a592ecb43ea'/>
<id>b13427b56d8529731d0334d420b24a592ecb43ea</id>
<content type='text'>
Conflicts:
	lib/puppet/type/file/source.rb
	spec/unit/resource/catalog_spec.rb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	lib/puppet/type/file/source.rb
	spec/unit/resource/catalog_spec.rb
</pre>
</div>
</content>
</entry>
<entry>
<title>maint: Fix Face testing bug 1.9.2 revealed.</title>
<updated>2011-07-25T18:06:58+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-25T18:06:58+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=d522b0b824285d025884ff271cda957df1c9951d'/>
<id>d522b0b824285d025884ff271cda957df1c9951d</id>
<content type='text'>
Ruby 1.8.7 is fairly lax about various bits of introspection, including that
we can't tell much about what arguments a block takes.  Ruby 1.9.2 makes it
possible to do this, though.

Meanwhile, the Faces system uses this to make sure that scripts and actions
take the right set of arguments, to avoid surprises: failing early and
explicitly is better than failing at runtime.

Which, in final turn, exposes that I forgot to accept the right arguments in a
couple of my testing actions for Faces, but didn't notice because 1.8.7
doesn't check that, and I didn't test on 1.9.2.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ruby 1.8.7 is fairly lax about various bits of introspection, including that
we can't tell much about what arguments a block takes.  Ruby 1.9.2 makes it
possible to do this, though.

Meanwhile, the Faces system uses this to make sure that scripts and actions
take the right set of arguments, to avoid surprises: failing early and
explicitly is better than failing at runtime.

Which, in final turn, exposes that I forgot to accept the right arguments in a
couple of my testing actions for Faces, but didn't notice because 1.8.7
doesn't check that, and I didn't test on 1.9.2.
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7184) Load the core of obsolete versions of Faces.</title>
<updated>2011-07-22T20:29:32+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-21T23:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=532c4f37e4f8289cf4a9871ebc0cb5086c2ba26a'/>
<id>532c4f37e4f8289cf4a9871ebc0cb5086c2ba26a</id>
<content type='text'>
When we define an action on an older version of a Face, we must be sure to
directly load the core of that version, not just define it with the external
Action(s) that it had.

Otherwise we break our contract, which is that any core Actions for a specific
version will be available to your external Action for as long as we support
that core version.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we define an action on an older version of a Face, we must be sure to
directly load the core of that version, not just define it with the external
Action(s) that it had.

Otherwise we break our contract, which is that any core Actions for a specific
version will be available to your external Action for as long as we support
that core version.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7184) Find actions bound to other versions of Faces.</title>
<updated>2011-07-22T20:29:29+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-07-21T23:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=2cd3bc47993fbd32a77ca9dfdd51353f2dfbcb58'/>
<id>2cd3bc47993fbd32a77ca9dfdd51353f2dfbcb58</id>
<content type='text'>
When we first touch a Face, we load all the available Actions from disk.

Given they define themselves against a specific version of a Face, they are
automatically available tied to the correct version; this makes it trivially
possible to locate those on demand and return them.

Now, we have the ability to find and, consequently, invoke Actions on older
versions of Faces.  We don't load enough context, though: the older face will
only have external Actions defined, not anything core.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we first touch a Face, we load all the available Actions from disk.

Given they define themselves against a specific version of a Face, they are
automatically available tied to the correct version; this makes it trivially
possible to locate those on demand and return them.

Now, we have the ability to find and, consequently, invoke Actions on older
versions of Faces.  We don't load enough context, though: the older face will
only have external Actions defined, not anything core.

Reviewed-By: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix tests with "relative" paths on Windows</title>
<updated>2011-07-19T21:06:36+00:00</updated>
<author>
<name>Josh Cooper</name>
<email>josh@puppetlabs.com</email>
</author>
<published>2011-07-19T06:05:35+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=462a95e3d077b1915a919399b846068816c84583'/>
<id>462a95e3d077b1915a919399b846068816c84583</id>
<content type='text'>
Absolute paths on Unix, e.g. /foo/bar, are not absolute on Windows,
which breaks many test cases. This commit adds a method to
PuppetSpec::Files.make_absolute that makes the path absolute in
test cases.

On Unix (Puppet.features.posix?) it is a no-op. On Windows,
(Puppet.features.microsoft_windows?) the drive from the current
 working directory is prepended.

Reviewed-by: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Absolute paths on Unix, e.g. /foo/bar, are not absolute on Windows,
which breaks many test cases. This commit adds a method to
PuppetSpec::Files.make_absolute that makes the path absolute in
test cases.

On Unix (Puppet.features.posix?) it is a no-op. On Windows,
(Puppet.features.microsoft_windows?) the drive from the current
 working directory is prepended.

Reviewed-by: Jacob Helwig &lt;jacob@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>#7211: more helpful error messages in various cases.</title>
<updated>2011-05-31T22:26:41+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-05-31T22:02:41+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=618495c7b70671ff1da1653c76d1524ff3f615b7'/>
<id>618495c7b70671ff1da1653c76d1524ff3f615b7</id>
<content type='text'>
We were emitting a bunch of unhelpful failure messages, surrounding invalid
actions and especially default actions interacting with the command-line.

This cleans those up, to give a helpful, informative, and correct message in
all cases.  Notably, we no longer report that there is no "default" action
when you specify an unknown action on a face.

This change revealed some other weaknesses in our unit tests, now correctly,
that result in slightly more robust code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were emitting a bunch of unhelpful failure messages, surrounding invalid
actions and especially default actions interacting with the command-line.

This cleans those up, to give a helpful, informative, and correct message in
all cases.  Notably, we no longer report that there is no "default" action
when you specify an unknown action on a face.

This change revealed some other weaknesses in our unit tests, now correctly,
that result in slightly more robust code.
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7291) The 'script' version of actions needs options argument</title>
<updated>2011-05-16T22:13:48+00:00</updated>
<author>
<name>Matt Robinson</name>
<email>matt@puppetlabs.com</email>
</author>
<published>2011-05-13T23:29:47+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=615946619b7121ab724fac1a3d78b8f4072b867d'/>
<id>615946619b7121ab724fac1a3d78b8f4072b867d</id>
<content type='text'>
Ruby 1.9 is stricter about arity for for arguments passed as a block.  A
test case just hadn't been updated to take this into account for Face
scripts (a simpler form of action), which isn't surprising since script
isn't used anywhere in the code, which makes it a prime candidate for
removal as far as I'm concerned, but apparently Luke wants it in there.

Reviewed-by: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ruby 1.9 is stricter about arity for for arguments passed as a block.  A
test case just hadn't been updated to take this into account for Face
scripts (a simpler form of action), which isn't surprising since script
isn't used anywhere in the code, which makes it a prime candidate for
removal as far as I'm concerned, but apparently Luke wants it in there.

Reviewed-by: Pieter van de Bruggen &lt;pieter@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7329) Consistent naming for rendering formats and hooks.</title>
<updated>2011-05-03T23:09:51+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-05-02T23:27:28+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=18b3584e16515cfc45aeaa8d0913de8e8bcb3e95'/>
<id>18b3584e16515cfc45aeaa8d0913de8e8bcb3e95</id>
<content type='text'>
We refer to rendering formats pretty consistently as `json`, `yaml`, `s`, and
so forth; unqualified names.

On the other hand, we refer to the rendering hooks *mostly* as `to_*`, except
the `:for_humans` and `:json` formats.  Which is kind of confusing because of
the internal inconsistency, and because it doesn't match the public name.

Fix the code to resolve both, so the `to_*` format still works, but we mostly
expect to use the `*` version, to match public expectation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We refer to rendering formats pretty consistently as `json`, `yaml`, `s`, and
so forth; unqualified names.

On the other hand, we refer to the rendering hooks *mostly* as `to_*`, except
the `:for_humans` and `:json` formats.  Which is kind of confusing because of
the internal inconsistency, and because it doesn't match the public name.

Fix the code to resolve both, so the `to_*` format still works, but we mostly
expect to use the `*` version, to match public expectation.
</pre>
</div>
</content>
</entry>
<entry>
<title>(#7282) action without `when_invoked` should fail...</title>
<updated>2011-05-02T17:08:26+00:00</updated>
<author>
<name>Daniel Pittman</name>
<email>daniel@puppetlabs.com</email>
</author>
<published>2011-04-30T00:24:18+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da'/>
<id>b23cc8abec1a1ec41b554b4e72f9a3c21feaf9da</id>
<content type='text'>
We used to let actions be declared without the `when_invoked` block, which was
usually a sign of either someone writing their method code direct in action
declaration, or someone forgetting to add their code at all.

This was just let silently by: the error only showed up when you finally tried
to invoke the action, and a NoMethod error was raised by the face.

...except for our own testing.  We took advantage of this a whole pile of
times in there; fixing the original UI issue means fixing all those too.

Reviewed-By: Nick Lewis &lt;nick@puppetlabs.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We used to let actions be declared without the `when_invoked` block, which was
usually a sign of either someone writing their method code direct in action
declaration, or someone forgetting to add their code at all.

This was just let silently by: the error only showed up when you finally tried
to invoke the action, and a NoMethod error was raised by the face.

...except for our own testing.  We took advantage of this a whole pile of
times in there; fixing the original UI issue means fixing all those too.

Reviewed-By: Nick Lewis &lt;nick@puppetlabs.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
