Class: Ant::SSL::Inventory

Inherits:
Object
  • Object
show all
Defined in:
lib/ant/ssl/inventory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(defaults, auth, clients, servers) ⇒ Inventory

Returns a new instance of Inventory.



12
13
14
15
16
17
# File 'lib/ant/ssl/inventory.rb', line 12

def initialize(defaults, auth, clients, servers)
  @defaults = defaults
  @authorities = SubInventory.new(auth, self)
  @clients = SubInventory.new(clients, self)
  @servers = SubInventory.new(servers, self)
end

Instance Attribute Details

#defaultsObject (readonly)

Returns the value of attribute defaults.



10
11
12
# File 'lib/ant/ssl/inventory.rb', line 10

def defaults
  @defaults
end

Instance Method Details

#ca(name) ⇒ Object



33
34
35
# File 'lib/ant/ssl/inventory.rb', line 33

def ca(name)
  @authorities.ca(name)
end

#create_certificates!Object



19
20
21
22
23
# File 'lib/ant/ssl/inventory.rb', line 19

def create_certificates!
  validate_inventories!
  create_directory!
  [@authorities, @clients, @servers].each(&:create_certificates!)
end

#create_directory!Object



29
30
31
# File 'lib/ant/ssl/inventory.rb', line 29

def create_directory!
  FileUtils.mkdir_p(@defaults['saving_directory'])
end

#validate_inventories!Object



25
26
27
# File 'lib/ant/ssl/inventory.rb', line 25

def validate_inventories!
  true
end