Sha256: c63c4bbc6797935bb0da2effa22f00e834778a8a13219ee503d2112797dc602c

Contents?: true

Size: 620 Bytes

Versions: 6

Compression:

Stored size: 620 Bytes

Contents

binstubs_template_path = File.expand_path("../../install/binstubs.rb", __dir__).freeze
bin_path = ENV["BUNDLE_BIN"] || Rails.root.join("bin")

namespace :shakapacker do
  desc "Installs Shakapacker binstubs in this application"
  task binstubs: [:check_node, :check_yarn] do |task|
    prefix = task.name.split(/#|shakapacker:binstubs/).first

    if Rails::VERSION::MAJOR >= 5
      exec "#{RbConfig.ruby} #{bin_path}/rails #{prefix}app:template LOCATION='#{binstubs_template_path}'"
    else
      exec "#{RbConfig.ruby} #{bin_path}/rake #{prefix}rails:template LOCATION='#{binstubs_template_path}'"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shakapacker-7.0.2 lib/tasks/shakapacker/binstubs.rake
shakapacker-7.0.1 lib/tasks/shakapacker/binstubs.rake
shakapacker-7.0.0 lib/tasks/shakapacker/binstubs.rake
shakapacker-7.0.0.rc.2 lib/tasks/shakapacker/binstubs.rake
shakapacker-7.0.0.rc.1 lib/tasks/shakapacker/binstubs.rake
shakapacker-7.0.0.rc.0 lib/tasks/shakapacker/binstubs.rake