Camping::Apps returns!

Magnus Holm
Fri, 29 Aug 2008 11:58:53 -0000

That''s why I have monkey-patched it:
Apps = [].instance_eval do
  def <<(i)
    delete_if { |f| f.to_s == i.to_s}
    super
  end
  self
end

Ex1 = Class.new
Apps << Ex1  # => [Ex1]
Object.send(:remove_const, :Ex1)
Ex1 = Class.new
Apps << Ex1 # => [Ex1] # the old one has been deleted.

Yes, I realize we could make some changes in camping/reloader.rb,
but I think this is more intuitive and do got lot''s of spare bytes...

On Fri, Aug 29, 2008 at 2:28 AM, zimbatm <zimbatm at oree.ch> wrote:

> Now I remember, there is a quirk. Make sure to remove the old app in
> the array when reloading the app in the Camping::Reloader.
>
> Cheers,
>   zimbatm
> _______________________________________________
> Camping-list mailing list
> Camping-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
>



--
Magnus Holm
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/camping-list/attachments/20080829/dc5394cb/attachment.html>