Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorg and rework of matchers. Now we've extracted the creation of mat…
…chers to another module for more segmentation and easier creation of customer matchers
- Loading branch information
Mark Percival
committed
Feb 21, 2010
1 parent
12fddf0
commit 2056e31
Showing
8 changed files
with
98 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module DiviningRod | ||
class Matchers | ||
class << self | ||
|
||
def ua(pattern, opts = {}) | ||
Definition.new(opts) { |request| | ||
if pattern.match(request.user_agent) | ||
true | ||
end | ||
} | ||
end | ||
|
||
def subdomain(pattern, opts={}) | ||
Definition.new(opts) { |request| | ||
if pattern.match(request.subdomains[0]) | ||
true | ||
end | ||
} | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters