Sha256: 9b3909e4b206164668c4f01ed26d60eea4d0e4df0c41b0e0385b8f0a2640396f

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

require 'rake_dependencies'
require 'ruby_fly'
require 'rake_fly/version'
require 'rake_fly/tasklib'
require 'rake_fly/tasks'

module RakeFly
  include RubyFly

  def self.define_installation_tasks(opts = {})
    namespace = opts[:namespace] || :fly
    version = opts[:version] || '2.7.0'
    path = opts[:path] || File.join('vendor', 'fly')

    RubyFly.configure do |c|
      c.binary = File.join(path, 'bin', 'fly')
    end
    RakeDependencies::Tasks::All.new do |t|
      t.namespace = namespace
      t.dependency = 'fly'
      t.version = version
      t.path = path
      t.type = :uncompressed

      t.os_ids = {mac: 'darwin', linux: 'linux'}

      t.uri_template = "https://github.com/concourse/concourse/releases/" +
          "download/v<%= @version %>/fly_<%= @os_id %>_amd64"
      t.file_name_template = "fly_<%= @os_id %>_amd64"

      t.source_binary_name_template = "fly_<%= @os_id %>_amd64"
      t.target_binary_name_template = 'fly'

      t.needs_fetch = lambda do |parameters|
        fly_binary = File.join(
            parameters[:path], parameters[:binary_directory], 'fly')

        !(File.exist?(fly_binary) && RubyFly.version == version)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rake_fly-0.17.0 lib/rake_fly.rb
rake_fly-0.16.0.pre.pre.1 lib/rake_fly.rb
rake_fly-0.15.0 lib/rake_fly.rb
rake_fly-0.14.0.pre.pre.2 lib/rake_fly.rb
rake_fly-0.14.0.pre.pre.1 lib/rake_fly.rb
rake_fly-0.13.0 lib/rake_fly.rb
rake_fly-0.12.0.pre.pre.2 lib/rake_fly.rb
rake_fly-0.12.0.pre.pre.1 lib/rake_fly.rb
rake_fly-0.11.0 lib/rake_fly.rb
rake_fly-0.10.0.pre.pre.1 lib/rake_fly.rb
rake_fly-0.9.0 lib/rake_fly.rb
rake_fly-0.8.1.pre1 lib/rake_fly.rb
rake_fly-0.8.0 lib/rake_fly.rb
rake_fly-0.7.1.pre1 lib/rake_fly.rb