evt-subst_attr 1.0.0.0 → 1.1.0.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
- data/lib/subst_attr.rb +2 -2
- data/lib/subst_attr/substitute.rb +0 -30
- data/lib/subst_attr/substitute/null_object.rb +32 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42603a7614fbd6047c77ee937d73a2d462ec87192ed4d2b1d2ef356df5adbd15
|
4
|
+
data.tar.gz: 9a4b998e932db14cb527dbc50b05465e468fe09a09fc714f076d0f21356ece92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 509192862b835e50a6de4852b2814fb742195ebbd3e26a5c260e0bec8b95aa4ad60fc212192a66d87a72e0cb8d8991200fbe58c8a608e4a26e399f1ba1330320
|
7
|
+
data.tar.gz: 7acd8458f2150e1488ace1ac6a8c5178dac0304bf21ff6b0375eb42348af46e9e46862ffd0de07f353a27ff046e8b3a3b768ba769540911f9f8a99ac52dac9b5
|
data/lib/subst_attr.rb
CHANGED
@@ -34,35 +34,5 @@ module SubstAttr
|
|
34
34
|
|
35
35
|
specialization_module.send(:build)
|
36
36
|
end
|
37
|
-
|
38
|
-
module NullObject
|
39
|
-
extend self
|
40
|
-
|
41
|
-
Weak = Naught.build do |config|
|
42
|
-
config.define_explicit_conversions
|
43
|
-
config.define_implicit_conversions
|
44
|
-
config.predicates_return false
|
45
|
-
config.singleton
|
46
|
-
end
|
47
|
-
|
48
|
-
def build(interface=nil)
|
49
|
-
if interface
|
50
|
-
return strict(interface)
|
51
|
-
end
|
52
|
-
|
53
|
-
weak
|
54
|
-
end
|
55
|
-
|
56
|
-
def weak
|
57
|
-
Weak.get
|
58
|
-
end
|
59
|
-
|
60
|
-
def strict(interface)
|
61
|
-
Naught.build do |config|
|
62
|
-
config.singleton
|
63
|
-
config.impersonate(interface)
|
64
|
-
end.get
|
65
|
-
end
|
66
|
-
end
|
67
37
|
end
|
68
38
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SubstAttr
|
2
|
+
module Substitute
|
3
|
+
module NullObject
|
4
|
+
extend self
|
5
|
+
|
6
|
+
def build(interface=nil)
|
7
|
+
if interface
|
8
|
+
return strict(interface)
|
9
|
+
end
|
10
|
+
|
11
|
+
weak
|
12
|
+
end
|
13
|
+
|
14
|
+
def weak
|
15
|
+
unless self.const_defined?(:Weak, false)
|
16
|
+
cls = Mimic::Build.(Object) do
|
17
|
+
def method_missing(*)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
const_set(:Weak, cls)
|
22
|
+
end
|
23
|
+
|
24
|
+
Weak.new
|
25
|
+
end
|
26
|
+
|
27
|
+
def strict(interface)
|
28
|
+
Mimic.(interface)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-subst_attr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-attribute
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: evt-mimic
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/subst_attr/macro.rb
|
84
84
|
- lib/subst_attr/subst_attr.rb
|
85
85
|
- lib/subst_attr/substitute.rb
|
86
|
+
- lib/subst_attr/substitute/null_object.rb
|
86
87
|
homepage: https://github.com/eventide-project/subst-attr
|
87
88
|
licenses:
|
88
89
|
- MIT
|
@@ -102,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
103
|
- !ruby/object:Gem::Version
|
103
104
|
version: '0'
|
104
105
|
requirements: []
|
105
|
-
|
106
|
-
rubygems_version: 2.7.6
|
106
|
+
rubygems_version: 3.0.1
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Declare attributes that have default implementations that are substitutes
|