lucarecord 0.5.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/luca_record/version.rb +1 -1
- data/lib/luca_support/code.rb +12 -1
- data/lib/luca_support/view.rb +13 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aa1cebca92730baae88aed3eae85d0d2c2d78c546a77fed3f1c938f17d9bebd
|
4
|
+
data.tar.gz: dfba788f46016596ae050dc2c742428ee676fead174c3825841381c03b24e62f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c63971e223278d08e688f96d791b517a84f8119ca1e0556a9a09685e28e821649aebbc62ab910db30060b2f13592a6f54de234aeea068d8b807fea9d6d1da29a
|
7
|
+
data.tar.gz: bf4dee90d7003d74af59a34620456c00213e51d11b9d0317468adc706bae4ed3957c0291643fcbdc87c26bb9cf867a05b5f467ecff1935ab63c1e9cda1cb0fac
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## LucaRecord 0.5.6
|
2
|
+
|
3
|
+
* add Nushell render mode: expand(default) | collapse | explore(`less` like)
|
4
|
+
* add `LucaSupport::Code.take_history()`, listing all effective/defunct values.
|
5
|
+
|
1
6
|
## LucaRecord 0.5.5
|
2
7
|
|
3
8
|
* support JSON for `LucaRecord::Base.load_data()` w/ `@record_type = 'json'`
|
data/lib/luca_record/version.rb
CHANGED
data/lib/luca_support/code.rb
CHANGED
@@ -180,7 +180,6 @@ module LucaSupport # :nodoc:
|
|
180
180
|
end
|
181
181
|
end
|
182
182
|
|
183
|
-
#
|
184
183
|
# convert effective/defunct data into current hash on @date.
|
185
184
|
# not parse nested children.
|
186
185
|
#
|
@@ -221,6 +220,18 @@ module LucaSupport # :nodoc:
|
|
221
220
|
latest&.dig('val') || latest
|
222
221
|
end
|
223
222
|
|
223
|
+
# convert all effective/defunct data into Array
|
224
|
+
# not parse nested children.
|
225
|
+
#
|
226
|
+
def take_history(dat, item)
|
227
|
+
target = dat&.dig(item)
|
228
|
+
return Array(target) unless target.is_a?(Array)
|
229
|
+
|
230
|
+
target
|
231
|
+
.sort { |a, b| Date.parse(a['effective'].to_s) <=> Date.parse(b['effective'].to_s) }
|
232
|
+
.map { |a| a['val'] }
|
233
|
+
end
|
234
|
+
|
224
235
|
def has_status?(dat, status)
|
225
236
|
return false if dat['status'].nil?
|
226
237
|
|
data/lib/luca_support/view.rb
CHANGED
@@ -48,7 +48,10 @@ module LucaSupport
|
|
48
48
|
nil
|
49
49
|
end
|
50
50
|
|
51
|
-
|
51
|
+
# render mode swithes nushell Viewer
|
52
|
+
# https://www.nushell.sh/commands/categories/viewers.html
|
53
|
+
#
|
54
|
+
def nushell(records, mode=:expand, columns=[])
|
52
55
|
return nil if records.is_a?(String)
|
53
56
|
|
54
57
|
require 'open3'
|
@@ -57,7 +60,15 @@ module LucaSupport
|
|
57
60
|
else
|
58
61
|
'| select --ignore-errors ' + columns.map { |col| col.gsub(/[^a-zA-Z0-9_-]/, '') }.join(' ')
|
59
62
|
end
|
60
|
-
|
63
|
+
render = case mode
|
64
|
+
when :explore
|
65
|
+
'explore'
|
66
|
+
when :collapse
|
67
|
+
'table -c'
|
68
|
+
else
|
69
|
+
'table -e'
|
70
|
+
end
|
71
|
+
Open3.pipeline_w(%(nu -c 'cat - | from json #{select} | #{render}')) { |stdin| stdin.puts JSON.dump(records) }
|
61
72
|
end
|
62
73
|
end
|
63
74
|
end
|
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.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,14 +90,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
93
|
+
version: 3.0.0
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
rubygems_version: 3.
|
100
|
+
rubygems_version: 3.4.10
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: ERP File operation framework
|