lucarecord 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/luca_record/dict.rb +1 -1
- data/lib/luca_record/io.rb +1 -1
- data/lib/luca_record/version.rb +1 -1
- data/lib/luca_support/code.rb +6 -6
- 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: fc67fbc3655278f3be52dd82f3994560fa72f3f043f272d40c1bd478a04e6126
|
4
|
+
data.tar.gz: aaff85cd17e1066344c915326b8626d312ae4add22263e198084979d624750f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e801b4ea786880fc442bbdf8c995abf1828f2a3e6ed705b8983178687da605d738dbaed3832c08bb718c7c5f23d4a540f43a55e4bd3cd51a395727ec08755e28
|
7
|
+
data.tar.gz: 9367c58a1b4ae9563f91f603f82dfdd9c674b2931cde3677e9d6ac4bc22eb3563e5bc6bf7a9fb4550473d19e319c78f0abe8c77cc1ff8b798848577b4c0fbcb0
|
data/CHANGELOG.md
CHANGED
data/lib/luca_record/dict.rb
CHANGED
data/lib/luca_record/io.rb
CHANGED
@@ -372,7 +372,7 @@ module LucaRecord # :nodoc:
|
|
372
372
|
# '2020': All month of 2020
|
373
373
|
# '2020[FG]': June & July of 2020
|
374
374
|
#
|
375
|
-
# Block will receive code fragments as 2nd parameter. Array format is
|
375
|
+
# Block will receive code fragments as 2nd parameter. Array format is:
|
376
376
|
# 1. encoded month
|
377
377
|
# 2. encoded day + record number of the day
|
378
378
|
# 3. codes. More than 3 are all code set except first 2 parameters.
|
data/lib/luca_record/version.rb
CHANGED
data/lib/luca_support/code.rb
CHANGED
@@ -183,14 +183,14 @@ module LucaSupport # :nodoc:
|
|
183
183
|
# convert effective/defunct data into current hash on @date.
|
184
184
|
# not parse nested children.
|
185
185
|
#
|
186
|
-
def parse_current(dat)
|
186
|
+
def parse_current(dat, date = @date)
|
187
187
|
{}.tap do |processed|
|
188
|
-
dat.each { |k, _v| processed[k] = take_current(dat, k) }
|
188
|
+
dat.each { |k, _v| processed[k] = take_current(dat, k, date) }
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
192
|
# return current value with effective/defunct on target @date
|
193
|
-
# For multiple attribues, return hash on other than 'val'. Examples
|
193
|
+
# For multiple attribues, return hash on other than 'val'. Examples:
|
194
194
|
#
|
195
195
|
# - effective: 2020-1-1
|
196
196
|
# val: 3000
|
@@ -205,7 +205,7 @@ module LucaSupport # :nodoc:
|
|
205
205
|
# val: 3000
|
206
206
|
# => nil
|
207
207
|
#
|
208
|
-
def take_current(dat, item)
|
208
|
+
def take_current(dat, item, date = @date)
|
209
209
|
target = dat&.dig(item)
|
210
210
|
return target unless target.is_a?(Array)
|
211
211
|
|
@@ -213,8 +213,8 @@ module LucaSupport # :nodoc:
|
|
213
213
|
return target if !keys.include?('effective') && !keys.include?('defunct')
|
214
214
|
|
215
215
|
latest = target
|
216
|
-
.reject { |a| a['defunct'] && Date.parse(a['defunct'].to_s) <
|
217
|
-
.filter { |a| a['effective'] && Date.parse(a['effective'].to_s) <
|
216
|
+
.reject { |a| a['defunct'] && Date.parse(a['defunct'].to_s) < date }
|
217
|
+
.filter { |a| a['effective'] && Date.parse(a['effective'].to_s) < date }
|
218
218
|
.max { |a, b| Date.parse(a['effective'].to_s) <=> Date.parse(b['effective'].to_s) }
|
219
219
|
|
220
220
|
latest&.dig('val') || latest
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucarecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|