Class: Slugforge::AwsTagGroup
- Defined in:
- lib/slugforge/models/host_group/aws_tag_group.rb
Instance Attribute Summary
Attributes inherited from HostGroup
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(pattern, compute) ⇒ AwsTagGroup
constructor
A new instance of AwsTagGroup.
Methods inherited from HostGroup
detect, discover, #hosts_for_action, #install_all, #install_number_of_hosts, #install_percent_of_hosts, #sorted_hosts, #success?
Constructor Details
#initialize(pattern, compute) ⇒ AwsTagGroup
Returns a new instance of AwsTagGroup.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/slugforge/models/host_group/aws_tag_group.rb', line 11 def initialize(pattern, compute) matches = self.class.matcher.match(pattern) return nil unless matches @hosts = compute.servers.select do |server| server.[matches[1]] == matches[2] && !server.public_ip_address.nil? end.map do |server| FogHost.new(pattern, server) end super end |
Class Method Details
.matcher ⇒ Object
7 8 9 |
# File 'lib/slugforge/models/host_group/aws_tag_group.rb', line 7 def self.matcher /^(\w+)=(\w+)$/ end |