anchor.diff:  bind_method(Method, Method) ->
       true;
   bind_method(_, _) ->
  -    false. 
  +    false.
   
   
   %% @doc bind path. Using the rule from we try to bind variables given
  
positive.code:         path_parts=[DbName, <<"_design">>, DesignName, _Rewrite|PathParts],
          method=Method,
          mochi_req=MochiReq}=Req, _Db, DDoc) ->
      
      % we are in a design handler
      DesignId = <<"_design/", DesignName/binary>>,
      Prefix = <<"/", DbName/binary, "/", DesignId/binary>>,
      QueryList = couch_httpd:qs(Req),
      
      #doc{body={Props}} = DDoc,
      
      % get rules from ddoc
      case proplists:get_value(<<"rewrites">>, Props) of
          undefined ->
              couch_httpd:send_error(Req, 404, <<"rewrite_error">>, 
                              <<"Invalid path.">>);
          Rules ->
              % create dispatch list from rules
              DispatchList =  [make_rule(Rule) || {Rule} <- Rules],
              
              %% get raw path by matching url to a rule.
              RawPath = case try_bind_path(DispatchList, Method, PathParts, 
                                      QueryList) of
                  no_dispatch_path ->
                      throw(not_found);
                  {NewPathParts, Bindings} -> 
                      Parts = [mochiweb_util:quote_plus(X) || X <- NewPathParts],
                      
                      % build new path, reencode query args, eventually convert 
                      % them to json
                      Path = lists:append(
                          string:join(Parts, [?SEPARATOR]),
  
negative.code: %%  method: method to bind the request method to the rule. by default "*"
  %%  query: query args you want to define they can contain dynamic variable
  %% by binding the key to the bindings
  %%
  %%
  %% to and from are path with  patterns. pattern can be string starting with ":" or
  %% "*". ex:
  %% /somepath/:var/*
  %%
  %% This path is converted in erlang list by splitting "/". Each var are
  %% converted in atom. "*" is converted to '*' atom. The pattern matching is done
  %% by splitting "/" in request url in a list of token. A string pattern will
  %% match equal token. The star atom ('*' in single quotes) will match any number
  %% of tokens, but may only be present as the last pathtern in a pathspec. If all
  %% tokens are matched and all pathterms are used, then the pathspec matches. It works
  %% like webmachine. Each identified token will be reused in to rule and in query
  %%
  %% The pattern matching is done by first matching the request method to a rule. by
  %% default all methods match a rule. (method is equal to "*" by default). Then
  %% It will try to match the path to one rule. If no rule match, then a 404 error
  %% is displayed.
  %%
  %% Once a rule is found we rewrite the request url using the "to" and
  %% "query" members. The identified token are matched to the rule and
  %% will replace var. if '*' is found in the rule it will contain the remaining
  %% part if it exists.
  %%
  