File: active_support/core_ext/pathname/clean_within.rb

Overview
Module Structure
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: ActiveSupport#1
  module: CoreExtensions#2
  module: Pathname#3
  module: CleanWithin#4
has properties
method: clean_within / 1 #6

Code

   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