lib/roda/plugins/path.rb in roda-1.3.0 vs lib/roda/plugins/path.rb in roda-2.0.0

- old
+ new

@@ -30,13 +30,14 @@ # Note that if :add_script_name, :url, or :url_only is used, this will also create a <tt>_*_path</tt> # method. This is necessary in order to support path methods that accept blocks, as you can't pass # a block to a block that is instance_execed. module Path DEFAULT_PORTS = {'http' => 80, 'https' => 443}.freeze + OPTS = {}.freeze module ClassMethods # Create a new instance method for the named path. See plugin module documentation for options. - def path(name, path=nil, opts={}, &block) + def path(name, path=nil, opts=OPTS, &block) if path.is_a?(Hash) raise RodaError, "cannot provide two option hashses to Roda.path" unless opts.empty? opts = path path = nil end