On 3 , 17:17, Chuck Remes <cremes.devl... / mac.com> wrote:
> On Jun 3, 2011, at 9:05 AM, Ilias Lazaridis wrote:
> > Using several constructs I saw, I came up with this one:
>
> > #mylib.rb
> > module Kernel
> >   > >  ¯  > >         
> > print caller.to_s
> >      
> >  
> > end
>
> > if executed?
> >   
> > end
>
> > #mytest.rb
> > require_relative 'mylib'
>
> > if executed?
> >   > > end
>
> > #maintest.rb
> > require_relative 'mylib'
> > require_relative 'mytest'
>
> > if executed?
> >   > > end
>
> > -
>
> > ruby mylib.rb => EXEC mylib
> > ruby mylib.rb => EXEC mytest

correction:

ruby mytest.rb => EXEC mytest

> > ruby maintest.rb => EXEC maintest
>
> > -
>
> > I still dislike this solution, as it's not clean.
>
> What isn't "clean" about it?
[...]

I am criticising myself.

My implementation is not "clean", as it depends on the call stack /
regex.

.

--
http://lazaridis.com