summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/branch.rb
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-09-02 18:10:37 -0700
committerPaul Berry <paul@puppetlabs.com>2010-09-02 18:37:28 -0700
commit6b278503021c4404904f56ced6995d0fbfa5b8fe (patch)
tree134f89786a38137a89dc6e846920d9dfc57e59c3 /lib/puppet/parser/ast/branch.rb
parent25048ecc40db746f7e88bb6c5e1fc4f2c0150a4f (diff)
downloadpuppet-6b278503021c4404904f56ced6995d0fbfa5b8fe.tar.gz
puppet-6b278503021c4404904f56ced6995d0fbfa5b8fe.tar.xz
puppet-6b278503021c4404904f56ced6995d0fbfa5b8fe.zip
[#4657] Customer-supplied .rb files are not compatible with multiple environments or staleness check
Changed the resource type API to create AST objects rather than directly instantiating resource types. This allows the same code paths to be used to handle the results of parsing both .pp and .rb files. This makes .rb files work properly in multiple environments, because the types are now instantiated by code that is aware of which environment the compilation is happening in. It also reduces the risk of future changes breaking .rb file support. Also, switched to using "instance_eval" rather than "require" to evaluate the contents of the .rb file. This ensures that if the file has to be recompiled (because it became stale), it will actually get re-evaluated. As a side benefit, ResourceTypeAPI is now a class rather than a mixin to Object, so its methods do not pollute the global namespace. To reduce the risk of customers coming to rely on implementation details of the resource type API, changed its methods to return nil, and removed methods from it that were misleadingly labeled as "private".
Diffstat (limited to 'lib/puppet/parser/ast/branch.rb')
0 files changed, 0 insertions, 0 deletions