mixins 0.2.0 → 0.3.0
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
- checksums.yaml.gz.sig +0 -0
- data/History.md +7 -0
- data/lib/mixins/inspection.rb +18 -1
- data/lib/mixins.rb +1 -1
- data/spec/mixins/inspection_spec.rb +14 -1
- data.tar.gz.sig +0 -0
- metadata +96 -100
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 02b3858efde14f4da0fd5a66b55a25c323451a66a5beffa9e92605412f3aed46
|
|
4
|
+
data.tar.gz: 0b22e9561b1b2cbc6a2e54c49a9c31d9de21fe47bba9c4656ae616ba95d23c22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 897d4fdd9f775accff1e442cda2714a0256f105ea0326e6bc71e2218a1b768bcc1f2072e1f70b3a1d747133dce5e41b83f9d8cdf272db7f2fa4e73fbd0650fb9
|
|
7
|
+
data.tar.gz: ac41d3a4e8d0226c9e598c773fca6890b1c5820be5ed9642af2952144ebbfcf5173a633d24503cf616b75f1342120f0b34d99b3504a33316352f0d03ffd56b75
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/History.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Release History for mixins
|
|
2
2
|
|
|
3
3
|
---
|
|
4
|
+
## v0.3.0 [2026-11-07] Michael Granger <ged@faeriemud.org>
|
|
5
|
+
|
|
6
|
+
Improvements:
|
|
7
|
+
|
|
8
|
+
- Improve Inspection so it works with no attributes
|
|
9
|
+
|
|
10
|
+
|
|
4
11
|
## v0.2.0 [2026-04-14] Michael Granger <ged@faeriemud.org>
|
|
5
12
|
|
|
6
13
|
Improvements:
|
data/lib/mixins/inspection.rb
CHANGED
|
@@ -12,6 +12,21 @@ require 'mixins' unless defined?( Mixins )
|
|
|
12
12
|
# will cause #inspect to use the default output.
|
|
13
13
|
module Mixins::Inspection
|
|
14
14
|
|
|
15
|
+
# Figure out how long the object id in the default #inspect output is
|
|
16
|
+
OBJ_ID_WIDTH = begin
|
|
17
|
+
default = Kernel.instance_method( :inspect ).bind( Object.new ).call
|
|
18
|
+
default[ /0x(\h+)/, 1 ].length
|
|
19
|
+
rescue
|
|
20
|
+
8
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Make a pattern for the default object id in #inspect
|
|
24
|
+
OBJ_ID_HEX = /\h{#{OBJ_ID_WIDTH}}/
|
|
25
|
+
|
|
26
|
+
# Make a pattern for matching everything after the default object id
|
|
27
|
+
OBJ_INSPECT_SUFFIX = /(?<=0x#{OBJ_ID_HEX})(?: .*)?\>\z/
|
|
28
|
+
|
|
29
|
+
|
|
15
30
|
### Return a human-readable representation of the object suitable for debugging.
|
|
16
31
|
def inspect
|
|
17
32
|
details = self.inspect_details
|
|
@@ -19,7 +34,9 @@ module Mixins::Inspection
|
|
|
19
34
|
|
|
20
35
|
default = super
|
|
21
36
|
|
|
22
|
-
|
|
37
|
+
# #<Class:0x00000001097afd50>
|
|
38
|
+
# #<Class:0x00000001097afd50 @attribute=value>
|
|
39
|
+
return default.sub( OBJ_INSPECT_SUFFIX, details << '>' )
|
|
23
40
|
end
|
|
24
41
|
|
|
25
42
|
|
data/lib/mixins.rb
CHANGED
|
@@ -20,6 +20,19 @@ RSpec.describe( Mixins::Inspection ) do
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
|
|
23
|
+
it "adds details to an object with no attributes" do
|
|
24
|
+
oclass = Class.new do
|
|
25
|
+
def inspect_details
|
|
26
|
+
return " testoutput"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
oclass.include( described_class )
|
|
30
|
+
instance = oclass.new
|
|
31
|
+
|
|
32
|
+
expect( instance.inspect ).to match( /#<#{oclass.inspect}:0x\h+ testoutput>/ )
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
|
|
23
36
|
it "allows the inspection contents to be overridden" do
|
|
24
37
|
oclass = Class.new do
|
|
25
38
|
def initialize( serial )
|
|
@@ -38,7 +51,7 @@ RSpec.describe( Mixins::Inspection ) do
|
|
|
38
51
|
end
|
|
39
52
|
|
|
40
53
|
|
|
41
|
-
it "doesn't add a separator space if the details already
|
|
54
|
+
it "doesn't add a separator space if the details already begin with a space" do
|
|
42
55
|
oclass = Class.new do
|
|
43
56
|
def initialize( serial )
|
|
44
57
|
@serial = serial
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,125 +1,121 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mixins
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
- Michael Granger
|
|
8
|
+
- Mahlon E. Smith
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
date: 2026-
|
|
11
|
+
- |
|
|
12
|
+
-----BEGIN CERTIFICATE-----
|
|
13
|
+
MIIEMDCCApigAwIBAgIBAjANBgkqhkiG9w0BAQsFADA+MQwwCgYDVQQDDANnZWQx
|
|
14
|
+
GT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7+bTPU0eRCGZuOPrEp8ROc1s5zwZNFv7qHWv/zWWC6sIj4gEnCZkUugK03k
|
|
29
|
+
bYDsSlkyjiQ4ApVV00+h/Vhxcw+RLIZuqy2QFl8YAfMJm+JS8G7SuoqpFjbv3UUF
|
|
30
|
+
vrObIiO7LbhJxpYzTGkGzMFigcnm6vIGMex4AgtArc2RpWOvtAXQrU7CZHUkcdQM
|
|
31
|
+
4n5eVK+m3IZlD7dd4HoPT2jF2cOGmk8XFclT0GcPVYmEWFFmotN2aiMj4sqVm/Ob
|
|
32
|
+
V+FmyTUy4gVtcNOFO/sBnFRiQW0fxV9/97Dog9ciYesfiAhm4EpcuTmatdAuMrZR
|
|
33
|
+
WBmf+jXIub5S7RBw+m0mk2xhmcSkg1vY5w6IEIhSo2e2gE9rA0rIkZO5wP4sCouE
|
|
34
|
+
XdaRMEnt/AVHUzroBR3CWAz/6ZnDF8GS7EK1bOfM+YWqJL30g7PoxpT+UJTqWJtM
|
|
35
|
+
CCC1LSoBD7OEUiaIMWUo4h7xWIs=
|
|
36
|
+
-----END CERTIFICATE-----
|
|
37
|
+
date: 2026-11-07 00:00:00.000000000 Z
|
|
38
38
|
dependencies:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
version: "0.10"
|
|
71
|
-
description: "This is a collection of zero-dependency mixins. They’re intended to be generically useful for building other software, well-tested, and not add any non-stdlib dependencies."
|
|
39
|
+
- !ruby/object:Gem::Dependency
|
|
40
|
+
name: rubygems-datadir
|
|
41
|
+
requirement: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - "~>"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '0.0'
|
|
46
|
+
type: :runtime
|
|
47
|
+
prerelease: false
|
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - "~>"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0.0'
|
|
53
|
+
- !ruby/object:Gem::Dependency
|
|
54
|
+
name: rake-deveiate
|
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - "~>"
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0.10'
|
|
60
|
+
type: :development
|
|
61
|
+
prerelease: false
|
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - "~>"
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '0.10'
|
|
67
|
+
description: This is a collection of zero-dependency mixins. They’re intended to be
|
|
68
|
+
generically useful for building other software, well-tested, and not add any non-stdlib
|
|
69
|
+
dependencies.
|
|
72
70
|
email:
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
- ged@faeriemud.org
|
|
72
|
+
- mahlon@martini.nu
|
|
75
73
|
executables: []
|
|
76
74
|
extensions: []
|
|
77
75
|
extra_rdoc_files: []
|
|
78
76
|
files:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
homepage:
|
|
77
|
+
- History.md
|
|
78
|
+
- LICENSE.txt
|
|
79
|
+
- README.md
|
|
80
|
+
- lib/mixins.rb
|
|
81
|
+
- lib/mixins/data_utilities.rb
|
|
82
|
+
- lib/mixins/datadir.rb
|
|
83
|
+
- lib/mixins/delegation.rb
|
|
84
|
+
- lib/mixins/hooks.rb
|
|
85
|
+
- lib/mixins/inspection.rb
|
|
86
|
+
- lib/mixins/method_utilities.rb
|
|
87
|
+
- spec/mixins/data_utilities_spec.rb
|
|
88
|
+
- spec/mixins/datadir_spec.rb
|
|
89
|
+
- spec/mixins/delegation_spec.rb
|
|
90
|
+
- spec/mixins/hooks_spec.rb
|
|
91
|
+
- spec/mixins/inspection_spec.rb
|
|
92
|
+
- spec/mixins/method_utilities_spec.rb
|
|
93
|
+
- spec/mixins_spec.rb
|
|
94
|
+
- spec/spec_helper.rb
|
|
95
|
+
homepage: https://hg.sr.ht/~ged/Mixins
|
|
98
96
|
licenses:
|
|
99
|
-
|
|
97
|
+
- BSD-3-Clause
|
|
100
98
|
metadata:
|
|
101
|
-
homepage_uri:
|
|
102
|
-
documentation_uri:
|
|
103
|
-
changelog_uri:
|
|
104
|
-
source_uri:
|
|
105
|
-
bug_tracker_uri:
|
|
99
|
+
homepage_uri: https://hg.sr.ht/~ged/Mixins
|
|
100
|
+
documentation_uri: https://deveiate.org/code/mixins
|
|
101
|
+
changelog_uri: https://deveiate.org/code/mixins/History_md.html
|
|
102
|
+
source_uri: https://hg.sr.ht/~ged/Mixins/browse
|
|
103
|
+
bug_tracker_uri: https://todo.sr.ht/~ged/Mixins/browse
|
|
106
104
|
rdoc_options: []
|
|
107
105
|
require_paths:
|
|
108
|
-
|
|
106
|
+
- lib
|
|
109
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
108
|
requirements:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
version: "0"
|
|
109
|
+
- - ">="
|
|
110
|
+
- !ruby/object:Gem::Version
|
|
111
|
+
version: '0'
|
|
115
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
113
|
requirements:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
version: "0"
|
|
114
|
+
- - ">="
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: '0'
|
|
121
117
|
requirements: []
|
|
122
|
-
rubygems_version: 4.
|
|
118
|
+
rubygems_version: 4.0.20
|
|
123
119
|
specification_version: 4
|
|
124
120
|
summary: This is a collection of zero-dependency mixins.
|
|
125
121
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|