Sha256: 9852e513bd83cfdfdc186c7f1cff0de7be20fe2355ab59ea570b89d8d621d132

Contents?: true

Size: 605 Bytes

Versions: 12

Compression:

Stored size: 605 Bytes

Contents

# frozen_string_literal: true

namespace :assets do
  describe "Update external assets"
  argument :asset, "The asset to update", required: false
  task :update, [:app, :asset] do |_, args|
    require "pakyow/assets/errors"
    require "pakyow/assets/external"

    scripts = if args.key?(:asset)
      [args[:app].config.assets.externals.scripts.find { |script|
        script.name == args[:asset].to_sym
      } || raise(Pakyow::Assets::UnknownExternalAsset.new_with_message(asset: args[:asset]))]
    else
      args[:app].config.assets.externals.scripts
    end

    scripts.each(&:fetch!)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pakyow-assets-1.0.6 lib/pakyow/tasks/assets/update.rake
pakyow-assets-1.0.5 lib/pakyow/tasks/assets/update.rake
pakyow-assets-1.0.4 lib/pakyow/tasks/assets/update.rake
pakyow-assets-1.0.3 lib/pakyow/tasks/assets/update.rake
pakyow-assets-1.0.2 lib/pakyow/tasks/assets/update.rake
pakyow-assets-1.0.1 lib/pakyow/tasks/assets/update.rake
pakyow-assets-1.0.0 lib/pakyow/tasks/assets/update.rake
pakyow-assets-1.0.0.rc5 lib/pakyow/assets/tasks/update.rake
pakyow-assets-1.0.0.rc4 lib/pakyow/assets/tasks/update.rake
pakyow-assets-1.0.0.rc3 lib/pakyow/assets/tasks/update.rake
pakyow-assets-1.0.0.rc2 lib/pakyow/assets/tasks/update.rake
pakyow-assets-1.0.0.rc1 lib/pakyow/assets/tasks/update.rake