Class: Ant::SSL::Inventory
- Inherits:
-
Object
- Object
- Ant::SSL::Inventory
- Defined in:
- lib/ant/ssl/inventory.rb
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
Instance Method Summary collapse
- #ca(name) ⇒ Object
- #create_certificates! ⇒ Object
- #create_directory! ⇒ Object
-
#initialize(defaults, auth, clients, servers) ⇒ Inventory
constructor
A new instance of Inventory.
- #validate_inventories! ⇒ Object
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
#defaults ⇒ Object (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 |