mug 1.2.4 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 986518f2bdb9b2e66fa37baefbf2bb63a191dd6e97626e7626c5475cea9c674d
4
- data.tar.gz: 0ed805639f4a57ba0a361dcd010d86ba240e31df4d0beef3209d782c8d663986
3
+ metadata.gz: c6a1368f80be0c11d5fc8614b1e9548dddef502fffd929bd6e01b6bc705737c8
4
+ data.tar.gz: 9a1bb6550a0ac33d484c2fd52fad34a82035ec6af4df4446ecfa099dd92b78d8
5
5
  SHA512:
6
- metadata.gz: d03ef238645b74dff18bc5daa037403c14963406f6c2875b757543ba2acbeb219bdf70ea1fd54f228d10ceff3f21cb4325ece5f9b34dcef78cb261d01aa7b718
7
- data.tar.gz: 5dee2f65ab4aa79e6b7d425cf5512cefb601d329884c9ae512dd450240a430ed78186c5c64d7ec7f8e59e589beb94fd877f4c2b865091655c072dae8dc4b334a
6
+ metadata.gz: bbf884f4d7b2e3dac6e0a4623d27a831430e9446be804cb99d0cb44fadd6d9de4eb7dc0bcc8f99c930d33b24702ea955d6c1be599f78baacd626f1b9eb829a88
7
+ data.tar.gz: 06dc7216fac287a0838c9efa7a477a9d83fc9957141c7da4f566ffa2e3a42c3a7b2c50abfe2eeb8e1433afa072caac832f46d963370ce95cb145a71fdc2216a2
@@ -47,7 +47,7 @@ module Enumerable
47
47
  return v if k == key
48
48
  end
49
49
  if args.length > 1
50
- return default
50
+ default
51
51
  elsif block_given?
52
52
  yield key
53
53
  else
@@ -78,12 +78,12 @@ module Enumerable
78
78
  break if remain < 1
79
79
 
80
80
  key_indices = key_map[k]
81
- if key_indices
82
- key_indices.each do |key_index|
83
- result[key_index] = v
84
- define[key_index] = true
85
- remain -= 1
86
- end
81
+ next unless key_indices
82
+
83
+ key_indices.each do |key_index|
84
+ result[key_index] = v
85
+ define[key_index] = true
86
+ remain -= 1
87
87
  end
88
88
  end
89
89
 
@@ -34,6 +34,16 @@ class FragileMethodChain
34
34
  self
35
35
  end
36
36
 
37
+ # If the object is resolved, defer. Otherwise, sure, I
38
+ # respond to anything, I guess.
39
+ def respond_to_missing? meth, priv
40
+ if __defer?
41
+ @o.respond_to_missing? meth, priv
42
+ else
43
+ true
44
+ end
45
+ end
46
+
37
47
  # Explicitly invoke :_? as a method in the chain.
38
48
  def _? #:nodoc:
39
49
  # Unconditionally invoke it, so the eventual _! doesn't fail
@@ -60,7 +70,7 @@ class Object
60
70
  end
61
71
 
62
72
  =begin
63
- Copyright (c) 2013,2016, Matthew Kerwin <matthew@kerwin.net.au>
73
+ Copyright (c) 2013,2016,2020, Matthew Kerwin <matthew@kerwin.net.au>
64
74
 
65
75
  Permission to use, copy, modify, and/or distribute this software for any
66
76
  purpose with or without fee is hereby granted, provided that the above
@@ -21,6 +21,15 @@ class MaybeDelegator
21
21
  def method_missing *a, &b #:nodoc:
22
22
  @o && @o.send(*a, &b)
23
23
  end
24
+
25
+ # This is a bit flakey, but I think it's meaningful.
26
+ def respond_to_missing? meth, priv
27
+ if @o
28
+ @o.repond_to_missing? meth, priv
29
+ else
30
+ true
31
+ end
32
+ end
24
33
  end
25
34
 
26
35
  class Object
@@ -42,7 +51,7 @@ class Object
42
51
  end
43
52
 
44
53
  =begin
45
- Copyright (c) 2013, Matthew Kerwin <matthew@kerwin.net.au>
54
+ Copyright (c) 2013,2020, Matthew Kerwin <matthew@kerwin.net.au>
46
55
 
47
56
  Permission to use, copy, modify, and/or distribute this software for any
48
57
  purpose with or without fee is hereby granted, provided that the above
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: 1.2.4
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Kerwin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-11 00:00:00.000000000 Z
11
+ date: 2020-11-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  == MUG: Matty's Ultimate Gem