lib/elastic_apm/config/options.rb in elastic-apm-3.0.0 vs lib/elastic_apm/config/options.rb in elastic-apm-3.1.0

- old
+ new

@@ -46,10 +46,11 @@ when :int then val.to_i when :float then val.to_f when :bool then normalize_bool(val) when :list then normalize_list(val) when :dict then normalize_dict(val) + when :url then normalize_url(val) else # raise "Unknown options type '#{type.inspect}'" val end end @@ -66,9 +67,14 @@ end def normalize_dict(val) return val unless val.is_a?(String) Hash[val.split(/[&,]/).map { |kv| kv.split('=') }] + end + + def normalize_url(val) + val = val.to_s + val.end_with?('/') ? val.chomp('/') : val end end # @api private module ClassMethods