Changeset 203

Show
Ignore:
Timestamp:
09/23/2007 14:28:02 (15 months ago)
Author:
zimbatm
Message:

Rakefile : "size" task added : print and check sizes, exit if camping.rb is

greater than 4096 bytes. The default task now execute :size first.
Easy check to prevent sizes overgrow.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Rakefile

    r202 r203  
    1818 
    1919desc "Packages up Camping." 
    20 task :default => [:package] 
     20task :default => [:size, :package] 
    2121task :package => [:clean] 
    2222 
     
    129129end 
    130130 
     131SIZE_LIMIT = 4096 
     132desc "Compare camping sizes to unabridged" 
     133task :size do 
     134  size = File.size("lib/camping-unabridged.rb") 
     135  FileList["lib/camping*.rb"].each do |path| 
     136    s = File.size(path) 
     137    puts "%21s : % 6d % 4d%" % [File.basename(path), s, (100 * s / size)] 
     138  end 
     139  if File.size("lib/camping.rb") > SIZE_LIMIT 
     140    STDERR.puts "ERROR: camping.rb is too big (> #{SIZE_LIMIT})" 
     141    exit 1 
     142  end 
     143end