Class: SeleniumGrid::AWS::Cloud

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium-grid/examples/ec2/lib/selenium_grid/aws/cloud.rb

Constant Summary collapse

FILE =
"cloud.yml"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#farmsObject

Returns the value of attribute farms.



6
7
8
# File 'lib/selenium-grid/examples/ec2/lib/selenium_grid/aws/cloud.rb', line 6

def farms
  @farms
end

#hubObject

Returns the value of attribute hub.



6
7
8
# File 'lib/selenium-grid/examples/ec2/lib/selenium_grid/aws/cloud.rb', line 6

def hub
  @hub
end

Class Method Details

.loadObject



8
9
10
11
12
13
14
# File 'lib/selenium-grid/examples/ec2/lib/selenium_grid/aws/cloud.rb', line 8

def self.load
  begin
    YAML.load(File.read(FILE))
  rescue Errno::ENOENT
    new
  end
end

.updateObject



16
17
18
19
20
21
# File 'lib/selenium-grid/examples/ec2/lib/selenium_grid/aws/cloud.rb', line 16

def self.update
  cloud = self.load
  yield cloud
ensure
  cloud.write unless cloud.nil?
end

Instance Method Details

#writeObject



23
24
25
# File 'lib/selenium-grid/examples/ec2/lib/selenium_grid/aws/cloud.rb', line 23

def write 
  File.open(FILE, "w") {|file| file.write(self.to_yaml)}
end