reinforce 0.1.0 → 0.1.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/reinforce/attributes/collection.rb +40 -2
- data/lib/reinforce/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6f784fce6717c12f407633dbb56dba404570e9e45da8ba600f6262fa9002e23
|
4
|
+
data.tar.gz: ffe9f04192a29a941cc34e6bd77e1588100596c0fa8157c2627ceacd2a8df35b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05e6126e4f9a9877bb925f386374abd8b64761ec993e80092d54eb5f5cdc4edb725eeda3f507bce260d5cf15b2872b0511b0cfd675516b6560bc05541a643c8b
|
7
|
+
data.tar.gz: 6d32147351c0c512bb9bdaaa0b28e1b1734b4fd5839209ba58934fe7a441a65ccfac8d482052950b26e4f07274bc44e4d612226bf782a8914bf5c078ad4705ed
|
@@ -80,14 +80,48 @@ module Reinforce
|
|
80
80
|
return nil if build.nil?
|
81
81
|
|
82
82
|
build = last_build if build == LATEST_BUILD
|
83
|
-
|
83
|
+
|
84
|
+
cursor = build
|
85
|
+
until cursor.nil?
|
86
|
+
value = @pbgid_keyed.dig(cursor, pbgid)
|
87
|
+
return value unless value.nil?
|
88
|
+
|
89
|
+
cursor = previous_build_for(cursor)
|
90
|
+
end
|
91
|
+
|
92
|
+
cursor = next_build_for(build)
|
93
|
+
until cursor.nil?
|
94
|
+
value = @pbgid_keyed.dig(cursor, pbgid)
|
95
|
+
return value unless value.nil?
|
96
|
+
|
97
|
+
cursor = next_build_for(cursor)
|
98
|
+
end
|
99
|
+
|
100
|
+
nil
|
84
101
|
end
|
85
102
|
|
86
103
|
def get_by_path(path, build: LATEST_BUILD)
|
87
104
|
return nil if build.nil?
|
88
105
|
|
89
106
|
build = last_build if build == LATEST_BUILD
|
90
|
-
|
107
|
+
|
108
|
+
cursor = build
|
109
|
+
until cursor.nil?
|
110
|
+
value = @path_keyed.dig(cursor, path)
|
111
|
+
return value unless value.nil?
|
112
|
+
|
113
|
+
cursor = previous_build_for(cursor)
|
114
|
+
end
|
115
|
+
|
116
|
+
cursor = next_build_for(build)
|
117
|
+
until cursor.nil?
|
118
|
+
value = @path_keyed.dig(cursor, path)
|
119
|
+
return value unless value.nil?
|
120
|
+
|
121
|
+
cursor = next_build_for(cursor)
|
122
|
+
end
|
123
|
+
|
124
|
+
nil
|
91
125
|
end
|
92
126
|
|
93
127
|
def populate(build, data, rehash: true)
|
@@ -135,6 +169,10 @@ module Reinforce
|
|
135
169
|
@pbgid_keyed.keys.sort.reverse.find { |b| b < build }
|
136
170
|
end
|
137
171
|
|
172
|
+
def next_build_for(build)
|
173
|
+
@pbgid_keyed.keys.sort.find { |b| b > build }
|
174
|
+
end
|
175
|
+
|
138
176
|
def rehash(hash)
|
139
177
|
previous = nil
|
140
178
|
|
data/lib/reinforce/version.rb
CHANGED