[PATCH 7/7] Rename variables shadowing outer variables

Nikolai Weibull <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
---
 lib/cairo/color.rb        |    6 +++---
 lib/cairo/context/path.rb |    3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/cairo/color.rb b/lib/cairo/color.rb
index e14f0f1..c76486e 100644
--- a/lib/cairo/color.rb
+++ b/lib/cairo/color.rb
@@ -35,11 +35,11 @@ module Cairo
     def parse_hex_color(value)
       case value
       when /\A#((?:#{HEX_RE}){3,4})\z/ #
-        RGB.new(*$1.scan(/./).collect {|value| value.hex / 15.0})
+        RGB.new(*$1.scan(/./).collect {|part| part.hex / 15.0})
       when /\A#((?:#{HEX_RE}{2,2}){3,4})\z/ #
-        RGB.new(*$1.scan(/.{2,2}/).collect {|value| value.hex / 255.0})
+        RGB.new(*$1.scan(/.{2,2}/).collect {|part| part.hex / 255.0})
       when /\A#((?:#{HEX_RE}{4,4}){3,4})\z/ #
-        RGB.new(*$1.scan(/.{4,4}/).collect {|value| value.hex / 65535.0})
+        RGB.new(*$1.scan(/.{4,4}/).collect {|part| part.hex / 65535.0})
       else
         message = "invalid hex color format: #{value} should be "
         message << "#RGB, #RGBA, #RRGGBB, #RRGGBBAA, #RRRRGGGGBBBB "
diff --git a/lib/cairo/context/path.rb b/lib/cairo/context/path.rb
index 7cda0d7..78e05bd 100644
--- a/lib/cairo/context/path.rb
+++ b/lib/cairo/context/path.rb
@@ -25,7 +25,8 @@ module Cairo
           d = x
           i = -1
           type = points = nil
-          path.each do |type, points|
+          path.each do |btype, bpoints|
+            type, points = btype, bpoints
             i += 1
             break if d < parameterized_path[i]
             d -= parameterized_path[i]
-- 
1.7.5.1

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.