expressir 0.2.12-x86-linux → 0.2.13-x86-linux

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: 432faff204670f985cc301c087b0c9da0c689b08f0a848a95fc3e3f95fc6b7b4
4
- data.tar.gz: 59403e704f248d53d94663a8ece3d6a7650f895e8edd416983701e0b91f42f4b
3
+ metadata.gz: e6e386d0da58e4380e96a8e7f5c7830fe7cb8ab24bf2ab6e7d0c7e2e50101a71
4
+ data.tar.gz: 96103115ba3e78375c208fc61ce77ddd765def0de6aba68a2f0767fe0c63a96b
5
5
  SHA512:
6
- metadata.gz: f3291946e2a534e087d8f288bdcba3e43854280a2d4ffda087cfbbad25ca1f4517dc14dda9a6f2ae57b9804aeff86b25a158bc686c4d2f8777648fbd1913ccfa
7
- data.tar.gz: 7a2c7cc654c8ac2518f659006ffd006830f7f58c93eaf908af7714d58f7a25ba63964f2e13ea09cf036fc527ab4d46133dee7bdc3dec20248c1767bd33e2504f
6
+ metadata.gz: 314ed535af084a77e131086df422c77299d87feecc3604d9312287f7c422d7930209f3093caf8dd886b3c7b792a178e381058b38c8f46181f38a04b04066ffbe
7
+ data.tar.gz: 3f7b0e37b739910d7e355ae78fa2f63fe159bbf7e12ca29a3884ecbc166986a628a787593a6b857e7b1aaa26a0649118072cc349a643435253bf14783e75889f
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: x86-linux
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