aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/regexp.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-10-19 23:32:06 -0500
committerJoshua Peek <josh@joshpeek.com>2009-10-19 23:32:17 -0500
commita1df2590744ed126981dfd5b5709ff6fd5dc6476 (patch)
tree1c01e2ba7465f554a2470155c46c0309dfe7615f /activesupport/lib/active_support/core_ext/regexp.rb
parentcbedcb06152ed6d7e7457334cd45af5ab24ef6ea (diff)
downloadrails-a1df2590744ed126981dfd5b5709ff6fd5dc6476.tar.gz
rails-a1df2590744ed126981dfd5b5709ff6fd5dc6476.tar.bz2
rails-a1df2590744ed126981dfd5b5709ff6fd5dc6476.zip
Replace decaying routing internals w/ rack-mount
Diffstat (limited to 'activesupport/lib/active_support/core_ext/regexp.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/regexp.rb22
1 files changed, 0 insertions, 22 deletions
diff --git a/activesupport/lib/active_support/core_ext/regexp.rb b/activesupport/lib/active_support/core_ext/regexp.rb
index 95d06ee6ee..784145f5fb 100644
--- a/activesupport/lib/active_support/core_ext/regexp.rb
+++ b/activesupport/lib/active_support/core_ext/regexp.rb
@@ -1,27 +1,5 @@
class Regexp #:nodoc:
- def number_of_captures
- Regexp.new("|#{source}").match('').captures.length
- end
-
def multiline?
options & MULTILINE == MULTILINE
end
-
- class << self
- def optionalize(pattern)
- return pattern if pattern == ""
-
- case unoptionalize(pattern)
- when /\A(.|\(.*\))\Z/ then "#{pattern}?"
- else "(?:#{pattern})?"
- end
- end
-
- def unoptionalize(pattern)
- [/\A\(\?:(.*)\)\?\Z/, /\A(.|\(.*\))\?\Z/].each do |regexp|
- return $1 if regexp =~ pattern
- end
- return pattern
- end
- end
end