instiki/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb
2007-01-22 07:43:50 -06:00

15 lines
365 B
Ruby

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