Sha256: 3e69011f63eff739a712b20a6b5450e59872b0227a1cfe114005c6576d125a9d

Contents?: true

Size: 597 Bytes

Versions: 3

Compression:

Stored size: 597 Bytes

Contents

require Cardboard::Engine.root.join('lib/cardboard/helpers/seed.rb')

# Rake::Task['db:seed'].enhance do
#   Rake::Task['cardboard:seed'].invoke
# end


# Seed!
task 'cardboard:seed' => :environment do
  puts "Seeding Cardboard ..."
  begin
    file_hash = YAML.load(ERB.new(File.read(Rails.root.join('config', 'cardboard.yml'))).result).try(:with_indifferent_access)
  rescue Errno::ENOENT => e
    puts "Error: You must first create a cardboard.yml file in your application config folder"
  end


  Cardboard::Seed.populate_pages(file_hash)
  Cardboard::Seed.populate_settings(file_hash) 

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cardboard_cms-0.1.8 lib/tasks/cardboard_tasks.rake
cardboard_cms-0.1.6 lib/tasks/cardboard_tasks.rake
cardboard_cms-0.1.4 lib/tasks/cardboard_tasks.rake