You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2011/11/18 14:32:31 UTC
[PATCH core 2/4] Core: Fixed .pluralize to deal with values like 'property' => 'properties'
From: Michal Fojtik <mf...@redhat.com>
Signed-off-by: Michal fojtik <mf...@redhat.com>
---
server/lib/deltacloud/core_ext/string.rb | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/server/lib/deltacloud/core_ext/string.rb b/server/lib/deltacloud/core_ext/string.rb
index 53b3984..de56c99 100644
--- a/server/lib/deltacloud/core_ext/string.rb
+++ b/server/lib/deltacloud/core_ext/string.rb
@@ -34,6 +34,7 @@ class String
def pluralize
return self + 'es' if self =~ /ess$/
+ return self[0, self.length-1] + "ies" if self =~ /ty$/
self + "s"
end
--
1.7.4.4
Re: [PATCH core 2/4] Core: Fixed .pluralize to deal with values like 'property' => 'properties'
Posted by Tong Li <li...@us.ibm.com>.
OK
Tong Li
Emerging Technologies & Standards
Building 501/B205
litong01@us.ibm.com
mfojtik@redhat.com wrote on 11/18/2011 08:32:31 AM:
> From: mfojtik@redhat.com
> To: deltacloud-dev@incubator.apache.org
> Date: 11/18/2011 08:32 AM
> Subject: [PATCH core 2/4] Core: Fixed .pluralize to deal with values
> like 'property' => 'properties'
>
> From: Michal Fojtik <mf...@redhat.com>
>
>
> Signed-off-by: Michal fojtik <mf...@redhat.com>
> ---
> server/lib/deltacloud/core_ext/string.rb | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/server/lib/deltacloud/core_ext/string.rb b/server/lib/
> deltacloud/core_ext/string.rb
> index 53b3984..de56c99 100644
> --- a/server/lib/deltacloud/core_ext/string.rb
> +++ b/server/lib/deltacloud/core_ext/string.rb
> @@ -34,6 +34,7 @@ class String
>
> def pluralize
> return self + 'es' if self =~ /ess$/
> + return self[0, self.length-1] + "ies" if self =~ /ty$/
> self + "s"
> end
>
> --
> 1.7.4.4
>