lucarecord 0.3.0 → 0.4.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 +4 -0
- data/lib/luca_record/dict.rb +2 -1
- data/lib/luca_record/io.rb +3 -3
- data/lib/luca_record/version.rb +1 -1
- data/lib/luca_support/config.rb +2 -1
- 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: fde3b4057d40252d43320a4f55acae976faff31b608a71e66ebcfec0ad8c592a
|
4
|
+
data.tar.gz: 89764a7a57b4aff62e4a48a64a418b7f5991ab4f6d9358eb6ea1fc476f7d6b7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b58faff8563d38ceeb1e632381ec67487a7fd3b38d7473998f36605a4bfdd2a9bcaab25471348fa63b7a30a8f1bacb3f917421b8a1bcdabe4fc985f93a7342a2
|
7
|
+
data.tar.gz: 2de6368ee308eb4c20ddfd97e93544f5d1d2ae3f3b45f7937d2ab925cbd82d03748332fa9d502e536ed3953028cdf6caa522d73f418e28a24bc45c45e74d16d0
|
data/CHANGELOG.md
CHANGED
data/lib/luca_record/dict.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'csv'
|
4
|
+
require 'date'
|
4
5
|
require 'fileutils'
|
5
6
|
require 'yaml'
|
6
7
|
require 'pathname'
|
@@ -71,7 +72,7 @@ module LucaRecord
|
|
71
72
|
when '.tsv', '.csv'
|
72
73
|
load_tsv_dict(dict_path(file))
|
73
74
|
when '.yaml', '.yml'
|
74
|
-
YAML.
|
75
|
+
YAML.safe_load(File.read(dict_path(file)), permitted_classes: [Date])
|
75
76
|
else
|
76
77
|
raise 'cannot load this filetype'
|
77
78
|
end
|
data/lib/luca_record/io.rb
CHANGED
@@ -150,7 +150,7 @@ module LucaRecord # :nodoc:
|
|
150
150
|
|
151
151
|
def add_status!(id, status, basedir = @dirname)
|
152
152
|
path = abs_path(basedir) / id2path(id)
|
153
|
-
origin = YAML.
|
153
|
+
origin = YAML.safe_load(File.read(path), permitted_classes: [Date])
|
154
154
|
newline = { status => DateTime.now.to_s }
|
155
155
|
origin['status'] = [] if origin['status'].nil?
|
156
156
|
origin['status'] << newline
|
@@ -362,7 +362,7 @@ module LucaRecord # :nodoc:
|
|
362
362
|
# TODO: implement JSON parse
|
363
363
|
end
|
364
364
|
else
|
365
|
-
LucaSupport::Code.decimalize(YAML.
|
365
|
+
LucaSupport::Code.decimalize(YAML.safe_load(io.read, permitted_classes: [Date])).tap { |obj| validate_keys(obj) }
|
366
366
|
end
|
367
367
|
end
|
368
368
|
|
@@ -434,7 +434,7 @@ module LucaRecord # :nodoc:
|
|
434
434
|
def load_config(path = nil)
|
435
435
|
path = path.to_s
|
436
436
|
if File.exist?(path)
|
437
|
-
YAML.
|
437
|
+
YAML.safe_load(File.read(path), permitted_classes: [Date])
|
438
438
|
else
|
439
439
|
{}
|
440
440
|
end
|
data/lib/luca_record/version.rb
CHANGED
data/lib/luca_support/config.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'date'
|
3
4
|
require 'pathname'
|
4
5
|
require 'yaml'
|
5
6
|
|
@@ -11,7 +12,7 @@ module LucaSupport
|
|
11
12
|
{
|
12
13
|
'decimal_separator' => '.',
|
13
14
|
'thousands_separator' => ','
|
14
|
-
}.merge(YAML.
|
15
|
+
}.merge(YAML.safe_load(File.read(Pathname(PJDIR) / 'config.yml'), permitted_classes: [Date]))
|
15
16
|
rescue Errno::ENOENT
|
16
17
|
{
|
17
18
|
'decimal_separator' => '.',
|
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.4.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: 2022-
|
11
|
+
date: 2022-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|