Module: Squall
- Extended by:
- Squall
- Included in:
- Squall
- Defined in:
- lib/squall.rb,
lib/squall/disk.rb,
lib/squall/user.rb,
lib/squall/role.rb,
lib/squall/payment.rb,
lib/squall/network.rb,
lib/squall/template.rb,
lib/squall/whitelist.rb,
lib/squall/statistic.rb,
lib/squall/user_group.rb,
lib/squall/hypervisor.rb,
lib/squall/ip_address.rb,
lib/squall/transaction.rb,
lib/squall/support/base.rb,
lib/squall/network_zone.rb,
lib/squall/firewall_rule.rb,
lib/squall/support/config.rb,
lib/squall/hypervisor_zone.rb,
lib/squall/support/version.rb,
lib/squall/data_store_zone.rb,
lib/squall/ip_address_join.rb,
lib/squall/virtual_machine.rb,
lib/squall/support/exception.rb
Defined Under Namespace
Classes: Base, Config, DataStoreZone, Disk, FirewallRule, Hypervisor, HypervisorZone, IpAddress, IpAddressJoin, Network, NetworkZone, NoConfig, Payment, Role, Statistic, Template, Transaction, User, UserGroup, VirtualMachine, Whitelist
Constant Summary
- VERSION =
'1.3.0'
Instance Attribute Summary (collapse)
-
- (Object) configuration
Config.
-
- (Object) configuration_file
Config.
Instance Method Summary (collapse)
-
- (Object) config { ... }
Configures Squall.
-
- (void) config_file(file = File.expand_path("~/.squall.yml"))
Load the config from a YAML file.
-
- (Object) reset_config
Reset the config (aka, clear it).
Instance Attribute Details
- (Object) configuration
Config
35 36 37 |
# File 'lib/squall.rb', line 35 def configuration @configuration end |
- (Object) configuration_file
Config
38 39 40 |
# File 'lib/squall.rb', line 38 def configuration_file @configuration_file end |
Instance Method Details
- (Object) config { ... }
Configures Squall.
56 57 58 59 |
# File 'lib/squall.rb', line 56 def config yield self.configuration if block_given? self.configuration.config end |
- (void) config_file(file = File.expand_path("~/.squall.yml"))
This method returns an undefined value.
Load the config from a YAML file.
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/squall.rb', line 76 def config_file(file = File.("~/.squall.yml")) if File.exists?(file) self.configuration_file = file else raise ArgumentError, "Config file doesn't exist '#{file}'" end config do |c| YAML::load_file(file).each { |k, v| c.send(k, v) } end end |
- (Object) reset_config
Reset the config (aka, clear it)
91 92 93 |
# File 'lib/squall.rb', line 91 def reset_config self.configuration = Squall::Config.new end |