Sha256: a3c69dcaa1fea18b200270ca1f60517e7acce4833b34b261adc7f42e398c5a96

Contents?: true

Size: 422 Bytes

Versions: 30

Compression:

Stored size: 422 Bytes

Contents

# frozen_string_literal: true

namespace :codebook do

  desc "Export all questionnaire codebooks to tmp/codebooks/$key.txt"
  task :export => :environment do
    system("mkdir -p #{Rails.root}/tmp/codebooks")
    
    Questionnaire.all.each do |questionnaire|
      File.open("#{Rails.root}/tmp/codebooks/#{questionnaire.key}.txt", "w") do |file|
        file.puts(questionnaire.to_codebook)
      end
    end
  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
quby-5.6.1 lib/tasks/codebook.rake
quby-5.6.0 lib/tasks/codebook.rake
quby-5.5.0 lib/tasks/codebook.rake
quby-5.4.0 lib/tasks/codebook.rake
quby-5.3.1 lib/tasks/codebook.rake
quby-5.3.0 lib/tasks/codebook.rake
quby-5.2.0 lib/tasks/codebook.rake
quby-5.1.3 lib/tasks/codebook.rake
quby-5.1.2 lib/tasks/codebook.rake
quby-5.1.1 lib/tasks/codebook.rake
quby-5.1.0 lib/tasks/codebook.rake
quby-5.0.5 lib/tasks/codebook.rake
quby-5.0.4 lib/tasks/codebook.rake
quby-5.0.3 lib/tasks/codebook.rake
quby-5.0.2 lib/tasks/codebook.rake
quby-5.0.1 lib/tasks/codebook.rake
quby-5.0.0 lib/tasks/codebook.rake
quby-4.0.4 lib/tasks/codebook.rake
quby-5.0.0.pre4 lib/tasks/codebook.rake
quby-5.0.0.pre3 lib/tasks/codebook.rake