expressir 1.4.0-x64-mingw32 → 1.4.1-x64-mingw32

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: 1fa3bd98fd6c122e1f67ba646d214c36a1e7f39ba46b5760eb4e8db843b332c3
4
- data.tar.gz: 0e3e4e3caf499171d67b186caad52598186fd87d19977d726ab78078fd8137bf
3
+ metadata.gz: 52ea411feeefd10c102da8519c2ab6e772ed9edf0206b550053e9506e3c62fff
4
+ data.tar.gz: d47ce5703fccd51dcc0d57143307397cb9e44673e13c4b27b8f137aed751fe8f
5
5
  SHA512:
6
- metadata.gz: 8c266400458db0e62193a85af435807f81f1ca147cc2730852d5bef06851dfd00bbe60984794446ec7498496911370c0e756bf67acb97ff629ba32dc63fdb4fe
7
- data.tar.gz: bd8409e32deb0d79ffc2170cb3ff3f41b855b39594a5671c32842ede9e8b3bed26ed58459c546a874726766610e3b03d0de0d6391a440d2461db8d3f0706ff33
6
+ metadata.gz: ce2e1397408188fe2e320530a70d735d7ad597506471bcae4ee8c2a43c36fa44d4dc6b36125d7640ebf8782b03ee8806e670e2a9d0285d3bd27463f29c33008d
7
+ data.tar.gz: b09bea6cfb678016ae8195efa0c1d583d94bc80d08315ada88d7beb656ca36d3c88132c25fb7af8ff254d3f7740a7a8510754cdf3f703974a1768ea8e687e356
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: x64-mingw32
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