From e10577e9ed482433ad1d80b321b89e8cc72f4c1c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 17 Aug 2009 16:32:24 +0000 Subject: SCM: * Fixes file log for non-Git repositories (Repository#latest_changesets ignores path argument) * No longer used Repository#changesets_for_path method removed git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2844 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/core_ext/string.rb | 2 ++ lib/redmine/core_ext/string/inflections.rb | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 lib/redmine/core_ext/string/inflections.rb (limited to 'lib') diff --git a/lib/redmine/core_ext/string.rb b/lib/redmine/core_ext/string.rb index ce2646fb9..2da5ffef9 100644 --- a/lib/redmine/core_ext/string.rb +++ b/lib/redmine/core_ext/string.rb @@ -1,5 +1,7 @@ require File.dirname(__FILE__) + '/string/conversions' +require File.dirname(__FILE__) + '/string/inflections' class String #:nodoc: include Redmine::CoreExtensions::String::Conversions + include Redmine::CoreExtensions::String::Inflections end diff --git a/lib/redmine/core_ext/string/inflections.rb b/lib/redmine/core_ext/string/inflections.rb new file mode 100644 index 000000000..a59f268fa --- /dev/null +++ b/lib/redmine/core_ext/string/inflections.rb @@ -0,0 +1,29 @@ +# Redmine - project management software +# Copyright (C) 2009 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +module Redmine #:nodoc: + module CoreExtensions #:nodoc: + module String #:nodoc: + # Custom string inflections + module Inflections + def with_leading_slash + starts_with?('/') ? self : "/#{ self }" + end + end + end + end +end -- cgit v1.2.3