Sha256: 8937d70ff8c8555483ce5e3a3c6778d6dbf6c6093975f68dc849fc3fc565387f

Contents?: true

Size: 905 Bytes

Versions: 3

Compression:

Stored size: 905 Bytes

Contents

namespace :cohortly do
  namespace :run do
    desc "run the reports for all the tags"
    task :reseed_reports => :environment do
      Cohortly::ReportMeta.delete_all
      Cohortly::Metric.cohort_chart(nil, nil, true)
      puts "main report"
      real_tags = (Cohortly::Metric.collection.distinct(:tags) - Cohortly::TagConfig.all_groups)
      real_tags.each do |tag|
        Cohortly::Metric.cohort_chart([tag], nil, true)
        puts "tag: #{tag}"
      end
      Cohortly::TagConfig.all_groups.each do |group|
        real_tags.each do |tag|
          puts "tag: #{tag} group: #{group}"          
          Cohortly::Metric.cohort_chart([tag], [group], true)
        end        
      end
    end

    desc "update all existing reports"
    task :updates => :environment do
      Cohortly::ReportMeta.all.each do |rep|
        puts rep.collection_name
        rep.run
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cohortly-0.0.9.1 lib/tasks/run_reports.rake
cohortly-0.0.9 lib/tasks/run_reports.rake
cohortly-0.0.8 lib/tasks/run_reports.rake