Module: Pipark

Defined in:
lib/pipark.rb,
lib/pipark/host.rb,
lib/pipark/version.rb

Defined Under Namespace

Classes: Host

Constant Summary collapse

VERSION =

pipark version.

'0.4.0'

Class Method Summary collapse

Class Method Details

.host(address) ⇒ Object Also known as: pi

Creates a Host object for the address.



6
7
8
# File 'lib/pipark/host.rb', line 6

def host(address)
  Host.new(address)
end

.localhostObject

Creates a Host object for localhost.



13
14
15
# File 'lib/pipark/host.rb', line 13

def localhost
  host 'localhost'
end

.pingable?(address) ⇒ Boolean

Returns true if the address can be pinged.

Returns:

  • (Boolean)


18
19
20
# File 'lib/pipark/host.rb', line 18

def pingable?(address)
  system "ping -c 1 #{address} > /dev/null 2>&1"
end

.versionObject

Returns Pipark::VERSION.



7
8
9
# File 'lib/pipark/version.rb', line 7

def self.version
  VERSION
end