Sha256: 288113085ffd454714cbed32dc6d12802ecc20050b3446de28c27eb91c3349a4

Contents?: true

Size: 1.33 KB

Versions: 5

Compression:

Stored size: 1.33 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
      to    = ENV['TO'] || ENV['FROM']
      from  = ENV['FROM']
      
      puts "Importing CMS Fixtures from Folder [#{from}] to Site [#{to}] ..."

      # changing so that logger is going straight to screen
      logger_org = ComfortableMexicanSofa.logger
      ComfortableMexicanSofa.logger = Logger.new(STDOUT)

      ComfortableMexicanSofa::Fixtures.import_all(to, from)

      ComfortableMexicanSofa.logger = logger_org
    end
    
    desc 'Export database data into Fixtures (options: FROM=site_identifier.com TO=folder_name)'
    task :export => :environment do
      to    = ENV['TO'] || ENV['FROM']
      from  = ENV['FROM']
      
      puts "Exporting CMS data from Site [#{from}] to Folder [#{to}] ..."

      # changing so that logger is going straight to screen
      logger_org = ComfortableMexicanSofa.logger
      ComfortableMexicanSofa.logger = Logger.new(STDOUT)

      ComfortableMexicanSofa::Fixtures.export_all(from, to)

      ComfortableMexicanSofa.logger = logger_org
      
      puts 'Done!'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.6.31 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.30 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.7.1 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.7.0 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.26 lib/tasks/comfortable_mexican_sofa.rake