Sha256: f1b017ad0cfa1c1efa4603eb38a9b2b246491cee9d4c306e81842ae478723053

Contents?: true

Size: 1.35 KB

Versions: 2

Compression:

Stored size: 1.35 KB

Contents

# Small hack to auto-run migrations during testing
namespace :db do
  task :abort_if_pending_migrations => [:migrate]
end

namespace :comfortable_mexican_sofa do
  namespace :fixtures do
    
    desc 'Import Fixture data into database (options: FROM=folder_name TO=site_identifier)'
    
    task :import => :environment do
      from  = ENV['FROM']
      to    = ENV['TO'] || ENV['FROM']
      
      puts "Importing CMS Fixtures from Folder [#{from}] to Site [#{to}] ..."
      
      # changing so that logger is going straight to screen
      logger = ComfortableMexicanSofa.logger
      ComfortableMexicanSofa.logger = Logger.new(STDOUT)
      
      ComfortableMexicanSofa::Fixture::Importer.new(from, to, :force).import!
      
      ComfortableMexicanSofa.logger = logger
    end
    
    desc 'Export database data into Fixtures (options: FROM=site_identifier TO=folder_name)'
    task :export => :environment do
      from  = ENV['FROM']
      to    = ENV['TO'] || ENV['FROM']
      
      puts "Exporting CMS data from Site [#{from}] to Folder [#{to}] ..."
      
      # changing so that logger is going straight to screen
      logger = ComfortableMexicanSofa.logger
      ComfortableMexicanSofa.logger = Logger.new(STDOUT)
      
      ComfortableMexicanSofa::Fixture::Exporter.new(from, to).export!
      
      ComfortableMexicanSofa.logger = logger
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.8.5 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.8.4 lib/tasks/comfortable_mexican_sofa.rake