Sha256: 0e94d3afd996e339b19004a3010970c9e5b2bd9ddedb1c825c9875913df40d39

Contents?: true

Size: 612 Bytes

Versions: 46

Compression:

Stored size: 612 Bytes

Contents

namespace :db do
  namespace :dataset do
    desc "Load one or more datasets into the current environment's database using DATASETS=name,name"
    task :load => :environment do
      require 'dataset'
      dataset_names = (ENV['DATASETS'] || 'default').split(',')
      
      context = Class.new do
        extend Dataset::ContextClassMethods
        datasets_directory [
          "#{RAILS_ROOT}/spec/datasets",
          "#{RAILS_ROOT}/test/datasets"
        ].detect {|path| File.directory?(path)}
        add_dataset *dataset_names
        dataset_session.load_datasets_for self
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 8 rubygems

Version Path
dataset-1.3.2 tasks/dataset.rake
dataset-1.3.1 tasks/dataset.rake
radiant-0.8.1 vendor/plugins/dataset/tasks/dataset.rake
radiant-0.7.0 vendor/plugins/dataset/tasks/dataset.rake
radiant-0.8.0 vendor/plugins/dataset/tasks/dataset.rake
radiant-0.7.1 vendor/plugins/dataset/tasks/dataset.rake