expressir 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/expressir/cli.rb +54 -0
- data/lib/expressir/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 208b131138dadcd6995ee2ccf1f7e0042538010a53a8e1b35484d338f1e78646
|
4
|
+
data.tar.gz: 7e7bd2d8921c04812698286db2042e8eed3c7fa76a432619dbb3f6555a408184
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81d19ac206d1026ec9e8059dfcf845fc9cc53490f9c2d0cc454d03158f13a9e91c80d9add555d7ac9795520ffaba7959c99c42a4589be92a6381989def8423e9
|
7
|
+
data.tar.gz: 1ee2fc3fa00b77057e81a7dc3979a5002c18813a71b61b4adda8a83bee02724717e783e2ddc21393fac04aa249ee4805a126d5a5774f1ae37eb2b153f97348de
|
data/lib/expressir/cli.rb
CHANGED
@@ -11,6 +11,60 @@ module Expressir
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
no_commands do
|
15
|
+
def _validate_schema(path)
|
16
|
+
repository = Expressir::Express::Parser.from_file(path)
|
17
|
+
repository.schemas.inject([]) do |acc, schema|
|
18
|
+
acc << schema.id unless schema.version&.value
|
19
|
+
acc
|
20
|
+
end
|
21
|
+
rescue StandardError => e
|
22
|
+
# pp e
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "validate *PATH", "validate EXPRESS schema located at PATH"
|
28
|
+
def validate(*paths)
|
29
|
+
no_version = []
|
30
|
+
no_valid = []
|
31
|
+
|
32
|
+
paths.each do |path|
|
33
|
+
x = Pathname.new(path).realpath.relative_path_from(Dir.pwd)
|
34
|
+
puts "Validating #{x}"
|
35
|
+
ret = _validate_schema(path)
|
36
|
+
|
37
|
+
if ret.nil?
|
38
|
+
no_valid << "Failed to parse: #{x}"
|
39
|
+
next
|
40
|
+
end
|
41
|
+
|
42
|
+
if ret.size
|
43
|
+
ret.each do |schema_id|
|
44
|
+
no_version << "Missing version string: schema `#{schema_id}` | #{x}"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
if !no_valid.empty?
|
50
|
+
puts "#{"*" * 20} RESULTS: FAILED TO PARSE #{"*" * 20}"
|
51
|
+
no_valid.each do |msg|
|
52
|
+
puts msg
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
if !no_version.empty?
|
57
|
+
puts "#{"*" * 20} RESULTS: MISSING VERSION STRING #{"*" * 20}"
|
58
|
+
no_version.each do |msg|
|
59
|
+
puts msg
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
if no_valid.size || no_version.size
|
64
|
+
exit 1
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
14
68
|
desc "version", "Expressir Version"
|
15
69
|
def version
|
16
70
|
say(Expressir::VERSION)
|
data/lib/expressir/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: expressir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|
@@ -742,7 +742,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
742
742
|
- !ruby/object:Gem::Version
|
743
743
|
version: '0'
|
744
744
|
requirements: []
|
745
|
-
rubygems_version: 3.3.
|
745
|
+
rubygems_version: 3.3.27
|
746
746
|
signing_key:
|
747
747
|
specification_version: 4
|
748
748
|
summary: ISO EXPRESS parser and tools in Ruby.
|