Sha256: a08337645370f68e690a38d305c4946a48cb50c98c4c23c29c649847103c0c3d

Contents?: true

Size: 810 Bytes

Versions: 11

Compression:

Stored size: 810 Bytes

Contents

namespace :bullet_train do
  desc "Symlink registered gems in `./tmp/gems` so their views, etc. can be inspected by Tailwind CSS."
  task :link_gems => :environment do
    if Dir.exists?("tmp/gems")
      puts "Removing previously linked gems."
      `rm -f tmp/gems/*`
    else
      if File.exists?("tmp/gems")
        raise "A file named `tmp/gems` already exists? It has to be removed before we can create the required directory."
      end

      puts "Creating 'tmp/gems' directory."
      `mkdir tmp/gems`
    end

    `touch tmp/gems/.keep`

    BulletTrain.linked_gems.each do |linked_gem|
      target = `bundle show #{linked_gem}`.chomp
      if target.present?
        puts "Linking '#{linked_gem}' to '#{target}'."
        puts `ln -s #{target} tmp/gems/#{linked_gem}`
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bullet_train-1.0.28 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.27 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.26 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.25 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.24 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.23 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.22 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.21 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.20 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.19 lib/tasks/bullet_train_tasks.rake
bullet_train-1.0.18 lib/tasks/bullet_train_tasks.rake