case 0.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/case.rb +10 -0
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/case.rb
CHANGED
@@ -35,6 +35,16 @@ class Any
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
if defined ::Tuple
|
39
|
+
class Tuple < ::Tuple
|
40
|
+
def ===(other)
|
41
|
+
return false unless ::Tuple === other and size == other.size
|
42
|
+
to_a.zip(other) { |a, b| return false unless a === b }
|
43
|
+
true
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
38
48
|
class Array < ::Array
|
39
49
|
def ===(other)
|
40
50
|
return false unless ::Array === other and size == other.size
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: case
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version:
|
7
|
-
date: 2008-01-
|
6
|
+
version: 0.2.1
|
7
|
+
date: 2008-01-17 00:00:00 -05:00
|
8
8
|
summary: Pattern matching for Ruby
|
9
9
|
require_paths:
|
10
10
|
- lib
|