# require 'mitamirri/tasks' to add tasks to the host application. namespace :mitamirri do desc "Sync migrations and other files from Mitamirri." task :install do dir = Gem.searcher.find('mitamirri').full_gem_path system "rsync -ruv #{dir}/public/stylesheets public/" system "rsync -ruv #{dir}/config/initializers/database.rb config/initializers/" puts puts "Mitamarri file sync complete." puts "Run rake mitamirri:override to install local views and controllers to override default behaviour." puts end desc "Copy default view and controller files from Mitamirri to the host application." task :override do dir = Gem.searcher.find('mitamirri').full_gem_path system "rsync -ruv #{dir}/app/controllers/trackable_actions_controller.rb app/controllers/" system "rsync -ruv #{dir}/app/controllers/trackable_sessions_controller.rb app/controllers/" system "rsync -ruv #{dir}/app/views/trackable_sessions app/views/" puts puts "Mitamarri views and controllers copied and ready to override." puts end end