expressir 1.4.0-x86_64-linux-musl → 1.4.1-x86_64-linux-musl
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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef40390e8b4dab30bc836664c83755698cbe99490e7fb70bf2145efd240517a9
|
4
|
+
data.tar.gz: 8dca4d394056a680e20391a63c339a14ae013509f1e44af988a3aa498d752ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd64ed51cba5fbe241d99839fcfcada35a23ce69bfb79ec75657ed64daae8c0b03171a38414a8dbe43ac2941d578b1015e812b23f9364fc7a2216cc889c98e51
|
7
|
+
data.tar.gz: 9ad87b3a5adc08155b7452102e89a03d3cad390991f50d9cde0cad90d7563fa8425146a5855cf04f5fd57179f9381fb058ac478b4c543344dffa4be1ac28e7f1
|
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: x86_64-linux-musl
|
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: thor
|