module Flucti module Resources class PortForwarding < BasicResource belongs_to :container def service_name matcher = %r{^(.+?) +#{to}/#{protocol.to_s.downcase}\b} IO.foreach(__FILE__.sub(/\.rb$/, '') + '/services') do |line| return $1.upcase if matcher =~ line end nil end end end end