Sha256: 7f01e7a25c30a0c23a0dc5658fbacc6f364a650857d9bd621c3ad481862d2eb5

Contents?: true

Size: 1.41 KB

Versions: 11

Compression:

Stored size: 1.41 KB

Contents

# frozen_string_literal: true

namespace :comfy 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 = ComfortableMexicanSofa.logger
      ComfortableMexicanSofa.logger = Logger.new(STDOUT)

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

      ComfortableMexicanSofa.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 = ComfortableMexicanSofa.logger
      ComfortableMexicanSofa.logger = Logger.new(STDOUT)

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

      ComfortableMexicanSofa.logger = logger
    end
  end
end

Version data entries

11 entries across 11 versions & 6 rubygems

Version Path
comfortable_mexican_sofa-2.0.19 lib/tasks/cms_seeds.rake
PixelForce_ETS-0.0.2 lib/tasks/cms_seeds.rake
PixelForce_ETS-0.0.1 lib/tasks/cms_seeds.rake
kcyEtsTest2-0.0.4 lib/tasks/cms_seeds.rake
kcyEtsTest2-0.0.3 lib/tasks/cms_seeds.rake
kcyEtsTest2-0.0.2 lib/tasks/cms_seeds.rake
kcyEtsTest2-0.0.1 lib/tasks/cms_seeds.rake
kcyEtsTest-0.0.1 lib/tasks/cms_seeds.rake
kcyEtsTest-2.2.19 lib/tasks/cms_seeds.rake
ComfortableMexicanSofa-2.0.18 lib/tasks/cms_seeds.rake
kcy1-1.0 lib/tasks/cms_seeds.rake