From a4e3aac40a7545285e4d1ccd78adfc41ca3d5f83 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 28 Feb 2009 16:48:14 -0800 Subject: * Introduce ActiveSupport.core_ext Integer, %w(conversions time etc) * Convert some extension modules to simply reopening the class * Remove deprecated Float time extensions * Fold Base64 extension into ActiveSupport::Base64 since stdlib Base64 is gone --- .../active_support/core_ext/pathname/clean_within.rb | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/pathname') 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 -- cgit v1.2.3