Skip to content

Commit

Permalink
* Gained 22 octets, by replacing raise NoMethodError... by "super"
Browse files Browse the repository at this point in the history
* Fixed rake size calulations
  • Loading branch information
Jonas Pfenniger committed Sep 23, 2007
1 parent 596f092 commit 355aa85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,9 @@ end
SIZE_LIMIT = 4096
desc "Compare camping sizes to unabridged"
task :size do
size = File.size("lib/camping-unabridged.rb")
FileList["lib/camping*.rb"].each do |path|
s = File.size(path)
puts "%21s : % 6d % 4d%" % [File.basename(path), s, (100 * s / size)]
puts "%21s : % 6d % 4d%" % [File.basename(path), s, (100 * s / SIZE_LIMIT)]
end
if File.size("lib/camping.rb") > SIZE_LIMIT
STDERR.puts "ERROR: camping.rb is too big (> #{SIZE_LIMIT})"
Expand Down
2 changes: 1 addition & 1 deletion lib/camping-unabridged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class H
# => :macadamian
#
def method_missing(m,*a)
m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m]:raise(NoMethodError,"#{m}")
m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m]:super
end
alias_method :u, :regular_update
end
Expand Down
4 changes: 2 additions & 2 deletions lib/camping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ def method_missing m,c,*a;X.M;k=X.const_get(c).new(StringIO.new,H['HTTP_HOST',
end;module Models;autoload:Base,'camping/db';def Y;self;end;end;class Mab<
Markaby::Builder;include Views;def tag!*g,&b;h=g[-1];[:href,:action,:src].map{
|a|(h[a]=self/h[a])rescue 0};super end end;H=HashWithIndifferentAccess;class H
def method_missing m,*a;m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m]:raise(
NoMethodError,"#{m}")end;alias_method:u,:regular_update;end end
def method_missing m,*a;m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m]:super end
alias_method:u,:regular_update;end end

0 comments on commit 355aa85

Please sign in to comment.