xmi 0.3.5 → 0.3.6

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: cf6faff1b8093081d01e1a58aa0f226c3803855f8ff172759708e87afd046454
4
- data.tar.gz: 14a1169f7ea7294d7b6e995bc631432ed222dd98785e5ecd928788135c095a0f
3
+ metadata.gz: 302b69df31217eb74d01a40473d3ed50a35af959c331be1424aadd2262759703
4
+ data.tar.gz: 63d413fddf71518961876467bc6a87bd99686e3c3367f9e3510921c4047765da
5
5
  SHA512:
6
- metadata.gz: 89bef5249d1599e1b15a9b30b8a81a51b8a804aad1747705370ec17b21d70205b2680630ecda4308b85252fed01cbca548de2764c9bbef296fc951f29ebcfd6d
7
- data.tar.gz: 72245cd81433e6d6942b7b7a3448d8008b5523524bc1dad0b8537fdceb57e8981a747e3e7f4e44d70c12514cf9869d9876425eafce0692d5a00f28d3de0ecb10
6
+ metadata.gz: 4b484e2d65d687acb0671498f36929a5eaf30ef9275460ee0a66f716f38a5d088795dd9e5c10833e004d12304c1d544b8622c25fb88b79fcf5eb0a453ba9f267
7
+ data.tar.gz: d4da102f2b81e27e0b4a8fd62817d3bf0ba2cb9b2e33dece2ccb56b21c9664af72e2df628a7e4e031799b03b699e284477520e39b07fe3cfd9a4c57663bce4e9
data/lib/xmi/ea_root.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ Dir[File.join(__dir__, "extensions", "*.rb")].each { |file| require file }
4
+
3
5
  require "nokogiri"
4
6
 
5
7
  module Xmi
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ class EaRoot
5
+ module Eauml
6
+ class Import < Shale::Mapper
7
+ attribute :base_package_import, Shale::Type::String
8
+
9
+ xml do
10
+ root "import"
11
+
12
+ map_attribute "base_PackageImport", to: :base_package_import
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ Dir[File.join(__dir__, "ea_extensions", "*.rb")].each { |file| require file }
4
+
5
+ module Xmi
6
+ class EaRoot
7
+ module Gml
8
+ class ApplicationSchema < Shale::Mapper
9
+ attribute :version, Shale::Type::String
10
+ attribute :xsd_document, Shale::Type::String
11
+ attribute :xmlns, Shale::Type::String
12
+ attribute :target_namespace, Shale::Type::String
13
+ attribute :base_package, Shale::Type::String
14
+
15
+ xml do
16
+ root "ApplicationSchema"
17
+
18
+ map_attribute "version", to: :version
19
+ map_attribute "xsdDocument", to: :xsd_document
20
+ map_attribute "xmlns", to: :xmlns
21
+ map_attribute "targetNamespace", to: :target_namespace
22
+ map_attribute "base_Package", to: :base_package
23
+ end
24
+ end
25
+
26
+ class CodeList < Shale::Mapper
27
+ attribute :as_dictionary, Shale::Type::String
28
+ attribute :default_code_space, Shale::Type::String
29
+ attribute :base_class, Shale::Type::String
30
+
31
+ xml do
32
+ root "CodeList"
33
+
34
+ map_attribute "asDictionary", to: :as_dictionary
35
+ map_attribute "defaultCodeSpace", to: :default_code_space
36
+ map_attribute "base_Class", to: :base_class
37
+ end
38
+ end
39
+
40
+ class Property < Shale::Mapper
41
+ attribute :sequence_number, Shale::Type::String
42
+ attribute :base_property, Shale::Type::String
43
+
44
+ xml do
45
+ root "property"
46
+
47
+ map_attribute "sequenceNumber", to: :sequence_number
48
+ map_attribute "base_Property", to: :base_property
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
data/lib/xmi/sparx.rb CHANGED
@@ -946,13 +946,18 @@ module Xmi
946
946
  end
947
947
 
948
948
  module SparxRootAttributes
949
- def self.included(klass)
949
+ def self.included(klass) # rubocop:disable Metrics/MethodLength
950
950
  klass.class_eval do
951
951
  attribute :publication_date, SparxCustomProfilePublicationDate
952
952
  attribute :edition, SparxCustomProfileEdition
953
953
  attribute :number, SparxCustomProfileNumber
954
954
  attribute :year_version, SparxCustomProfileYearVersion
955
955
  attribute :modelica_parameter, SparxSysPhS
956
+
957
+ attribute :eauml_import, EaRoot::Eauml::Import, collection: true
958
+ attribute :gml_application_schema, EaRoot::Gml::ApplicationSchema, collection: true
959
+ attribute :gml_code_list, EaRoot::Gml::CodeList, collection: true
960
+ attribute :gml_property, EaRoot::Gml::Property, collection: true
956
961
  end
957
962
  end
958
963
  end
@@ -988,6 +993,18 @@ module Xmi
988
993
  map_element "ModelicaParameter", to: :modelica_parameter,
989
994
  namespace: "http://www.sparxsystems.com/profiles/SysPhS/1.0",
990
995
  prefix: "SysPhS"
996
+ map_element "import", to: :eauml_import,
997
+ namespace: "http://www.sparxsystems.com/profiles/EAUML/1.0",
998
+ prefix: "EAUML"
999
+ map_element "ApplicationSchema", to: :gml_application_schema,
1000
+ namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
1001
+ prefix: "GML"
1002
+ map_element "CodeList", to: :gml_code_list,
1003
+ namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
1004
+ prefix: "GML"
1005
+ map_element "property", to: :gml_property,
1006
+ namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
1007
+ prefix: "GML"
991
1008
  MAP
992
1009
 
993
1010
  @@mapping ||= @@default_mapping # rubocop:disable Style/ClassVars
@@ -1028,6 +1045,18 @@ module Xmi
1028
1045
  map_element "ModelicaParameter", to: :modelica_parameter,
1029
1046
  namespace: "http://www.sparxsystems.com/profiles/SysPhS/1.0",
1030
1047
  prefix: "SysPhS"
1048
+ map_element "import", to: :eauml_import,
1049
+ namespace: "http://www.sparxsystems.com/profiles/EAUML/1.0",
1050
+ prefix: "EAUML"
1051
+ map_element "ApplicationSchema", to: :gml_application_schema,
1052
+ namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
1053
+ prefix: "GML"
1054
+ map_element "CodeList", to: :gml_code_list,
1055
+ namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
1056
+ prefix: "GML"
1057
+ map_element "property", to: :gml_property,
1058
+ namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
1059
+ prefix: "GML"
1031
1060
  MAP
1032
1061
 
1033
1062
  @@mapping ||= @@default_mapping # rubocop:disable Style/ClassVars
data/lib/xmi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Xmi
4
- VERSION = "0.3.5"
4
+ VERSION = "0.3.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -132,6 +132,8 @@ files:
132
132
  - lib/xmi/documentation.rb
133
133
  - lib/xmi/ea_root.rb
134
134
  - lib/xmi/extension.rb
135
+ - lib/xmi/extensions/eauml.rb
136
+ - lib/xmi/extensions/gml.rb
135
137
  - lib/xmi/replace.rb
136
138
  - lib/xmi/root.rb
137
139
  - lib/xmi/root13.rb