summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/scope.rb
Commit message (Collapse)AuthorAgeFilesLines
* Many, many, many performance improvements in the compiler (I hope). I did ↵luke2006-10-061-74/+43
| | | | | | not change functionality anywhere, but I did some profiling and significantly reduced the runtime of many methods, and especially focused on some key methods that run many times. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1739 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the changes from the override-refactor branch. This is a ↵luke2006-10-041-1045/+499
| | | | | | significant rewrite of the parser, but it has little affect on the rest of the code tree. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1726 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding the feature from #259. I had to rework the Scope#lookupvar a bit, ↵luke2006-09-151-4/+14
| | | | | | but everything now works as expected when variables are either undefined or set to empty strings. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1609 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding eat-last-line support in ERBluke2006-09-031-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1542 980ebf18-57e1-0310-9a29-db15c13687c0
* downgrading the template interpolation messageluke2006-08-301-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1517 980ebf18-57e1-0310-9a29-db15c13687c0
* Committing definition inheritance. I have not yet written tests yet, but my ↵luke2006-08-221-0/+21
| | | | | | last commit pretty seriously broke some things without me realizing it, so I wanted to get this in. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1484 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding "if/else" constructs. No operators, no elsif, but it is a good ↵luke2006-08-221-0/+10
| | | | | | start, anyway. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1483 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing bug in scope/interpreter where nodes found in ldap must have parent ↵luke2006-07-181-1/+1
| | | | | | nodes. The problem was that the the scope was using the presence of a parent node to determine whether a node was found. Instead I added a flag in the arguments to "Scope#evaluate" to mark nodes as found. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1401 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing templating so it immediately fails when a variable is not found, as ↵luke2006-07-111-4/+19
| | | | | | opposed to passing up the method_missing heirarchy, which was causing a nasty memory leak and some kind of weird, long-running search git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1389 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing templating bug that can result in what looks like an infinite loop, ↵luke2006-07-111-1/+7
| | | | | | and changing default timeout to 2 minutes instead of 30 seconds git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1385 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing error when template does not existluke2006-07-111-1/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1383 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding minimal update checking for templates. It will only check the ↵luke2006-07-031-0/+5
| | | | | | templates that have been parsed in this process, but it is better than nothing. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1353 980ebf18-57e1-0310-9a29-db15c13687c0
* Moving the template handling into a simple wrapper object so templates don't ↵luke2006-06-301-8/+33
| | | | | | have full access to the scope object without some real hacking. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1342 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding initial template support. It is just a function, and a ↵luke2006-06-291-1/+13
| | | | | | method_missing method on Scope. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1340 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding test and fix for empty execs being ignoredluke2006-06-151-3/+5
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1288 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding support for default nodes as requested in #136.luke2006-06-131-0/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1261 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #163. Strings can now correctly escape dollar signs.luke2006-06-051-12/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1234 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #160. Fixing the error in Puppet::Type#[]= and scope.newobjectluke2006-06-011-5/+11
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1230 980ebf18-57e1-0310-9a29-db15c13687c0
* I believe I have finalized export/collection support. I still want to go ↵luke2006-05-151-17/+46
| | | | | | through all of the code and s/collectable/exported/g (thanks to womble for that term). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1193 980ebf18-57e1-0310-9a29-db15c13687c0
* I had to redo how the scopes handled collectable objects (which I will soon ↵luke2006-05-141-17/+70
| | | | | | change to being called "exported objects"). All seems to work now, though. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1192 980ebf18-57e1-0310-9a29-db15c13687c0
* The "collectable" syntax now works end-to-end -- the parser correctly ↵luke2006-05-131-101/+19
| | | | | | recognizes it, the AST objects retain the settings, the scopes do the right conversion, the interpreter stores them all in the database, and then it strips the collectable objects out before sending the object list to the client git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1189 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding some small changes towards fixing #140 and #83, but this work needs ↵luke2006-05-131-10/+38
| | | | | | to take a back seat to object collection, so i will come back to it later. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1186 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #141. It was a problem related to the recent parser changes I made.luke2006-05-121-1/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1185 980ebf18-57e1-0310-9a29-db15c13687c0
* removing some extraneous loggingluke2006-05-121-1/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1184 980ebf18-57e1-0310-9a29-db15c13687c0
* Preliminary commit of the first phase of the parser redesign. The biggest ↵luke2006-05-091-119/+168
| | | | | | difference is that overrides should now work for definitions (although i do not yet have a test case -- i will add one on the next commit). The way this is implemented is by having scopes translate themselves at eval time, but in two phases -- the first phase does the overrides, and the second phase does the evaluation of definitions and classes. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1180 980ebf18-57e1-0310-9a29-db15c13687c0
* Allowing dashes in class names, although grammar rules restrict it from ↵luke2006-05-021-1/+1
| | | | | | working anywhere except node names or in tag(). They are valid in host names, and many companies have them in the host names; in fact, this fix is for a company with this exact problem -- they cannot use puppet with their nodes because all their hosts have dashes in the host names. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1165 980ebf18-57e1-0310-9a29-db15c13687c0
* Modifying "setclass" on scope to check the validity of class names, now that ↵luke2006-04-111-0/+4
| | | | | | "set" can be used to set them manually, and added a test for it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1104 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding simple benchmarking, and using it in a few of the more obvious ↵luke2006-04-101-1/+6
| | | | | | places. Also, fixed a bug in Scope#gennode. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1098 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #103. There are now no such things as node scopes; the entire tree ↵luke2006-04-051-903/+833
| | | | | | is evaluated on every node connection, and node facts are set at the top-level scope. This includes,um, the code; the last commit was accidentally just test changes. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1073 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing the class file to actually store class names, not object ids. Also ↵luke2006-04-041-6/+6
| | | | | | added tests to make sure it all stays that way. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1063 980ebf18-57e1-0310-9a29-db15c13687c0
* Using undefined variables is no longer an exception, it just returns an ↵luke2006-03-111-4/+5
| | | | | | empty string. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1003 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #96. Defaults are now set when the object is passed out by the ↵luke2006-03-091-0/+17
| | | | | | scope, rather than when the object is created. This is nice because it also moves awareness of the scope internals out of the AST object and back into the scope. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@996 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing bug #60. Converting nodes to use types everywhere instead of names, ↵luke2006-02-281-97/+238
| | | | | | and adding a localobjectable to keep track of what parameters have been defined locally. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@957 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #64; multiple class definitions in the same scope is now an error, ↵luke2006-02-271-1/+7
| | | | | | although using the same class name in different scopes is not an error. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@956 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing bug #73; node names now appear only once in the pathluke2006-02-271-2/+12
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@955 980ebf18-57e1-0310-9a29-db15c13687c0
* Removing all of the autoname codeluke2006-02-271-2/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@953 980ebf18-57e1-0310-9a29-db15c13687c0
* Mostly, this is a refactoring commit. There is one significant new feature,luke2006-02-271-25/+101
| | | | | | | | | | | | | | | | | though: overrides now only work within a class heirarchy, which is to say that a subclass can override an element in a base class, but a child scope cannot otherwise override an element in a base scope. I've also done a good bit of refactoring, though; notably, AST#evaluate now takes named arguments, and I changed the 'name' parameter to 'type' in all of the Component classes (this was all internal, but was confusing as it was). I also removed the need for the autonaming stuff -- it's now acceptable for components not to have names, and everything behaves correctly. I haven't yet removed the autoname code, though; I'll do that on the next commit. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@952 980ebf18-57e1-0310-9a29-db15c13687c0
* Switching setclass to use object_ids instead of class names, and adding some ↵luke2006-02-271-6/+7
| | | | | | comments. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@951 980ebf18-57e1-0310-9a29-db15c13687c0
* Changing transactions to be one-stage instead of two, and changing most of ↵luke2006-02-161-1/+0
| | | | | | the type classes to use "obj[:name]" instead of "obj.name" where appropriate, because "obj.name" might be a symbolic name (e.g., File.unlink(file.name) will not do what you want if file.name == "sshdconfig" but file[:path] == "/etc/ssh/sshd_config") git-svn-id: https://reductivelabs.com/svn/puppet/trunk@922 980ebf18-57e1-0310-9a29-db15c13687c0
* Committing the initial ldap support -- puppet can now look up node ↵luke2006-02-141-5/+43
| | | | | | configurations in ldap. The test scripts currently only work on my home network. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@909 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing some problems with cron tab management, and creating ↵luke2006-02-131-0/+3
| | | | | | Puppet::Util.{u,g}id methods. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@898 980ebf18-57e1-0310-9a29-db15c13687c0
* Making the language name a real alias. Now all objects in Puppet support ↵luke2006-02-101-0/+1
| | | | | | specifying both the name and the namevar, or just a name and having the namevar set. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@896 980ebf18-57e1-0310-9a29-db15c13687c0
* Committing both the finalization of the config code, plus all of the code ↵luke2006-02-071-1/+11
| | | | | | necessary to get basic isomorphism from code to transportables and back. Mostly keyword and autoname stuff. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@871 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing class storage -- it was not working for nodescopesluke2006-01-301-5/+17
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@858 980ebf18-57e1-0310-9a29-db15c13687c0
* Made lots of small changes, mostly to help usability but also fixed a couple ↵luke2006-01-181-29/+16
| | | | | | of key bugs git-svn-id: https://reductivelabs.com/svn/puppet/trunk@841 980ebf18-57e1-0310-9a29-db15c13687c0
* Converting transport format to YAML instead of Marshal, and caching the file ↵luke2006-01-121-1/+9
| | | | | | in a YAML format, also. This required a significant rework of both Transportable classes. Lastly, I am also now caching the list of classes in a class file in /etc/puppet. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@816 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding "content" state to files, and string interpolation handles escaped ↵luke2006-01-121-1/+1
| | | | | | whitespace characters. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@813 980ebf18-57e1-0310-9a29-db15c13687c0
* adding cfengine module, which required passing the cfengine classes all the ↵luke2005-11-171-1/+9
| | | | | | way through the stack to the scope git-svn-id: https://reductivelabs.com/svn/puppet/trunk@746 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding "isomorphic?" method to classes, and testing for isomorphism before ↵luke2005-11-021-9/+14
| | | | | | throwing a conflict git-svn-id: https://reductivelabs.com/svn/puppet/trunk@741 980ebf18-57e1-0310-9a29-db15c13687c0
* Further progress towards the next release. Lots of small bugs fixed, the ↵luke2005-11-011-5/+3
| | | | | | paths look much better now, and Transportable is much cleaner. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@740 980ebf18-57e1-0310-9a29-db15c13687c0