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