expressir 1.4.0-x64-mingw-ucrt → 1.4.1-x64-mingw-ucrt

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: 5427972511a7b60d62589bc7db148a3ddf04e337d34c20113cbaee342be69cf3
4
- data.tar.gz: 6b5d5d7824748ce9ae10f3313a1277e84bf6d89b865c1febc6c26d41505736fa
3
+ metadata.gz: e0194e48bbdd6d7fc85d1a7c3d1c0b1b0011b5d7cdb0e3767adb30e454ea3ed2
4
+ data.tar.gz: 2087b9807baa0bebb3006f126875418e99c2930524b948250f99c1c8f4b6979e
5
5
  SHA512:
6
- metadata.gz: 2035812d4e017171c99041ebfca52d1ef54ed5215663253bbef36a17430f03d3dff815473905dd3e07a2cd91594dd2ce4acdb8ea4e3b5d68a7280c5bd3b96a10
7
- data.tar.gz: ba2f6bbaa32ff178ed58e1f072dac5f5bc423ae161e11d6171f357e8e364c202fe3ef397885c8d78915bf26378d13517fd0b230aba128cd74a5b78887ef718af
6
+ metadata.gz: 2a7509fc580e9466689cf9ec82f41db7f0d057924cfedd325cc752a7668838aba86ba36a6646c82c5697b28605d540e1f3de5abd437a2361ddbbb691c8f521e1
7
+ data.tar.gz: c84c915de3f7882285e51396797c0e4fb9eed60eb2f934dc76b981226b15ef35502dbcfaa3fafb517d9479e73a7b8e43cdf54822346cce54c2a44bd337069168
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-mingw-ucrt
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