deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1202600 - in /incubator/deltacloud/trunk/server/lib: cimi/model/schema.rb deltacloud/core_ext/string.rb
Date Wed, 16 Nov 2011 09:20:13 GMT
Author: marios
Date: Wed Nov 16 09:20:13 2011
New Revision: 1202600

URL: http://svn.apache.org/viewvc?rev=1202600&view=rev
Log:
Rename 'capitalize' in core-ext/string.rb to 'upcase_first'

Used as part of CIMI schema class, but causes naming conflict
with Ruby's own 'capitalize':
https://issues.apache.org/jira/browse/DTACLOUD-104

Modified:
    incubator/deltacloud/trunk/server/lib/cimi/model/schema.rb
    incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/string.rb

Modified: incubator/deltacloud/trunk/server/lib/cimi/model/schema.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/cimi/model/schema.rb?rev=1202600&r1=1202599&r2=1202600&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/cimi/model/schema.rb (original)
+++ incubator/deltacloud/trunk/server/lib/cimi/model/schema.rb Wed Nov 16 09:20:13 2011
@@ -136,11 +136,11 @@ class CIMI::Model::Schema
 
     private
     def struct
-      cname = "CIMI_#{json_name.capitalize}"
+      cname = "CIMI_#{json_name.upcase_first}"
       if ::Struct.const_defined?(cname)
         ::Struct.const_get(cname)
       else
-        ::Struct.new("CIMI_#{json_name.capitalize}",
+        ::Struct.new("CIMI_#{json_name.upcase_first}",
                      *@schema.attribute_names)
       end
     end

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/string.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/string.rb?rev=1202600&r1=1202599&r2=1202600&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/string.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/string.rb Wed Nov 16 09:20:13
2011
@@ -59,7 +59,7 @@ class String
     self[0, 1].downcase + self[1..-1]
   end
 
-  def capitalize
+  def upcase_first
     self[0, 1].upcase + self[1..-1]
   end
 end



Mime
View raw message