sid-csv 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sid-csv.rb +13 -3
- data/sid-csv.gemspec +2 -2
- 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: 7f5ca33a81924a8021bfd68398e22c0570c2729157dd8fc12ad5cac27ef83739
|
4
|
+
data.tar.gz: 9b2908d74cb42cbb81ac8649e0da4411b246fd89d7930fc78020fa21dda46ecf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7626fd146c0c61bcd93600288d3b6cc255318d65955a634e2288c5a711ce09e8c95f279a14e720aea7c1f92eecc89d8161d30ee3f786f00a0b9f5f2394c3551
|
7
|
+
data.tar.gz: d04aefc9a2c7a8975cc0cec19e52c3f740e8c1feddc9c30d8849be5984c03c5f66121ac638e97ec36f5f99049c7e89c444c689a0999e973deac1162ee79d8f80
|
data/lib/sid-csv.rb
CHANGED
@@ -29,8 +29,14 @@ module CSV::SID
|
|
29
29
|
csv_line(sid_data, :description, "description"),
|
30
30
|
*csv_lines(sid_data["dependency-revision"], :dependency,
|
31
31
|
"module-name", "module-revision"),
|
32
|
-
*csv_lines(sid_data["assignment-range"]
|
33
|
-
|
32
|
+
*csv_lines(sid_data["assignment-range"] || (
|
33
|
+
warn "** assignment-range missing! Trying assignment-ranges."
|
34
|
+
sid_data["assignment-ranges"]
|
35
|
+
), :range, "entry-point", "size"),
|
36
|
+
*csv_lines(sid_data["item"] || (
|
37
|
+
warn "** item missing! Trying items."
|
38
|
+
sid_data["items"]
|
39
|
+
), "sid", "namespace", "identifier", "status"),
|
34
40
|
]
|
35
41
|
end
|
36
42
|
|
@@ -78,7 +84,11 @@ module CSV::SID
|
|
78
84
|
end
|
79
85
|
|
80
86
|
def sid_data_from_file(text)
|
81
|
-
JSON.load(text)
|
87
|
+
outer = JSON.load(text)
|
88
|
+
outer[SID_FILE_TOP_LEVEL] || (
|
89
|
+
warn "** #{SID_FILE_TOP_LEVEL} missing! Trying top-level itself."
|
90
|
+
outer
|
91
|
+
)
|
82
92
|
end
|
83
93
|
|
84
94
|
def json_dump(fn, value)
|
data/sid-csv.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "sid-csv"
|
3
|
-
s.version = "0.0.
|
3
|
+
s.version = "0.0.2"
|
4
4
|
s.summary = "YANG-CBOR SID file as CSV"
|
5
5
|
s.description = %q{sid-csv implements a library and a command-line interface to YANG sid files as CSV}
|
6
6
|
s.author = "Carsten Bormann"
|
7
7
|
s.email = "cabo@tzi.org"
|
8
8
|
s.license = "Apache-2.0"
|
9
9
|
s.homepage = "https://github.com/cabo/sid-csv"
|
10
|
-
s.has_rdoc = false
|
10
|
+
# s.has_rdoc = false
|
11
11
|
s.files = Dir['lib/**/*.rb'] + %w(README.md sid-csv.gemspec data/sid-csv.cddl) + Dir['bin/**/*']
|
12
12
|
s.executables = Dir['bin/**/*'].map {|x| File.basename(x)}
|
13
13
|
s.required_ruby_version = '>= 2.7.0'
|