incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r1171774 - in /incubator/deltacloud/trunk/server/lib/deltacloud: core_ext.rb core_ext/hash.rb helpers/blob_stream.rb
Date Fri, 16 Sep 2011 20:53:38 GMT
Author: lutter
Date: Fri Sep 16 20:53:38 2011
New Revision: 1171774

URL: http://svn.apache.org/viewvc?rev=1171774&view=rev
Log:
Pull changes to Hash out of blob_stream and into core_ext

Added:
    incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/hash.rb
      - copied, changed from r1171773, incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb
Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb
    incubator/deltacloud/trunk/server/lib/deltacloud/helpers/blob_stream.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb?rev=1171774&r1=1171773&r2=1171774&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb Fri Sep 16 20:53:38 2011
@@ -16,3 +16,4 @@
 
 require 'deltacloud/core_ext/string'
 require 'deltacloud/core_ext/integer'
+require 'deltacloud/core_ext/hash'

Copied: incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/hash.rb (from r1171773,
incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb)
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/hash.rb?p2=incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/hash.rb&p1=incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb&r1=1171773&r2=1171774&rev=1171774&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/core_ext.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/core_ext/hash.rb Fri Sep 16 20:53:38
2011
@@ -1,4 +1,3 @@
-#
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
 # this work for additional information regarding copyright ownership.  The
@@ -14,5 +13,17 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
-require 'deltacloud/core_ext/string'
-require 'deltacloud/core_ext/integer'
+class Hash
+  def gsub_keys(rgx_pattern, replacement)
+    remove = []
+    self.each_key do |key|
+      if key.to_s.match(rgx_pattern)
+         new_key = key.to_s.gsub(rgx_pattern, replacement).downcase
+         self[new_key] = self[key]
+         remove << key
+      end
+    end
+    #remove the original keys
+    self.delete_if{|k,v| remove.include?(k)}
+  end
+end

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/helpers/blob_stream.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/helpers/blob_stream.rb?rev=1171774&r1=1171773&r2=1171774&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/helpers/blob_stream.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/helpers/blob_stream.rb Fri Sep 16 20:53:38
2011
@@ -63,23 +63,6 @@ rescue LoadError => e
   end
 end
 
-class Hash
-
-  def gsub_keys(rgx_pattern, replacement)
-    remove = []
-    self.each_key do |key|
-      if key.to_s.match(rgx_pattern)
-         new_key = key.to_s.gsub(rgx_pattern, replacement).downcase
-         self[new_key] = self[key]
-         remove << key
-      end
-    end
-    #remove the original keys
-    self.delete_if{|k,v| remove.include?(k)}
-  end
-
-end
-
 module BlobHelper
 
   def self.extract_blob_metadata_hash(env_hash)



Mime
View raw message