ENVied.require(*ENV["ENVIED_GROUPS"] || Rails.groups) class ApplicationConfig URI_REGEXP = %r{(?https?://)?(?.+?)(?:\d+)?$}.freeze def self.[](key) ENVied.send(key) end def self.app_domain_no_port app_domain = self["APP_DOMAIN"] match = app_domain.match(URI_REGEXP) match[:host] end end