$ cat /Users/peterhuene/.puppetlabs/etc/code/environments/production/modules/foo/lib/puppet/type/foo.rb
Puppet::Type.newtype(:foo) do
newparam(:name) do
end
end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: heapster | |
namespace: kube-system | |
--- | |
kind: ClusterRoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
metadata: | |
name: heapster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <boost/spirit/home/x3.hpp> | |
#include <boost/fusion/include/std_pair.hpp> | |
using namespace std; | |
namespace x3 = boost::spirit::x3; | |
struct repro_string_parser : x3::parser<repro_string_parser> | |
{ |
Puppet function in Ruby:
$ cat /Users/peterhuene/.puppetlabs/etc/code/environments/production/modules/foo/lib/puppet/functions/foo.rb
Puppet::Functions.create_function(:foo) do
dispatch :foo do
param 'Numeric', :a
param 'String', :b
block_param
end
$ cat ~/.puppetlabs/etc/code/environments/production/modules/foo/lib/puppet/functions/foo.rb
Puppet::Functions.create_function(:foo) do
dispatch :foo do
param 'Numeric', :a
param 'String', :b
block_param
end
def foo(a, b)
$ cat ~/.puppetlabs/etc/code/environments/production/modules/foo/lib/puppet/functions/foo.rb
Puppet::Functions.create_function(:foo) do
dispatch :foo do
param 'Numeric', :a
param 'String', :b
end
def foo(a, b)
a + b.to_i
Before:
Error: Evaluation Error: Error while evaluating a Function Call, inline_epp(): Invalid EPP: Syntax error at '=>' at line 1:34 at /Users/peterhuene/.puppetlabs/etc/code/environments/production/manifests/site.pp:1:1 on node peterhu-osx
Error: Failed to compile catalog for node peterhu-osx: Evaluation Error: Error while evaluating a Function Call, inline_epp(): Invalid EPP: Syntax error at '=>' at line 1:34 at /Users/peterhuene/.puppetlabs/etc/code/environments/production/manifests/site.pp:1:1 on node peterhu-osx
After:
I hereby claim:
- I am peterhuene on github.
- I am peterhuene (https://keybase.io/peterhuene) on keybase.
- I have a public key whose fingerprint is 9B4D A4C4 989D 9F61 4F69 0757 1142 73C2 D90F BA06
To claim this, I am signing this object:
NewerOlder