Class: Binding

Inherits:
Object
  • Object
show all
Defined in:
lib/rapid-vaults/binding.rb

Overview

class to output bindings with other software

Constant Summary collapse

CRYPT =

bindings matrix consts

%w[gpg ssl].freeze
ACTION =
%w[encrypt decrypt].freeze

Class Method Summary collapse

Class Method Details

.chef(settings) ⇒ Object

outputs chef bindings



19
20
21
22
23
# File 'lib/rapid-vaults/binding.rb', line 19

def self.chef(settings)
  # output chef bindings to output directory
  content = File.read("#{__dir__}/bindings/chef.rb")
  File.write("#{settings[:outdir]}chef.rb", content)
end

.puppet(settings) ⇒ Object

outputs puppet bindings



8
9
10
11
12
13
14
15
16
# File 'lib/rapid-vaults/binding.rb', line 8

def self.puppet(settings)
  # output puppet bindings to output directory
  CRYPT.each do |algo|
    ACTION.each do |action|
      content = File.read("#{__dir__}/bindings/puppet_#{algo}_#{action}.rb")
      File.write("#{settings[:outdir]}puppet_#{algo}_#{action}.rb", content)
    end
  end
end