expressir 1.4.0 → 1.4.1

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: c715677941cba222f7a4021ab2e392272e39646afb83c739350a845e0d7f0918
4
- data.tar.gz: eb8de33aa98749b1518305b4b34c0f49a685829739ddc79f784b0b2d4d4a68a8
3
+ metadata.gz: 208b131138dadcd6995ee2ccf1f7e0042538010a53a8e1b35484d338f1e78646
4
+ data.tar.gz: 7e7bd2d8921c04812698286db2042e8eed3c7fa76a432619dbb3f6555a408184
5
5
  SHA512:
6
- metadata.gz: '0349a84ac72ce995d67070fd27a9f2b543ca0b4f6e10ae5e4f47606287575261b3e76540b55b3517a6273882b6b1a2f94ee2771a9382e7e49c3b584b0cd56146'
7
- data.tar.gz: 592ec3ace51fd074f297fd8381ccf9fb0fbaf1d0fa6dfbf7327c28778ef92b07222ae70b93b8ca2e64504815ebdb06d66cf68e32c656b8c5611bb471aa81d9bb
6
+ metadata.gz: 81d19ac206d1026ec9e8059dfcf845fc9cc53490f9c2d0cc454d03158f13a9e91c80d9add555d7ac9795520ffaba7959c99c42a4589be92a6381989def8423e9
7
+ data.tar.gz: 1ee2fc3fa00b77057e81a7dc3979a5002c18813a71b61b4adda8a83bee02724717e783e2ddc21393fac04aa249ee4805a126d5a5774f1ae37eb2b153f97348de
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: ruby
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: rice
@@ -742,7 +742,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
742
742
  - !ruby/object:Gem::Version
743
743
  version: '0'
744
744
  requirements: []
745
- rubygems_version: 3.3.26
745
+ rubygems_version: 3.3.27
746
746
  signing_key:
747
747
  specification_version: 4
748
748
  summary: ISO EXPRESS parser and tools in Ruby.