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.0.0.pre2 lib/tasks/codebook.rake
quby-5.0.0.pre1 lib/tasks/codebook.rake
quby-4.0.3 lib/tasks/codebook.rake
quby-4.0.2 lib/tasks/codebook.rake
quby-4.0.1 lib/tasks/codebook.rake
quby-4.0.0 lib/tasks/codebook.rake
quby-3.2.2 lib/tasks/codebook.rake
quby-3.2.1 lib/tasks/codebook.rake
quby-3.2.0 lib/tasks/codebook.rake
quby-3.2.0.pre.pre1 lib/tasks/codebook.rake