Sha256: 8313b7d39bc7a578987c130262315d885085ecd495fc805b4a7f07271ed66ff3

Contents?: true

Size: 957 Bytes

Versions: 14

Compression:

Stored size: 957 Bytes

Contents

# frozen_string_literal: true

require 'rake_factory'
require 'ruby_easy_rsa'

require_relative '../mixins/global_parameters'
require_relative '../mixins/ssl_parameters'
require_relative '../mixins/gitkeep_parameters'
require_relative '../mixins/easy_rsa_ensure_prerequisite'

module RakeEasyRSA
  module Tasks
    class Initialise < RakeFactory::Task
      include Mixins::GlobalParameters
      include Mixins::SSLParameters
      include Mixins::GitkeepParameters
      include Mixins::EasyRSAEnsurePrerequisite

      default_name :initialise
      default_description 'Initialise the PKI working directory'

      action do |t|
        puts 'Initialising PKI working directory... '
        RubyEasyRSA.init_pki(t.parameter_values)
        if t.include_gitkeep_files
          File.write("#{t.pki_directory}/private/.gitkeep", '')
          File.write("#{t.pki_directory}/reqs/.gitkeep", '')
        end
        puts 'Done.'
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rake_easy_rsa-0.16.0.pre.2 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.16.0.pre.1 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.15.0 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.14.0.pre.7 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.14.0.pre.6 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.14.0.pre.5 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.14.0.pre.4 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.14.0.pre.3 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.14.0.pre.2 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.14.0.pre.1 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.13.0 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.12.0.pre.4 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.12.0.pre.3 lib/rake_easy_rsa/tasks/initialise.rb
rake_easy_rsa-0.12.0.pre.2 lib/rake_easy_rsa/tasks/initialise.rb