expressir 1.4.0-aarch64-linux-gnu → 1.4.1-aarch64-linux-gnu

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e21aeb764e6203eef25203f4bc5be4b460b7d561906f91fcaa665a5802486f20
4
- data.tar.gz: 173194066a984c893ebbc0150657e38b6bb08cbac3de10f832f86fc89958f3a4
3
+ metadata.gz: 2dcf32e571c9a7621a99a40903698ba8b763e4d029dfcb39a3f43eaedfd7e321
4
+ data.tar.gz: '0796c8e2fadc16b6c435fa2a8a97aa220804a1a8af1bfe9dfab40957340f9cdf'
5
5
  SHA512:
6
- metadata.gz: 63004f5c60abcd07af686fa8437a851c9a490b8777f947bee48c2fd51d027193b3eeaa70e9d2d1c8ea6c3e0d9deb7c6c1945564f5d27b063c0e49e62a4c36532
7
- data.tar.gz: 2e931c1f987a2102e7fcba183b282d228560733f75ea10a8910c7143d1d1fc13c745eaa3e5ccd02f8fcfaaf2add858f4ffa16f74dba3d55084c3d5f6c8ae8642
6
+ metadata.gz: f75cba51564c08ced2103113e5aa669682940d19ecae2e3a9d065fe3a29bd4c6eee74353a197cbd6cc644443ea93ed4a508145f4173091cf9c3424bbbca0cb39
7
+ data.tar.gz: 91d675289dbb84dcd6bbb907d8923ae1b86aff6415bd711a1ae626f53a8ab1a26f606d32e86a24f4305d31e60c3d7b92214cc5f961a7d8a89d814cef411c2608
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)
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "1.4.0".freeze
2
+ VERSION = "1.4.1".freeze
3
3
  end
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.0
4
+ version: 1.4.1
5
5
  platform: aarch64-linux-gnu
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-23 00:00:00.000000000 Z
11
+ date: 2024-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor