Sha256: 9fd01a4a7330162f34654232b8e4c0bd9d12a9bf7e9c9c2545c9397f58c3bcfa

Contents?: true

Size: 936 Bytes

Versions: 6

Compression:

Stored size: 936 Bytes

Contents

require 'rake/tasklib'

module Rake::Funnel::Tasks
  class Paket < Rake::TaskLib
    attr_accessor :name, :paket, :paket_args, :bootstrapper, :bootstrapper_args

    def initialize(name = :paket)
      @name = name

      @paket = File.join('.paket', 'paket.exe')
      @paket_args = 'restore'

      @bootstrapper = File.join('.paket', 'paket.bootstrapper.exe')
      @bootstrapper_args = nil

      yield self if block_given?
      define
    end

    private
    def define
      desc "#{paket_cmd.join(' ')} (optionally #{bootstrapper_cmd.join(' ')})"
      task name do
        sh(*bootstrapper_cmd) unless File.exist?(paket)
        sh(*paket_cmd)
      end

      self
    end

    def bootstrapper_cmd
      Rake::Funnel::Support::Mono.invocation(bootstrapper, bootstrapper_args)
    end

    def paket_cmd
      Rake::Funnel::Support::Mono.invocation(paket, paket_args)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rake-funnel-0.0.6.pre lib/rake/funnel/tasks/paket.rb
rake-funnel-0.0.5.pre lib/rake/funnel/tasks/paket.rb
rake-funnel-0.0.4.pre lib/rake/funnel/tasks/paket.rb
rake-funnel-0.0.3.pre lib/rake/funnel/tasks/paket.rb
rake-funnel-0.0.2.pre lib/rake/funnel/tasks/paket.rb
rake-funnel-0.0.1.pre lib/rake/funnel/tasks/paket.rb