expressir 1.4.0-aarch64-linux-musl → 1.4.1-aarch64-linux-musl

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: 788171b2c211865a34b9958696978a1b576659d97b0e5352113e1f05379ade42
4
- data.tar.gz: c7c3cae3359c3392202bbd00369a042145f938b7cf80a2be06dcfdcd9ed737bf
3
+ metadata.gz: 9fb400415f0b9a4f590d9208fd235fa13ef9c82f04530022859515671526b3a9
4
+ data.tar.gz: 88d7b42bd1e8a8b7e6e9c1939a11a30e0e3239f603ee11fe75d58b2eb650e223
5
5
  SHA512:
6
- metadata.gz: 16b483c8469591dcda4773ff58e85235c48b1396a28fd9d86081f37f7be37c18992cf2168d85ee52508e598667617cce23fa310dd73c1550a236c2bdd4c29693
7
- data.tar.gz: 9fd20cc1b5d640c4e9b9a5de2cd955f885acd98b9f760346daa818def88e85bde430556d05ef2c2d0a53ec1dd1afb9a06ce424e89b43d3299339f1262d906651
6
+ metadata.gz: e0c130a088be2af900585efd372348c2e5c10477904fc38c43063a293351d374884010b40bc28a8e4e81b970a9096c16e12ce696a2c8e758df9566745903561b
7
+ data.tar.gz: 694280ee151d894899ed46c7bc444a6e0ca90f9d854098cb32062e8d943441c3fc224e8bbd1f2ef538ce2df1808e95808d49959ca48223df997ea18839dcf58e
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-musl
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