summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/functions/defined.rb
Commit message (Collapse)AuthorAgeFilesLines
* (#5944) Remove documentation of define() when used on nodes, as it is not a ↵nfagerlund2011-01-251-21/+3
| | | | | | supported use of this function. Final patch in this series reviewed by Dan Bode.
* (#5944) Further edits of inline defined() documentation.nfagerlund2011-01-251-25/+30
| | | | Fixing use of define/declare; editing for clarity.
* (#5944) Improve documentation of defined() functionnfagerlund2011-01-251-6/+41
| | | | The differences in the way defined() handles different types of entities weren't well-explained. Documentation was also added for the behavior of defined(Node["somenode.domain.com"]).
* Rewrote functions documentation to MarkdownJames Turnbull2010-08-111-1/+1
|
* Code smell: Two space indentationMarkus Roberts2010-07-091-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
* Removing Resource::Reference classesLuke Kanies2010-02-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is hopefully less messy than it first appears, but it's certainly cross-cutting. The reason for all of this is that we previously only looked up builtin resource types from outside the parser, but now that the defined resource types are available globally via environments, we can push that lookup code to Resource. Once we do that, however, we have to have environment and namespace information in every resource. Here I remove the Resource::Reference classes (except the AST class), and use Resource instances instead. I did this because the shared code between the two classes got incredibly complicated, such that they should have had a hierarchical relationship disallowed by their constants. This complexity convinced me just to get rid of References entirely. I also make Puppet::Parser::Resource a subclass of Puppet::Resource. There are still broken tests in test/, but this was a big enough commit I wanted to get it in. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Switching to LoadedCode from ASTSetLuke Kanies2009-07-051-1/+1
| | | | | | | | I also took the opportunity to clean up and simplify the interface to the parts of the parser that interact with this. Mostly it was method renames. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-261-2/+2
| | | | semicolons
* Fixed #1488 - Moved individual functions out of functions.rb intoJames Turnbull2008-08-261-0/+27
the lib/puppet/parser/functions directory. New functions should be created in this directory.