summaryrefslogtreecommitdiffstats
path: root/lib/puppet/dsl.rb
Commit message (Collapse)AuthorAgeFilesLines
* [#4716] ResourceTypeAPI exposes implementation details that are likely to changePaul Berry2010-09-221-4/+0
| | | | | | | | | | | | | | | | | | | | | | Made the following modifications to ResourceTypeAPI: (1) returned nil from “define”, “hostclass”, and “node”. (2) renamed “mk_resource_type” and “munge_type_arguments” to “__mk_resource_type__” and “__munge_type_arguments__” to discourage customers from calling them. (3) Made ResourceTypeAPI a class rather than a module, and changed the parser to evaluate the contents of pure ruby manifests using a instances of this class. (4) Changed ResourceTypeAPI to insert newly instantiated types into Thread.current[:known_resource_types] rather than the default environment's known_resource_types. This effectively backports the fix for issue #4657 to 2.6.x. Also backported the new spec tests from #4657.
* Code smell: Two space indentationMarkus Roberts2010-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* s/DSL::ResourceHelper/DSL::ResourceAPI/gLuke Kanies2010-02-171-1/+1
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding simplistic pure ruby interfaceLuke Kanies2010-02-171-0/+11
| | | | | | | | | This is a simplistic DSL - you can create resource types (defined resources), classes, and nodes, and they can call functions and create resources. Nothing else, at this point. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Removing old, never-used DSL codeLuke Kanies2010-02-171-275/+0
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-7/+7
|
* Fixes #1148 - replaces #!/usr/bin/ruby with #!/usr/bin/env ruby.Paul Lathrop2008-03-281-2/+2
|
* Somewhat refactored fileserving so that it no longer cachesLuke Kanies2008-02-231-45/+43
| | | | | | | | | | any objects, nor does it use Puppet's RAL resources. In the process, I fixed #894 (you can now copy links) and refactored other classes as necessary. Mostly it was fixing tests. This is a squashed commit of a temporary branch, fwiw, and it also includes any fixes to the tests that were necessary to get all tests passing again.
* Renaming 'configuration' to 'catalog', fixing #954.Luke Kanies2007-12-111-2/+2
|
* Theoretically, this patch is to fix #917 (which it does), butLuke Kanies2007-11-281-0/+1
| | | | | | | | | | | | | | | | | | | there were enough problems fixing it that I decided something more drastic needed to be done. This uses the new Puppet::ResourceReference class to canonize what a resource reference looks like and how to retrieve resources via their references. Specifically, it guarantees that resource types are always capitalized, even when they include '::' in them. While many files are modified in this commit, the majority of changes are quite small, and most of the changes are fixing the tests to use capitalized types. As we look at consolidating some of our resource types, we could consolidate the ResourceReference stuff at the same time, but at least the Puppet::Parser::ResourceReference class subclasses the main Puppet::ResourceReference class.
* Another round of test-fixing around the changes I madeLuke Kanies2007-10-051-3/+8
| | | | | | | | | to the configuration system. 'puppet' itself still works, even with -e, but I expect that puppetd and puppetmasterd are broken, and there are still quite a few broken tests because the default fact store can't write but that's the default behaviour for a networked configuration master.
* Merge branch 'master' of ssh://reductivelabs.com/opt/rl/git/puppetLuke Kanies2007-10-031-2/+0
|\ | | | | | | | | | | | | Conflicts: lib/puppet/defaults.rb lib/puppet/dsl.rb
| * Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
| |
* | I finally tracked down the problem that was causing providersLuke Kanies2007-10-031-104/+0
|/ | | | | | | | | | | | to sometimes suddenly disappear and thus tests to fail -- Kernel.require was not loading the normal ruby path (e.g., 'puppet/type/cron'), so if someone else loaded that then it would replace the in-memory type with a new one, but that new one couldn't load its own providers, because the Kernel would ignore the providers, thinking they were already loaded. This doesn't fix all of the autoloading problems, but at least we won't suddenly break a ton of tests.
* This is basically another intermediate commit. I feel likeLuke Kanies2007-09-171-5/+2
| | | | | | | | | | | | | | | | | | | | I've gone too far down the rabbit hole to turn back now, but the code is clearly getting more centralized around the Configuration class, which is the goal. Things are currently a bit muddy between recursion, dynamic resource generation, transactions, and the configuration, and I don't expect to be able to clear it up much until we rewrite all of the tests for the Transaction class, since that is when we'll actually be setting its behaviour. At this point, Files (which are currently the only resources that generate other resources) are responsible for adding their edges to the relationship graph. This puts them knowing more than I would like about how the relationship graph works, but it'll have to do for now. There are still failing tests, but files seem to work again. Now to go through the rest of the tests and make them work.
* Adding a to_graph method to TransBuckets, so that the buckets can directly ↵Luke Kanies2007-09-121-2/+1
| | | | generate a graph, rather than having to first convert to RAL types and then have them convert to a graph. This allows us to make it so components do not need a @children array at all. This was all done because I am having the "already a parent of" problem again, and I have gotten far enough that it is relatively easy to just make this problem go away once and for all.
* Making a couple of small bugfixes in the configuration subsystemLuke Kanies2007-08-271-2/+2
|
* The last commits before I actually start on the multi-environment support. ↵Luke Kanies2007-08-221-1/+1
| | | | There are still failing tests, but apparently only those that are also failing in trunk.
* A round of bugfixing. Many more tests now pass -- I think we are largely ↵Luke Kanies2007-08-201-6/+16
| | | | down to tests that (yay!) fail in trunk.
* Merging the webserver_portability branch from version 2182 to version 2258.luke2007-03-061-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2259 980ebf18-57e1-0310-9a29-db15c13687c0
* Moving all of the client and server code into a single network/ directory. ↵luke2007-02-081-1/+1
| | | | | | In other words, more code structure cleanup. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2179 980ebf18-57e1-0310-9a29-db15c13687c0
* Moving some of the stand-alone classes into the util/ subdirectory, to clean ↵luke2007-02-071-2/+2
| | | | | | up the top-level namespace a bit. This is a lot of file modifications, but most of them just change class names and file paths. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2178 980ebf18-57e1-0310-9a29-db15c13687c0
* Doing some work on the DSL. It behaves a little more like the real language ↵luke2006-10-181-19/+238
| | | | | | now, although overrides use the same syntax as normal resources, and there is no facility for specifying defaults git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1814 980ebf18-57e1-0310-9a29-db15c13687c0
* adding DSL class. Sorry, not much in the way of docs.luke2006-07-271-0/+152
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1430 980ebf18-57e1-0310-9a29-db15c13687c0