instiki/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb

15 lines
365 B
Ruby
Raw Normal View History

2007-01-22 14:43:50 +01:00
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Pathname #:nodoc:
module CleanWithin
# Clean the paths contained in the provided string.
def clean_within(string)
string.gsub(%r{[\w. ]+(/[\w. ]+)+(\.rb)?(\b|$)}) do |path|
new(path).cleanpath
end
end
end
end
end
end