confirm port is an integer
[github-services.git] / vendor / activesupport-2.2.2 / lib / active_support / core_ext / pathname / clean_within.rb
blobae03e1bc5a94dafefc9cfc9ce79d106f3f80f0e9
1 module ActiveSupport #:nodoc:
2   module CoreExtensions #:nodoc:
3     module Pathname #:nodoc:
4       module CleanWithin
5         # Clean the paths contained in the provided string.
6         def clean_within(string)
7           string.gsub(%r{[\w. ]+(/[\w. ]+)+(\.rb)?(\b|$)}) do |path|
8             new(path).cleanpath
9           end
10         end
11       end
12     end
13   end
14 end