miga-base 0.7.16.0 → 0.7.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miga/daemon/base.rb +1 -0
- data/lib/miga/json.rb +17 -5
- data/lib/miga/version.rb +2 -2
- 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: c515f327c9d7178b1891283f849d422885b3640f8cded39cfccd048e354acf16
|
4
|
+
data.tar.gz: 889a399e0fa68b54c901ec513e2049ab046593bc433185511516dbf9b3cedb7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4a9d5515ddf4b208b81612ceafcdae0eeb9cd37266df5f0175cef859adb9b24fd6e9ac5adf384ad9c91f8ecc08d6d5522eef8b9dd96e7d39740b14f83fdaf53
|
7
|
+
data.tar.gz: 117bc5b917e1008084e064cd4d87f290a83b6962e93560abfad254d23345a7685bf9ad3a345f2ade98ea5c13b4be52ccf608683ede8c320f3b8ee1250c2cec32
|
data/lib/miga/daemon/base.rb
CHANGED
data/lib/miga/json.rb
CHANGED
@@ -34,17 +34,29 @@ class MiGA::Json < MiGA::MiGA
|
|
34
34
|
# +opts+.
|
35
35
|
def parse(path, opts = {})
|
36
36
|
opts = default_opts(opts)
|
37
|
-
cont = opts[:contents] ? path : File.read(path)
|
38
|
-
raise "Empty descriptor: #{opts[:contents] ? "''" : path}." if cont.empty?
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
# Read JSON
|
39
|
+
cont = path
|
40
|
+
12.times do
|
41
|
+
cont = File.read(path)
|
42
|
+
break unless cont.empty?
|
43
|
+
sleep 1 # Wait up to 12 seconds for racing processes (iff empty file)
|
44
|
+
end unless opts[:contents]
|
45
|
+
raise "Empty descriptor: #{opts[:contents] ? "''" : path}" if cont.empty?
|
46
|
+
|
47
|
+
# Parse JSON
|
48
|
+
params = { symbolize_names: opts[:symbolize],
|
49
|
+
create_additions: opts[:additions] }
|
50
|
+
y = JSON.parse(cont, params)
|
51
|
+
|
52
|
+
# Add defaults
|
43
53
|
unless opts[:default].nil?
|
44
54
|
opts[:default] = parse(opts[:default]) if opts[:default].is_a? String
|
45
55
|
y.each { |k, v| opts[:default][k] = v }
|
46
56
|
y = opts[:default]
|
47
57
|
end
|
58
|
+
|
59
|
+
# Return
|
48
60
|
y
|
49
61
|
end
|
50
62
|
|
data/lib/miga/version.rb
CHANGED
@@ -8,7 +8,7 @@ module MiGA
|
|
8
8
|
# - Float representing the major.minor version.
|
9
9
|
# - Integer representing gem releases of the current version.
|
10
10
|
# - Integer representing minor changes that require new version number.
|
11
|
-
VERSION = [0.7, 16,
|
11
|
+
VERSION = [0.7, 16, 1]
|
12
12
|
|
13
13
|
##
|
14
14
|
# Nickname for the current major.minor version.
|
@@ -16,7 +16,7 @@ module MiGA
|
|
16
16
|
|
17
17
|
##
|
18
18
|
# Date of the current gem release.
|
19
|
-
VERSION_DATE = Date.new(2020, 10,
|
19
|
+
VERSION_DATE = Date.new(2020, 10, 19)
|
20
20
|
|
21
21
|
##
|
22
22
|
# Reference of MiGA.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miga-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.16.
|
4
|
+
version: 0.7.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis M. Rodriguez-R
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|