Sha256: 9f5f3277b6c33e77aa96dc2898233ddefcf37d4af860c62c683a61716dd732d7

Contents?: true

Size: 913 Bytes

Versions: 2

Compression:

Stored size: 913 Bytes

Contents

namespace :merb do
  desc "freeze the merb framework into dist/merb for portability"
  task :freeze do
    FileUtils.rm_rf MERB_ROOT / 'dist/framework'
    FileUtils.cp_r MERB_FRAMEWORK_ROOT, (MERB_ROOT / 'dist/framework')
    tmpl = "#!/usr/local/bin/ruby\nrequire File.expand_path(File.dirname(__FILE__)+'/../dist/framework/merb/merb_server')\nMerb::Server.run\n"
    File.open(MERB_ROOT / 'script/merb', 'wb') {|f|
      f.write tmpl 
      f.chmod(0744)
    }
    
    puts "  Freezing Merb Framework into dist/framework"
    puts "  Use script/merb to start instead of plain merb"
  end
  desc "unfreeze this app from the framework and use system gem."
  task :unfreeze do
    FileUtils.rm_rf MERB_ROOT / 'dist/framework'
    FileUtils.rm MERB_ROOT / 'script/merb'
    
    puts "  Removed: "
    puts "   - #{MERB_ROOT / 'dist/framework'} (recursive) "
    puts "   - #{MERB_ROOT / 'script/merb'}"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
merb-0.3.0 lib/tasks/merb.rake
merb-0.3.1 lib/tasks/merb.rake