Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sinatra/sinatra.github.com
Browse files Browse the repository at this point in the history
Conflicts:
	_includes/README.html
	_includes/README.zh.html
  • Loading branch information
rkh committed Apr 11, 2011
2 parents b8062f4 + cb0c8bd commit c9bb1f5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
10 changes: 10 additions & 0 deletions _includes/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,23 @@ <h3>Custom Route Matchers</h3>
@captures = Match.new([])
end

<<<<<<< HEAD
def match(str)
@captures unless @except === str
end
end

def all_but(pattern)
AllButPattern.new(pattern)
=======
def initialize(except)
@except = except
@captures = Match.new([])
end

def match(str)
@captures unless @except === str
>>>>>>> cb0c8bddc098d0435c2b999d5e3071889163a1c7
end

get all_but(&quot;/index&quot;) do
Expand Down
17 changes: 17 additions & 0 deletions _includes/README.zh.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,30 @@ <h3>自定义路由匹配器</h3>
@captures = Match.new([])
end

<<<<<<< HEAD
def match(str)
@captures unless @except === str
end
end

def all_but(pattern)
AllButPattern.new(pattern)
=======
<p>如上显示,Sinatra内置了对于使用字符串和正则表达式作为路由匹配的支持。
但是,它并没有只限于此。
你可以非常容易地定义你自己的匹配器:</p>

<pre>class AllButPattern
Match = Struct.new(:captures)

def initialize(except)
@except = except
@captures = Match.new([])
end

def match(str)
@captures unless @except === str
>>>>>>> cb0c8bddc098d0435c2b999d5e3071889163a1c7
end

get all_but(&quot;/index&quot;) do
Expand Down
5 changes: 3 additions & 2 deletions wild.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ layout: default

*NOTE:* Feel free to fork
[Sinatra's website on GitHub](http://github.com/sinatra/sinatra.github.com)
and add your own entry to the `wild.markdown` file. Just push and we'll take
care of the rest.
and add your own entry to the `wild.markdown` file. Just push and send a pull request.
We'll take care of the rest.

Applications {#apps}
------------
Expand Down Expand Up @@ -84,6 +84,7 @@ Applications {#apps}
- [Brakes](http://github.com/rdnck76/brakes) a simple sinatra app for hosting static html on heroku.
- [Fundry - Crowdfunding for Software Development](http://fundry.com) - Fundry is designed around software projects, helping developers get paid for developing new features, and enabling your community to pledge to get the features they want. The site and API (coming soon) is all written in Sinatra.
- [Picky](http://github.com/floere/picky) - a fast &amp; clever semantic search engine.
- [Headhunter](http://headhunter.heroku.com) - giving Twitter profile pics a permanent URL

Libraries and extensions {#libs}
------------------------
Expand Down

0 comments on commit c9bb1f5

Please sign in to comment.