Skip to content

Commit

Permalink
Less magic Camping::Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Oct 27, 2008
1 parent a4074fa commit eb75914
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions lib/camping-unabridged.rb
Expand Up @@ -90,13 +90,7 @@ module Camping
C = self
S = IO.read(__FILE__) rescue nil
P = "<h1>Cam\ping Problem!</h1><h2>%s</h2>"
Apps = [].instance_eval do
def <<(i)
delete_if { |f| f.to_s == i.to_s}
super
end
self
end
Apps = []
# An object-like Hash.
# All Camping query string and cookie variables are loaded as this.
#
Expand Down
3 changes: 1 addition & 2 deletions lib/camping.rb
@@ -1,7 +1,6 @@
%w[uri stringio rack].map{|l|require l};class Object;def meta_def m,&b
(class<<self;self end).send:define_method,m,&b end end;module Camping;C=self
S=IO.read(__FILE__)rescue nil;P="<h1>Cam\ping Problem!</h1><h2>%s</h2>";Apps=[].
instance_eval{def << i;delete_if{|f|f.to_s==i.to_s};super;end;self}
S=IO.read(__FILE__)rescue nil;P="<h1>Cam\ping Problem!</h1><h2>%s</h2>";Apps=[]
class H<Hash
def method_missing m,*a;m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m.to_s]:super end
undef id,type;end;module Helpers;def R c,*g
Expand Down
1 change: 1 addition & 0 deletions lib/camping/reloader.rb
Expand Up @@ -49,6 +49,7 @@ def find_app(title)
# namespace, this will be sure to do so and set @klass to nil.
def remove_app
if @klass
Camping::Apps.delete(@klass)
Object.send :remove_const, @klass.name
@klass = nil
end
Expand Down

0 comments on commit eb75914

Please sign in to comment.