Sha256: c7c61e19bf8b6679ee7cdbc9d07098c8d72b641c7316507e3268190c2c459b1f

Contents?: true

Size: 1.31 KB

Versions: 21

Compression:

Stored size: 1.31 KB

Contents

require 'rake_dependencies'
require 'ruby_easy_rsa'
require 'rake_easy_rsa/version'
require 'rake_easy_rsa/tasks'
require 'rake_easy_rsa/task_sets'

module RakeEasyRSA
  def self.define_installation_tasks(opts = {})
    namespace = opts[:namespace] || :easy_rsa
    version = opts[:version] || '3.0.7'
    path = opts[:path] || File.join('vendor', 'easy-rsa')
    type = :tgz
    binary_directory = ''
    uri_template = 'https://github.com/OpenVPN/easy-rsa/releases/' +
        'download/v<%= @version %>/' +
        'EasyRSA-<%= @version %>.tgz'
    file_name_template = 'EasyRSA-<%= @version %>.tgz'
    strip_path_template = 'EasyRSA-<%= @version %>'

    task_set_opts = {
        namespace: namespace,
        dependency: 'easy-rsa',
        version: version,
        path: path,
        type: type,
        binary_directory: binary_directory,
        uri_template: uri_template,
        file_name_template: file_name_template,
        strip_path_template: strip_path_template,
        needs_fetch: lambda { |t|
          !File.exist?(File.join(t.path, 'easyrsa'))
        }}

    RubyEasyRSA.configure do |c|
      c.binary = File.join(path, 'easyrsa')
    end

    RakeDependencies::TaskSets::All.define(task_set_opts)
  end

  def self.define_pki_tasks(opts = {}, &block)
    RakeEasyRSA::TaskSets::PKI.define(opts, &block)
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rake_easy_rsa-0.12.0.pre.1 lib/rake_easy_rsa.rb
rake_easy_rsa-0.11.0 lib/rake_easy_rsa.rb
rake_easy_rsa-0.10.0.pre.6 lib/rake_easy_rsa.rb
rake_easy_rsa-0.10.0.pre.5 lib/rake_easy_rsa.rb
rake_easy_rsa-0.10.0.pre.4 lib/rake_easy_rsa.rb
rake_easy_rsa-0.10.0.pre.3 lib/rake_easy_rsa.rb
rake_easy_rsa-0.10.0.pre.2 lib/rake_easy_rsa.rb
rake_easy_rsa-0.10.0.pre.1 lib/rake_easy_rsa.rb
rake_easy_rsa-0.9.0 lib/rake_easy_rsa.rb
rake_easy_rsa-0.8.0.pre.1 lib/rake_easy_rsa.rb
rake_easy_rsa-0.7.0 lib/rake_easy_rsa.rb
rake_easy_rsa-0.6.0.pre.2 lib/rake_easy_rsa.rb
rake_easy_rsa-0.6.0.pre.1 lib/rake_easy_rsa.rb
rake_easy_rsa-0.5.0 lib/rake_easy_rsa.rb
rake_easy_rsa-0.4.0.pre.1 lib/rake_easy_rsa.rb
rake_easy_rsa-0.3.0 lib/rake_easy_rsa.rb
rake_easy_rsa-0.2.0.pre.11 lib/rake_easy_rsa.rb
rake_easy_rsa-0.2.0.pre.10 lib/rake_easy_rsa.rb
rake_easy_rsa-0.2.0.pre.9 lib/rake_easy_rsa.rb
rake_easy_rsa-0.2.0.pre.8 lib/rake_easy_rsa.rb