lib/odania.rb in odania-0.0.13 vs lib/odania.rb in odania-0.0.14

- old
+ new

@@ -1,10 +1,11 @@ require 'odania/version' require 'diplomat' module Odania CORE_PLUGIN_NAME = 'odania-core' + INTERNAL_VARNISH_NAME = 'odania-varnish-internal' autoload :Consul, 'odania/consul' autoload :Service, 'odania/service' autoload :Plugin, 'odania/plugin' @@ -39,7 +40,11 @@ Socket.ip_address_list.each do |address| ip = address.ip_address ips << ip unless %w(127.0.0.1 ::1).include? ip end ips + end + + def self.varnish_sanitize(name) + name.gsub(/[^0-9a-zA-Z_]/, '_') end end