diff options
Diffstat (limited to 'lib/redmine/scm/adapters/abstract_adapter.rb')
-rw-r--r-- | lib/redmine/scm/adapters/abstract_adapter.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb index 0ad3d7f45..6edc9c9de 100644 --- a/lib/redmine/scm/adapters/abstract_adapter.rb +++ b/lib/redmine/scm/adapters/abstract_adapter.rb @@ -161,21 +161,31 @@ module Redmine path.start_with?('/') ? path : "/#{path}" end - def with_trailling_slash(path) + def with_trailing_slash(path) path ||= '' path.end_with?('/') ? path : "#{path}/" end + def with_trailling_slash(path) + ActiveSupport::Deprecation.warn 'Redmine::Scm::Adapters::AbstractAdapter#with_trailling_slash is deprecated and will be removed in Redmine 6.0. Please use #with_trailing_slash instead.' + with_trailing_slash(path) + end + def without_leading_slash(path) path ||= '' path.gsub(%r{^/+}, '') end - def without_trailling_slash(path) + def without_trailing_slash(path) path ||= '' path.end_with?('/') ? path[0..-2] : path end + def without_trailling_slash(path) + ActiveSupport::Deprecation.warn 'Redmine::Scm::Adapters::AbstractAdapter#without_trailling_slash is deprecated and will be removed in Redmine 6.0. Please use #without_trailing_slash instead.' + without_trailing_slash(path) + end + def valid_name?(name) return true if name.nil? return true if name.is_a?(Integer) && name > 0 |