Re: [Puppet-dev] Interfaces are now instances

2011-02-25 Thread Markus Roberts
>> 2) you have to be careful with interpolation, in any case, as there are > > scope changes to watch out for. > > Can you elaborate on this? > Sure. You can do this, and it works: x = [1,2,3] class << x def sum_of_squares collect { |x| x*x }.inject { |a,b| a+b } end end p x.su

Instrumenting Puppet (was Re: [Puppet-dev] Interfaces are now instances)

2011-02-25 Thread Luke Kanies
On Feb 25, 2011, at 1:20 PM, Brice Figureau wrote: >> [...] >> I think this basic model is sound, and is roughly what I'd do. >> >> You could also have a builtin system to allow classes to specify >> which methods should normally be probed. E.g., create a module that >> essentially does this: >>

Re: [Puppet-dev] Interfaces are now instances

2011-02-25 Thread Brice Figureau
On 25/02/11 20:54, Markus Roberts wrote: > B -- > > > Thanks for the example. This is quite interesting and opens the door to > a lot of strange things :) > > > Yes it does. Be sure to have a big stick handy when you open that door. :) > > > I was thinking about allowing the us

Re: [Puppet-dev] Interfaces are now instances

2011-02-25 Thread Brice Figureau
On 25/02/11 20:46, Luke Kanies wrote: > On Feb 25, 2011, at 11:24 AM, Brice Figureau wrote: > >> On 25/02/11 18:29, Markus Roberts wrote: >>> >>> There's also a 3rd thing I didn't started working on: allow the >>> code to set probes dynamically (instead of statistically adding >>> them by modifyi

Re: [Puppet-dev] Interfaces are now instances

2011-02-25 Thread Markus Roberts
B -- Thanks for the example. This is quite interesting and opens the door to > a lot of strange things :) > Yes it does. Be sure to have a big stick handy when you open that door. :) > I was thinking about allowing the user to describe probes by specifying > a puppet class and a method throu

Re: [Puppet-dev] Interfaces are now instances

2011-02-25 Thread Luke Kanies
On Feb 25, 2011, at 11:24 AM, Brice Figureau wrote: > On 25/02/11 18:29, Markus Roberts wrote: >> >>There's also a 3rd thing I didn't started working on: allow the code to >>set probes dynamically (instead of statistically adding them by >>modifying puppet code). I don't know if ruby

Re: [Puppet-dev] Interfaces are now instances

2011-02-25 Thread Brice Figureau
On 25/02/11 18:29, Markus Roberts wrote: > > There's also a 3rd thing I didn't started working on: allow the code to > set probes dynamically (instead of statistically adding them by > modifying puppet code). I don't know if ruby versatility can allow this, > but I'd love to be abl

Re: [Puppet-dev] Interfaces are now instances

2011-02-25 Thread Markus Roberts
> There's also a 3rd thing I didn't started working on: allow the code to > set probes dynamically (instead of statistically adding them by > modifying puppet code). I don't know if ruby versatility can allow this, > but I'd love to be able to instance_eval { ... add probes around a > method ... }

Re: [Puppet-dev] Interfaces are now instances

2011-02-25 Thread Brice Figureau
On Thu, 2011-02-24 at 13:47 -0800, Luke Kanies wrote: > On Feb 24, 2011, at 1:37 PM, Brice Figureau wrote: > > > On 23/02/11 07:05, Luke Kanies wrote: > >> I thought this design point would be interesting, assuming I can make > >> it sufficiently clearly. > >> > >> I just did a refactor of my Int

Re: [Puppet-dev] Interfaces are now instances

2011-02-24 Thread Luke Kanies
On Feb 24, 2011, at 1:37 PM, Brice Figureau wrote: > On 23/02/11 07:05, Luke Kanies wrote: >> I thought this design point would be interesting, assuming I can make >> it sufficiently clearly. >> >> I just did a refactor of my Interfaces work - previously, I had a >> base class of Puppet::Interfac

Re: [Puppet-dev] Interfaces are now instances

2011-02-24 Thread Brice Figureau
On 23/02/11 07:05, Luke Kanies wrote: > I thought this design point would be interesting, assuming I can make > it sufficiently clearly. > > I just did a refactor of my Interfaces work - previously, I had a > base class of Puppet::Interface, and all interfaces were subclasses > of that class. > >

Re: [Puppet-dev] Interfaces are now instances

2011-02-24 Thread Luke Kanies
On Feb 24, 2011, at 9:59 AM, Markus Roberts wrote: > L -- > BTW this is discussed a bit in Analysis Patterns by Martin Fowler as the operational layer and knowledge layer (where the classes are at the operational layer and the instances are the knowledge layer). >>> >>> Yeah. I

Re: [Puppet-dev] Interfaces are now instances

2011-02-24 Thread Markus Roberts
L -- >>> BTW this is discussed a bit in Analysis Patterns by Martin Fowler as the >>> operational layer and knowledge layer (where the classes are at the >>> operational layer and the instances are the knowledge layer). >> >> Yeah.  I like Martin's stuff in general but on this I've never found >

Re: [Puppet-dev] Interfaces are now instances

2011-02-24 Thread Luke Kanies
On Feb 24, 2011, at 8:47 AM, Markus Roberts wrote: > L -- > >> BTW this is discussed a bit in Analysis Patterns by Martin Fowler as the >> operational layer and knowledge layer (where the classes are at the >> operational layer and the instances are the knowledge layer). > > Yeah. I like Mart

Re: [Puppet-dev] Interfaces are now instances

2011-02-24 Thread Markus Roberts
L -- > BTW this is discussed a bit in Analysis Patterns by Martin Fowler as the > operational layer and knowledge layer (where the classes are at the > operational layer and the instances are the knowledge layer). Yeah. I like Martin's stuff in general but on this I've never found his distinct

Re: [Puppet-dev] Interfaces are now instances

2011-02-24 Thread Luke Kanies
On Feb 24, 2011, at 8:28 AM, Markus Roberts wrote: > L -- > >> I thought this design point would be interesting, assuming I can make it >> sufficiently clearly. >> >> I just did a refactor of my Interfaces work - previously, I had a base class >> of Puppet::Interface, and all interfaces were s

Re: [Puppet-dev] Interfaces are now instances

2011-02-24 Thread Markus Roberts
L -- > I thought this design point would be interesting, assuming I can make it > sufficiently clearly. > > I just did a refactor of my Interfaces work - previously, I had a base class > of Puppet::Interface, and all interfaces were subclasses of that class. > > However, once Dan Bode asked for

[Puppet-dev] Interfaces are now instances

2011-02-22 Thread Luke Kanies
Hi all, I thought this design point would be interesting, assuming I can make it sufficiently clearly. I just did a refactor of my Interfaces work - previously, I had a base class of Puppet::Interface, and all interfaces were subclasses of that class. However, once Dan Bode asked for a separat