X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=vendor%2Frails%2Factivesupport%2Flib%2Factive_support%2Fcore_ext%2Fpathname%2Fclean_within.rb;fp=vendor%2Frails%2Factivesupport%2Flib%2Factive_support%2Fcore_ext%2Fpathname%2Fclean_within.rb;h=ae03e1bc5a94dafefc9cfc9ce79d106f3f80f0e9;hb=d115f2e23823271635bad69229a42cd8ac68debe;hp=0000000000000000000000000000000000000000;hpb=37cb670bf3ddde90b214e591f100ed4446469484;p=depot.git diff --git a/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb b/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb new file mode 100644 index 0000000..ae03e1b --- /dev/null +++ b/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb @@ -0,0 +1,14 @@ +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