Sha256: ff061d4a743b48a09710eae87f45914189aef096536f872a34e35f6346fb72ca

Contents?: true

Size: 817 Bytes

Versions: 5

Compression:

Stored size: 817 Bytes

Contents

namespace :card do
  namespace :mod do
    desc "symlink from deck public/{modname} to mod's public directory"
    task symlink: :environment do
      FileUtils.rm_rf public_mod_dir
      FileUtils.mkdir_p public_mod_dir
      Cardio::Mod.dirs.each_public_path do |mod, target|
        link = public_mod_dir mod
        FileUtils.rm_rf link
        FileUtils.ln_sf target, link
      end
    end

    desc "install all mods"
    task install: :environment do
      Card::Machine.reset_script
      Card::Cache.reset_all
      puts "installing card mods".green
      Cardio::Mod.dirs.mods.each do |mod|
        mod.ensure_mod_installed
        Card::Cache.reset_all
      end
    end

    def public_mod_dir subdir=nil
      parts = [Rails.public_path, "mod", subdir].compact
      File.join(*parts)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
card-1.103.4 lib/tasks/card/mod.rake
card-1.103.3 lib/tasks/card/mod.rake
card-1.103.2 lib/card/tasks/card/mod.rake
card-1.103.1 lib/card/tasks/card/mod.rake
card-1.103.0 lib/card/tasks/card/mod.rake