Module: Dory::Resolv

Defined in:
lib/dory/resolv.rb,
lib/dory/resolv/linux.rb,
lib/dory/resolv/macos.rb,
lib/dory/resolv/linux_resolvconf.rb

Defined Under Namespace

Modules: Linux, LinuxResolvconf, Macos

Class Method Summary collapse

Class Method Details

.cleanObject



24
25
26
# File 'lib/dory/resolv.rb', line 24

def self.clean
  self.get_module.clean
end

.configureObject



16
17
18
# File 'lib/dory/resolv.rb', line 16

def self.configure
  self.get_module.configure
end

.file_nameserver_lineObject



20
21
22
# File 'lib/dory/resolv.rb', line 20

def self.file_nameserver_line
  self.get_module.file_nameserver_line
end

.get_moduleObject



6
7
8
9
10
# File 'lib/dory/resolv.rb', line 6

def self.get_module
  return Dory::Resolv::Macos if Os.macos?
  return Dory::Resolv::LinuxResolvconf if self.resolvconf?
  Dory::Resolv::Linux
end

.has_our_nameserver?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/dory/resolv.rb', line 12

def self.has_our_nameserver?
  self.get_module.has_our_nameserver?
end

.resolvconf?Boolean

Returns:

  • (Boolean)


28
29
30
31
# File 'lib/dory/resolv.rb', line 28

def self.resolvconf?
  Pathname.new('/etc/resolv.conf').realpath.to_s ==
    '/run/resolvconf/resolv.conf'
end