diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/pathname')
-rw-r--r-- | activesupport/lib/active_support/core_ext/pathname/clean_within.rb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/activesupport/lib/active_support/core_ext/pathname/clean_within.rb b/activesupport/lib/active_support/core_ext/pathname/clean_within.rb index ae03e1bc5a..89690252b1 100644 --- a/activesupport/lib/active_support/core_ext/pathname/clean_within.rb +++ b/activesupport/lib/active_support/core_ext/pathname/clean_within.rb @@ -1,14 +1,10 @@ -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 +require 'pathname' + +class Pathname + # Clean the paths contained in the provided string. + def self.clean_within(string) + string.gsub(%r{[\w. ]+(/[\w. ]+)+(\.rb)?(\b|$)}) do |path| + new(path).cleanpath end end end |