Skip to content

Commit

Permalink
Made match_routing a class method, so that it can be called from outs…
Browse files Browse the repository at this point in the history
…ide (useful for building authorization around Grack).
  • Loading branch information
Dawa Ometto committed Jun 2, 2013
1 parent de163af commit 81535fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def call(env)
@env = env
@req = Rack::Request.new(env)

cmd, path, @reqfile, @rpc = match_routing(@req)
cmd, path, @reqfile, @rpc = self.class.match_routing(@req)

return render_method_not_allowed if cmd == 'not_allowed'
return render_not_found if !cmd
Expand Down Expand Up @@ -186,7 +186,7 @@ def get_service_type
service_type.gsub('git-', '')
end

def match_routing(req)
def self.match_routing(req)
cmd = nil
path = nil
SERVICES.each do |method, handler, match, rpc|
Expand Down

0 comments on commit 81535fc

Please sign in to comment.