Sha256: 1c4b7db4e83db4d5160a457d4f3a0a98d5524866cd87e4da4cbaa7600d6239de

Contents?: true

Size: 1.57 KB

Versions: 19

Compression:

Stored size: 1.57 KB

Contents

namespace :panda_pal do
  desc 'Cleans up old session data'
  task clean_sessions: :environment do
    PandaPal::Session.where('updated_at < ?', 1.week.ago).delete_all
  end

  namespace :org do
    desc "Interactively Create a new PandaPal::Organization"
    task :new, [:name] => :environment do |t, args|
      org = PandaPal::Organization.new(name: args[:name])
      PandaPal::Organization.interactive_create!(org)
    rescue PandaPal::OrganizationConcerns::OrganizationBuilder::InteractiveSessionError => ex
      ex.print
    end

    desc "Interactively Update a PandaPal::Organization"
    task :edit, [:name] => :environment do |t, args|
      org = PandaPal::Organization.find_by!(name: args[:name])
      org.interactive_update!
    rescue PandaPal::OrganizationConcerns::OrganizationBuilder::InteractiveSessionError => ex
      ex.print
    end

    desc "Install/update the LTI in Canvas for the given Organization"
    task :install, [:name, :host] => :environment do |t, args|
      org = PandaPal::Organization.find_by!(name: args[:name])
      org.interactive_install!(host: args[:host], exists: :update)
    end

    desc "Reinstall the LTI in Canvas for the given Organization"
    task :reinstall, [:name, :host] => :environment do |t, args|
      org = PandaPal::Organization.find_by!(name: args[:name])
      org.interactive_install!(host: args[:host], exists: :replace)
    end

    if Rails.env.development?
      desc "Creates a new PandaPal::Organization for development"
      task dev: :environment do
        PandaPal::Organization.development_create!
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
panda_pal-5.12.7 lib/tasks/panda_pal_tasks.rake
panda_pal-5.12.6 lib/tasks/panda_pal_tasks.rake
panda_pal-5.12.5 lib/tasks/panda_pal_tasks.rake
panda_pal-5.12.4 lib/tasks/panda_pal_tasks.rake
panda_pal-5.12.3 lib/tasks/panda_pal_tasks.rake
panda_pal-5.12.2 lib/tasks/panda_pal_tasks.rake
panda_pal-5.12.1 lib/tasks/panda_pal_tasks.rake
panda_pal-5.12.0 lib/tasks/panda_pal_tasks.rake
panda_pal-5.11.0 lib/tasks/panda_pal_tasks.rake
panda_pal-5.10.1 lib/tasks/panda_pal_tasks.rake
panda_pal-5.10.0 lib/tasks/panda_pal_tasks.rake
panda_pal-5.9.8.beta1 lib/tasks/panda_pal_tasks.rake
panda_pal-5.9.7 lib/tasks/panda_pal_tasks.rake
panda_pal-5.9.6 lib/tasks/panda_pal_tasks.rake
panda_pal-5.9.5 lib/tasks/panda_pal_tasks.rake
panda_pal-5.9.4 lib/tasks/panda_pal_tasks.rake
panda_pal-5.9.3 lib/tasks/panda_pal_tasks.rake
panda_pal-5.9.1 lib/tasks/panda_pal_tasks.rake
panda_pal-5.9.0 lib/tasks/panda_pal_tasks.rake