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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sid-csv.rb +13 -3
  3. data/sid-csv.gemspec +2 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0930d2fcacf9e23529f172d66f4d8d3ad22b181c6a40013999278b30b2a187d1'
4
- data.tar.gz: 1871c2534af3fd0063bfe11c779dd5b7c7dbb376007a69f34ca3d4f26dfc16b2
3
+ metadata.gz: 7f5ca33a81924a8021bfd68398e22c0570c2729157dd8fc12ad5cac27ef83739
4
+ data.tar.gz: 9b2908d74cb42cbb81ac8649e0da4411b246fd89d7930fc78020fa21dda46ecf
5
5
  SHA512:
6
- metadata.gz: fc3972b423d25efa128695717bcf9d8d2acb8d57a3689c1bfe84f859e37da3e2c0191e3ed7d56d3495a6f7ddf5ac9881616ea61c2234c680902ccd80733f784a
7
- data.tar.gz: '01719d214191ab4b1426a7fd1d833b3172242637a312f2a854fad5cc2975bf85db3ffb04161eed9df47b5c25ef7ed9a3b1a9ff36d25501ee049c9ecf1869161b'
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"], :range, "entry-point", "size"),
33
- *csv_lines(sid_data["item"], "sid", "namespace", "identifier", "status"),
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)[SID_FILE_TOP_LEVEL]
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.1"
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'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sid-csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann