<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet.git/test/data/snippets, branch ticket/master/7841</title>
<subtitle>Puppet repo</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/'/>
<entry>
<title>Fix #2389 - Enhance Puppet DSL with Hashes</title>
<updated>2010-02-17T14:50:53+00:00</updated>
<author>
<name>Brice Figureau</name>
<email>brice-puppet@daysofwonder.com</email>
</author>
<published>2009-11-10T15:43:37+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=75c32f910ea124a938a7035b3352c11a11b57d0c'/>
<id>75c32f910ea124a938a7035b3352c11a11b57d0c</id>
<content type='text'>
This bring a new container syntax to the Puppet DSL: hashes.

Hashes are defined like Ruby Hash:
{ key1 =&gt; val1, ... }

Hash keys are strings, but hash values can be any possible right
values admitted in Puppet DSL (ie function call, variables access...)

Currently it is possible:

1) to assign hashes to variable
$myhash = { key1 =&gt; "myval", key2 =&gt; $b }

2) to access hash members (recursively) from a variable containing
a hash (works for array too):

$myhash = { key =&gt; { subkey =&gt; "b" }}
notice($myhash[key][subjey]]

3) to use hash member access as resource title

4) to use hash in default definition parameter or resource parameter if
the type supports it (known for the moment).

It is not possible to string interpolate an hash access. If it proves
to be an issue it can be added or work-arounded with a string concatenation
operator easily.

It is not possible to use an hash as a resource title. This might be
possible once we support compound resource title.

Unlike the proposed syntax in the ticket it is not possible to assign
individual hash member (mostly to respect write once nature of variable
in puppet).

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This bring a new container syntax to the Puppet DSL: hashes.

Hashes are defined like Ruby Hash:
{ key1 =&gt; val1, ... }

Hash keys are strings, but hash values can be any possible right
values admitted in Puppet DSL (ie function call, variables access...)

Currently it is possible:

1) to assign hashes to variable
$myhash = { key1 =&gt; "myval", key2 =&gt; $b }

2) to access hash members (recursively) from a variable containing
a hash (works for array too):

$myhash = { key =&gt; { subkey =&gt; "b" }}
notice($myhash[key][subjey]]

3) to use hash member access as resource title

4) to use hash in default definition parameter or resource parameter if
the type supports it (known for the moment).

It is not possible to string interpolate an hash access. If it proves
to be an issue it can be added or work-arounded with a string concatenation
operator easily.

It is not possible to use an hash as a resource title. This might be
possible once we support compound resource title.

Unlike the proposed syntax in the ticket it is not possible to assign
individual hash member (mostly to respect write once nature of variable
in puppet).

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Enhance selector and case statements to match with regexp</title>
<updated>2009-08-01T01:15:29+00:00</updated>
<author>
<name>Brice Figureau</name>
<email>brice-puppet@daysofwonder.com</email>
</author>
<published>2009-07-28T17:56:34+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=3ebf148bf3d82d25e690aec6ec49975e0837e604'/>
<id>3ebf148bf3d82d25e690aec6ec49975e0837e604</id>
<content type='text'>
The case and selector statements define ephemeral vars, like 'if'.

Usage:

case statement:
$var = "foobar"
case $var {
    "foo": {
         notify { "got a foo": }
    }
    /(.*)bar$/: {
         notify{ "hey we got a $1": }
    }
}

and for selector:
$val = $test ? {
  /^match.*$/ =&gt; "matched",
  default =&gt; "default"
}

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The case and selector statements define ephemeral vars, like 'if'.

Usage:

case statement:
$var = "foobar"
case $var {
    "foo": {
         notify { "got a foo": }
    }
    /(.*)bar$/: {
         notify{ "hey we got a $1": }
    }
}

and for selector:
$val = $test ? {
  /^match.*$/ =&gt; "matched",
  default =&gt; "default"
}

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #2033 - Allow regexp in if expression</title>
<updated>2009-08-01T01:15:29+00:00</updated>
<author>
<name>Brice Figureau</name>
<email>brice-puppet@daysofwonder.com</email>
</author>
<published>2009-07-28T17:13:54+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=ef68967f2b72e609a9d69e53771a61fd9f522149'/>
<id>ef68967f2b72e609a9d69e53771a61fd9f522149</id>
<content type='text'>
This changeset introduces regexp in if expression with the use of the
=~ (match) and !~ (not match) operator.

Usage:

if $uname =~ /Linux|Debian/ {
  ...
}

