Sha256: 25acac060035597b48ea8c7ed3112054fcc686affa8106f3e8a2c0a17ebe0f67

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

namespace :occams do
  namespace :cms_seeds do
    desc 'Import CMS Seed data into database (from: folder name, to: site identifier, classes: class name[s])'

    task :import, %i[from to classes] => [:environment] do |_t, args|
      from  = args[:from]
      to    = args[:to] || from
      classes = args[:classes].nil? ? nil : args[:classes].split

      puts "Importing CMS Seed data from Folder [#{from}] to Site [#{to}] ..."

      # changing so that logger is going straight to screen
      logger = Occams.logger
      Occams.logger = Logger.new($stdout)

      Occams::Seeds::Importer.new(from, to).import!(classes)

      Occams.logger = logger
    end

    desc 'Export database data into CMS Seed files (from: site identifier, to: folder name, classes: class name[s])'
    task :export, %i[from to classes] => [:environment] do |_t, args|
      from  = args[:from]
      to    = args[:to] || from
      classes = args[:classes].nil? ? nil : args[:classes].split

      puts "Exporting CMS data from Site [#{from}] to Folder [#{to}] ..."

      # changing so that logger is going straight to screen
      logger = Occams.logger
      Occams.logger = Logger.new($stdout)

      Occams::Seeds::Exporter.new(from, to).export!(classes)

      Occams.logger = logger
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
occams-1.1.0 lib/tasks/cms_seeds.rake
occams-1.0.8 lib/tasks/cms_seeds.rake
occams-1.0.7.3 lib/tasks/cms_seeds.rake
occams-1.0.7.2 lib/tasks/cms_seeds.rake
occams-1.0.7.1 lib/tasks/cms_seeds.rake
occams-1.0.7 lib/tasks/cms_seeds.rake
occams-1.0.6.1 lib/tasks/cms_seeds.rake
occams-1.0.6 lib/tasks/cms_seeds.rake
occams-1.0.5 lib/tasks/cms_seeds.rake
occams-1.0.4 lib/tasks/cms_seeds.rake
occams-1.0.3 lib/tasks/cms_seeds.rake
occams-1.0.2 lib/tasks/cms_seeds.rake