Class: Serverspec::Type::DefaultGateway
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::DefaultGateway
show all
- Defined in:
- lib/serverspec/type/default_gateway.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#interface ⇒ Object
10
11
12
13
14
|
# File 'lib/serverspec/type/default_gateway.rb', line 10
def interface
ret = backend.run_command(commands.check_routing_table('default'))
ret[:stdout] =~ /^(\S+)(?: via (\S+))? dev (\S+).+\r\n(?:default via (\S+))?/
$3
end
|
#ipaddress ⇒ Object
4
5
6
7
8
|
# File 'lib/serverspec/type/default_gateway.rb', line 4
def ipaddress
ret = backend.run_command(commands.check_routing_table('default'))
ret[:stdout] =~ /^(\S+)(?: via (\S+))? dev (\S+).+\r\n(?:default via (\S+))?/
$2 ? $2 : $4
end
|
#to_s ⇒ Object
16
17
18
|
# File 'lib/serverspec/type/default_gateway.rb', line 16
def to_s
'Default Gateway'
end
|