expressir 0.2.12-arm64-darwin → 0.2.13-arm64-darwin

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: 752baf32f6dd6ee50c00a7816890e657cca06bf2d6caeb7fb59f2c9b26a76de4
4
- data.tar.gz: 6956c5eb8889afabb1ba99cc81111e1f175425f2ae77d35e3d7964b662d7d77d
3
+ metadata.gz: ad9bdb019911b86897a5a40fd6e4fb4d76bc687426b78584f8f32ba30839682c
4
+ data.tar.gz: 2ffedeba944df494f9388788ea44bc1ccbe7393cd273fe526847b911f24d4a32
5
5
  SHA512:
6
- metadata.gz: a611a4cc0b0f00e98ccd2ee99d2fa3331fb8fbb2541555314c9afc1ac892a05a514a8f9902d99c896bd0a752ad2ade1986e7d3569e17852d2236792546a4e61a
7
- data.tar.gz: 02e514f4037f7bb3e543aef11db5c9a7dd60fec258753e4dccebaf561ccf6b2b72b782b50b2ece15df41186c366457c1f023f7e29ec67f0b1907eb6443920a55
6
+ metadata.gz: 0532c0148e0a0b88b91919ad1993e0d8dd3c3aca0816bcc60cf817270b5d8a05564cd2e182b39ed8b1e13f00489bb39a85624c428c8ba7279e7531ab7056ebaa
7
+ data.tar.gz: 52c300c3f01a1c0ea3b3e80a11596495db0447a0a7238ad43d857e5ef5daa9a038f59cd70ead54ea3b9887e6e3b51b5ce84b401d8313bc8a1ed4663e2e1482a5
data/exe/format CHANGED
@@ -6,11 +6,15 @@ require "expressir/express_exp/hyperlink_formatter"
6
6
  input_files = [
7
7
  '../iso-10303-stepmod/data/resources/action_schema/action_schema_annotated.exp',
8
8
  '../iso-10303-stepmod/data/resources/basic_attribute_schema/basic_attribute_schema_annotated.exp',
9
- '../iso-10303-stepmod/data/resources/support_resource_schema/support_resource_schema_annotated.exp'
9
+ '../iso-10303-stepmod/data/resources/support_resource_schema/support_resource_schema_annotated.exp',
10
+ # cyclic reference
11
+ # '../iso-10303-stepmod/data/resources/product_property_definition_schema/product_property_definition_schema_annotated.exp',
12
+ # '../iso-10303-stepmod/data/resources/product_property_representation_schema/product_property_representation_schema_annotated.exp'
10
13
  ]
11
14
 
12
15
  repo = Expressir::ExpressExp::Parser.from_files(input_files)
13
16
  schema = repo.schemas.find{|x| x.id == 'action_schema'}
17
+ # schema = repo.schemas.find{|x| x.id == 'product_property_definition_schema'}
14
18
  result = Expressir::ExpressExp::HyperlinkFormatter.format(schema)
15
19
 
16
20
  puts result
@@ -34,10 +34,19 @@ module Expressir
34
34
  super
35
35
  end
36
36
 
37
- def children
37
+ def children(item_ids = nil)
38
38
  items = []
39
- # TODO: select interface items
40
- items.push(*@interfaces.flat_map{|x| parent.schemas.find{|y| x.schema.id == y.id}&.children || []})
39
+ unless item_ids and item_ids.length > 0
40
+ items.push(*@interfaces.flat_map do |interface|
41
+ schema = parent.schemas.find{|y| interface.schema.id == y.id}
42
+ interface_item_ids = if interface.items
43
+ # TODO: support renamed references
44
+ interface.items.select{|x| x.is_a? Model::Expressions::SimpleReference}.map{|x| x.id}
45
+ end
46
+ schema_items = schema&.children(interface_item_ids) || []
47
+ schema_items
48
+ end)
49
+ end
41
50
  items.push(*@constants)
42
51
  items.push(*@types)
43
52
  items.push(*@types.flat_map{|x| x.type.is_a?(Expressir::Model::Types::Enumeration) ? x.type.items : []})
@@ -46,6 +55,9 @@ module Expressir
46
55
  items.push(*@functions)
47
56
  items.push(*@procedures)
48
57
  items.push(*@rules)
58
+ if item_ids and item_ids.length > 0
59
+ items = items.select{|x| item_ids.include?(x.id)}
60
+ end
49
61
  items
50
62
  end
51
63
  end
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "0.2.12".freeze
2
+ VERSION = "0.2.13".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: 0.2.12
4
+ version: 0.2.13
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2021-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri