Issue #4565 has been reported by Luke Kanies.

----------------------------------------
Refactor #4565: The internal DSL should be rewritten
http://projects.puppetlabs.com/issues/4565

Author: Luke Kanies
Status: Accepted
Priority: Normal
Assigned to: 
Category: interface
Target version: 2.0.0
Branch: 


The current internal DSL isn't optimized for easiest addition of the most 
common fact type -- single resolution with no confines -- which makes it clumsy 
for most people.

The DSL should be rewritten to provide, at the least, a very simple interface 
for adding a single fact.  Something like:
<pre>
Facter.add :foo { File.read("/my/file") }
</pre>
This could be enhanced to support options:
<pre>
Facter.add :foo, :ttl => 50 { .... }
However, we should also support specifying values directly:
<pre>
Facter.add :foo => "bar"
</pre>
Or maybe:
<pre>
Facter.add :foo, :value => "bar"
</pre>
And we should support a more complex interface akin to what we have:
<pre>
Facter.add :foo do
  confine :operatingsystem => "rhel"
  resolve  { ... }
end
</pre>
I recommend supporting three separate entry methods for these three kinds of 
facts.  This makes each individual interface method simple, and provides a nice 
template for extending the DSL over time.  It's probably also reasonable to 
(optionally?) include these methods in Object so they can be used without the 
'Facter.'.

A critical aspect of this rewrite, IMO, is that it should be a thin shell over 
the internal API, so that the API and DSL can be iterated separately, and so 
that we can provide a backward-compatible DSL.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to