Moreover this patch creates ephemeral variables ($0 to $9) in the current
scope which contains the regex captures:
if $uname =~ /(Linux|Debian)/ {
  notice("this is a $1 system")
}

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This changeset introduces regexp in if expression with the use of the
=~ (match) and !~ (not match) operator.

Usage:

if $uname =~ /Linux|Debian/ {
  ...
}

Moreover this patch creates ephemeral variables ($0 to $9) in the current
scope which contains the regex captures:
if $uname =~ /(Linux|Debian)/ {
  notice("this is a $1 system")
}

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #2333 - Make sure lexer skip whitespace on non-token</title>
<updated>2009-06-12T12:52:29+00:00</updated>
<author>
<name>Brice Figureau</name>
<email>brice-puppet@daysofwonder.com</email>
</author>
<published>2009-06-12T11:40:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=d3323331e96cbc79563febc249e106a3ae8e7647'/>
<id>d3323331e96cbc79563febc249e106a3ae8e7647</id>
<content type='text'>
Comments and multi-line comments produces no token per-se during
lexing, so the lexer loops to find another token.
The issue was that we were not skipping whitespace after finding
such non-token.

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Comments and multi-line comments produces no token per-se during
lexing, so the lexer loops to find another token.
The issue was that we were not skipping whitespace after finding
such non-token.

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Removed extra whitespace from end of lines</title>
<updated>2009-06-05T23:12:00+00:00</updated>
<author>
<name>Ian Taylor</name>
<email>ian@lorf.org</email>
</author>
<published>2009-06-05T16:39:04+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=4f2c066a97e59a89df64af4b25beac6f3f0553c2'/>
<id>4f2c066a97e59a89df64af4b25beac6f3f0553c2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Changed tabs to spaces without interfering with indentation or alignment</title>
<updated>2009-06-05T23:11:28+00:00</updated>
<author>
<name>Ian Taylor</name>
<email>ian@lorf.org</email>
</author>
<published>2009-06-05T16:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=41ce18cc8ea239d1633fc6cd9e9f599957a82e74'/>
<id>41ce18cc8ea239d1633fc6cd9e9f599957a82e74</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #1088 - part2 - Add rspec tests</title>
<updated>2009-03-14T00:31:29+00:00</updated>
<author>
<name>Brice Figureau</name>
<email>brice-puppet@daysofwonder.com</email>
</author>
<published>2008-11-29T16:41:45+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=af4455e31df403c55a5db06ee8d0d4e0e58c4154'/>
<id>af4455e31df403c55a5db06ee8d0d4e0e58c4154</id>
<content type='text'>
Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #1402 - Allow multiline comments</title>
<updated>2008-10-29T09:30:38+00:00</updated>
<author>
<name>Brice Figureau</name>
<email>brice-puppet@daysofwonder.com</email>
</author>
<published>2008-10-28T13:17:12+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=2d37f09aa093b10cb64b9b649f0066217c53d48f'/>
<id>2d37f09aa093b10cb64b9b649f0066217c53d48f</id>
<content type='text'>
Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #857 - Multiple class of the same name don't append code</title>
<updated>2008-10-29T09:28:32+00:00</updated>
<author>
<name>Brice Figureau</name>
<email>brice-puppet@daysofwonder.com</email>
</author>
<published>2008-10-28T13:15:08+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=9f30306d2c768bad3327ecb7748669afb10cd4aa'/>
<id>9f30306d2c768bad3327ecb7748669afb10cd4aa</id>
<content type='text'>
The following manifest wasn't working:
class one {
notice('class one')
}

class one {
notice('second class one')
}

include one

It all boiled down to class code not being arrays.
Encapsulating code in ASTArray when needed is enough to append code,
because of the property of ASTArray to evaluate all their members in
turn.

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following manifest wasn't working:
class one {
notice('class one')
}

class one {
notice('second class one')
}

include one

It all boiled down to class code not being arrays.
Encapsulating code in ASTArray when needed is enough to append code,
because of the property of ASTArray to evaluate all their members in
turn.

Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #936 - Allow trailing comma in array definition</title>
<updated>2008-10-21T10:15:53+00:00</updated>
<author>
<name>Brice Figureau</name>
<email>brice-puppet@daysofwonder.com</email>
</author>
<published>2008-10-16T20:02:37+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ricky/public_git/puppet.git/commit/?id=6d05cbc1e1a22d4316e18fb22d5cff9c7a42d3cf'/>
<id>6d05cbc1e1a22d4316e18fb22d5cff9c7a42d3cf</id>
<content type='text'>
Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Brice Figureau &lt;brice-puppet@daysofwonder.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
