incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/4] Core: Fixed .pluralize to deal with values like 'property' => 'properties'
Date Fri, 18 Nov 2011 13:32:31 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@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


Mime
View raw message