mug 2.0.0 → 2.0.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.
- checksums.yaml +4 -4
- data/lib/mug/apply.rb +4 -2
- data/test/test-enumerable-chain.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 036ea8685c77415a45fcc3403839d6aac7c10143ab56a69a362ae66c810aa783
|
|
4
|
+
data.tar.gz: b7bd3023df0304c0b14e9d8339b04a6822ffd4ad082a2793c9c51a52025c1e6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 627990b12891667c1f062c50f6c8e0807481c5ebc9ab0c0771d61ba639ffb20ddd3118664079ec08ba504c960a06d774c401fc5d50c46fa51bfe54339d512af2
|
|
7
|
+
data.tar.gz: '09e2e5a7068f1d4e4ff43fab783b387d0b1c8d02871e4b7ba9d5a161fee55f543d261ee837c1c23122f66bd179e885608aefe85131d7c0b52cd14a4c6ebe3a40'
|
data/lib/mug/apply.rb
CHANGED
|
@@ -8,7 +8,8 @@ class Proc
|
|
|
8
8
|
# arguments.
|
|
9
9
|
#
|
|
10
10
|
def apply(*args)
|
|
11
|
-
|
|
11
|
+
n = arity < 0 ? -arity - 1 : arity
|
|
12
|
+
curry(n).call(*args)
|
|
12
13
|
end
|
|
13
14
|
end
|
|
14
15
|
|
|
@@ -21,7 +22,8 @@ class Method
|
|
|
21
22
|
# arguments.
|
|
22
23
|
#
|
|
23
24
|
def apply(*args)
|
|
24
|
-
|
|
25
|
+
n = arity < 0 ? -arity - 1 : arity
|
|
26
|
+
curry(n).call(*args)
|
|
25
27
|
end
|
|
26
28
|
end
|
|
27
29
|
|
|
@@ -15,7 +15,8 @@ class Test_enumerable_chain < Test::Unit::TestCase
|
|
|
15
15
|
]
|
|
16
16
|
|
|
17
17
|
enum = a.chain(b, c)
|
|
18
|
-
|
|
18
|
+
assert( enum.kind_of?(Enumerator) || enum.kind_of?(Enumerator::Chain),
|
|
19
|
+
"expected Enumerator or Enumerator::Chain, got #{enum.class}" )
|
|
19
20
|
|
|
20
21
|
result = []
|
|
21
22
|
enum.each do |*x|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mug
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthew Kerwin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |
|
|
14
14
|
== MUG: Matty's Ultimate Gem
|