incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1027890 - in /incubator/deltacloud/trunk/client/lib: deltacloud.rb documentation.rb
Date Wed, 27 Oct 2010 10:25:58 GMT
Author: mfojtik
Date: Wed Oct 27 10:25:58 2010
New Revision: 1027890

URL: http://svn.apache.org/viewvc?rev=1027890&view=rev
Log:
Fix for case/when statement compatibility with 1.9.2

Modified:
    incubator/deltacloud/trunk/client/lib/deltacloud.rb
    incubator/deltacloud/trunk/client/lib/documentation.rb

Modified: incubator/deltacloud/trunk/client/lib/deltacloud.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/lib/deltacloud.rb?rev=1027890&r1=1027889&r2=1027890&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/lib/deltacloud.rb (original)
+++ incubator/deltacloud/trunk/client/lib/deltacloud.rb Wed Oct 27 10:25:58 2010
@@ -194,7 +194,7 @@ module DeltaCloud
                 # When response cointains 'link' block, declare
                 # methods to call links inside. This is used for instance
                 # to dynamicaly create .stop!, .start! methods
-                when "actions":
+                when "actions" then
                   actions = []
                   attribute.xpath('link').each do |link|
                     actions << [link['rel'], link[:href]]
@@ -217,7 +217,7 @@ module DeltaCloud
                     urls
                   end
                 # Property attribute is handled differently
-                when "property":
+                when "property" then
                   attr_accessor :"#{attribute['name'].sanitize}"
                   if attribute['value'] =~ /^(\d+)$/
                     obj.send(:"#{attribute['name'].sanitize}=",
@@ -227,7 +227,7 @@ module DeltaCloud
                       DeltaCloud::HWP::Property.new(attribute, attribute['name']))
                   end
                 # Public and private addresses are returned as Array
-                when "public_addresses", "private_addresses":
+                when "public_addresses", "private_addresses" then
                   attr_accessor :"#{attribute.name.sanitize}"
                   obj.send(:"#{attribute.name.sanitize}=",
                     attribute.xpath('address').collect { |address| address.text })
@@ -523,12 +523,12 @@ module DeltaCloud
 
       def declare_ranges(xml)
         case xml['kind']
-          when 'range':
+          when 'range' then
             self.class.instance_eval do
               attr_reader :range
             end
             @range = { :from => xml.xpath('range').first['first'], :to => xml.xpath('range').first['last']
}
-          when 'enum':
+          when 'enum' then
             self.class.instance_eval do
               attr_reader :options
             end

Modified: incubator/deltacloud/trunk/client/lib/documentation.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/client/lib/documentation.rb?rev=1027890&r1=1027889&r2=1027890&view=diff
==============================================================================
--- incubator/deltacloud/trunk/client/lib/documentation.rb (original)
+++ incubator/deltacloud/trunk/client/lib/documentation.rb Wed Oct 27 10:25:58 2010
@@ -20,11 +20,11 @@ def read_method_description(c, method)
     "    # Read #{c.downcase} collection from Deltacloud API"
   else
     case method
-      when "uri"
+      when "uri" then
         "    # Return URI to API for this object"
-      when "action_urls"
+      when "action_urls" then
         "    # Return available actions API URL"
-      when "client"
+      when "client" then
         "    # Return instance of API client"
       else
         "    # Get #{method} attribute value from #{c.downcase}"



Mime
View raw message