This file contains hidden or 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 <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <setjmp.h> | |
| #define TEST(name, e) printf("%s\n", name); if((result = setjmp(j)) == 0) { e; longjmp(j, 2); } else { printf("%d\n", result); }; | |
| #define ASSERT(exp, act, msg)\ | |
| if(exp != act) { printf("Failure! %s\nAt line %d\n", msg, __LINE__); longjmp(j, 1); } | |
| #define SUITE(setup, teardown, e)\ | |
| int main() { jmp_buf j; int result; setup; e; teardown; printf("!!!! All tests pass !!!!\n"); return 0; } |
This file contains hidden or 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
| // Not so much a pretty picture, but a breakdown of what AST expressions show up in forge modules (the data below is the totals across all forge module releases that I was able to parse: 8492 modules). | |
| //"expressions_per_resource" is a very rough measure of how many expressions are needed to put a single resource in the catalog. It isn't done through any kind of path analysis and so can be pretty far off, it is simply the number of ResourceExpressions divided by the total number of expressions. | |
| { | |
| "most_common_expressions": [ | |
| "Puppet::Pops::Model::QualifiedName", | |
| "Puppet::Pops::Model::LiteralString", | |
| "Puppet::Pops::Model::VariableExpression", | |
| "Puppet::Pops::Model::AttributeOperation", |
This file contains hidden or 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
| 63 <<<<<<< HEAD | |
| 64 Suggests: apache2 | nginx, puppet-el, vim-puppet, | |
| 65 ======= | |
| 66 Conflicts: puppet-common (<< 3.3.0-1puppetlabs1) | |
| 67 Suggests: apache2 | nginx, puppet-el, vim-puppet, stompserver, ruby-stomp | libstomp-ruby1.8, | |
| 68 >>>>>>> upstream/stable | |
| 69 rdoc, ruby-ldap | libldap-ruby1.8, puppetdb-terminus | |
| 70 Description: Puppet master common scripts | |
| 71 This package contains common scripts for the puppet master, | |
| 72 which is the server hosting manifests and files for the puppet nodes. |
This file contains hidden or 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
| class testing { | |
| $a = [1] | |
| } | |
| include testing | |
| $testing::a += [2] | |
| notice(inline_template('<%= @testing__a %>')) | |
| notice($testing::a) | |
| notice($a) |
This file contains hidden or 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
| > be puppet apply -e 'notice(file("load/testing"))' | |
| Notice: Scope(Class[main]): Wow! | |
| Such text! | |
| So ASCII! | |
| Notice: Compiled catalog for aparker.corp.puppetlabs.net in environment production in 0.04 seconds | |
| Notice: Finished catalog run in 0.05 seconds |
This file contains hidden or 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
| @notify { there: message => "string" } | |
| @notify { again: message => ["string"], tag => ["different"] } | |
| # This will get both of the above resources | |
| Notify <| message == "string" |> | |
| # This will, surprise, surprise, get the second resource | |
| Notify <| message != "string" |> |
This file contains hidden or 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
| class a::c { | |
| notice(c) | |
| } | |
| class b { | |
| search(a) | |
| include c | |
| } | |
| include b |
This file contains hidden or 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
| # This gives an error: | |
| notice('- 1' + 2) | |
| # The error is "Error: left operand of + is not a number" |
This file contains hidden or 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
| # create a resolution (instrument. It observes facts about the world) without any externally visible fact | |
| Facter.instrument(:network) do | |
| description "..." | |
| confine ... | |
| observe do | |
| ... | |
| end | |
| end | |
| # Create a specific composition, which is the final fact. Without the |
This file contains hidden or 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
| 1.9.3p392 :001 > require 'puppet' | |
| => true | |
| 1.9.3p392 :002 > require 'puppet/network/http' | |
| => true | |
| 1.9.3p392 :003 > require 'puppet/network/http/handler' | |
| => true | |
| 1.9.3p392 :004 > class Foo | |
| 1.9.3p392 :005?> include Puppet::Network::HTTP::Handler | |
| 1.9.3p392 :006?> end | |
| => Foo |
NewerOlder