Class: RHosts::Filer::Mapping

Inherits:
Object
  • Object
show all
Defined in:
lib/rhosts/filer.rb

Class Method Summary collapse

Class Method Details

.active?(line) ⇒ Boolean

Returns:

  • (Boolean)


105
106
107
# File 'lib/rhosts/filer.rb', line 105

def active?(line)
  line !~ /^#/
end

.parse(line, &block) ⇒ Object



109
110
111
112
# File 'lib/rhosts/filer.rb', line 109

def parse(line, &block)
  ip, *hosts = line.chomp.sub(/^#+\s*/, '').split(/\s+/)
  block.call(ip, hosts)
end