Sha256: 296a2e89dde5d33b7c00d147f5e081755c4adb8f09340882168070499118e8fa

Contents?: true

Size: 1.32 KB

Versions: 17

Compression:

Stored size: 1.32 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=example.local TO=example.com)'

    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=example.com TO=example.local)'
    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

17 entries across 17 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.6.25 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.24 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.23 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.22 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.21 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.20 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.19 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.18 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.17 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.16 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.15 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.14 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.13 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.12 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.11 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.10 lib/tasks/comfortable_mexican_sofa.rake
comfortable_mexican_sofa-1.6.9 lib/tasks/comfortable_mexican_sofa.rake