cpee-transformation 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +2 -0
  3. data/LICENSE +165 -0
  4. data/README.md +1 -0
  5. data/Rakefile +21 -0
  6. data/cpee-transformation.gemspec +29 -0
  7. data/lib/cpee/transformation/beautiful.rb +182 -0
  8. data/lib/cpee/transformation/bpmn2.rb +144 -0
  9. data/lib/cpee/transformation/cpee.rb +309 -0
  10. data/lib/cpee/transformation/dataflow.rb +127 -0
  11. data/lib/cpee/transformation/graphviz.rb +100 -0
  12. data/lib/cpee/transformation/implementation.rb +144 -0
  13. data/lib/cpee/transformation/implementation.xml +47 -0
  14. data/lib/cpee/transformation/mermaid.rb +242 -0
  15. data/lib/cpee/transformation/ptml.rb +316 -0
  16. data/lib/cpee/transformation/structures.rb +570 -0
  17. data/lib/cpee/transformation/target.rb +58 -0
  18. data/lib/cpee/transformation/text-bf.rb +201 -0
  19. data/lib/cpee/transformation/text-df-PO-extended.rb +221 -0
  20. data/lib/cpee/transformation/text-df-PO-reduced.rb +211 -0
  21. data/lib/cpee/transformation/transformation_text_cpee.xml +49 -0
  22. data/lib/cpee/transformation/transformation_xml_cpee.xml +49 -0
  23. data/lib/cpee/transformation/transformation_xml_text.xml +49 -0
  24. data/lib/cpee/transformation/transformer.rb +300 -0
  25. data/server/trans +38 -0
  26. data/tools/bpmn2_to_cpee.rb +84 -0
  27. data/tools/bpmn2_to_mermaid.rb +85 -0
  28. data/tools/bpmn2_to_ptml.rb +87 -0
  29. data/tools/cpee-trans +74 -0
  30. data/tools/cpee_to_cpee.rb +83 -0
  31. data/tools/cpee_to_dataflow.rb +83 -0
  32. data/tools/cpee_to_mermaid.rb +85 -0
  33. data/tools/cpee_to_ptml.rb +87 -0
  34. data/tools/cpee_to_text_bf.rb +85 -0
  35. data/tools/cpee_to_text_df-poe.rb +85 -0
  36. data/tools/cpee_to_text_df-por.rb +85 -0
  37. data/tools/mermaid_to_cpee.rb +85 -0
  38. data/tools/ptml_to_cpee.rb +87 -0
  39. metadata +160 -0
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/ruby
2
+ # encoding: UTF-8
3
+ #
4
+ # This file is part of CPEE-TRANSFORMATION.
5
+ #
6
+ # CPEE-TRANSFORMATION is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Lesser General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # CPEE-TRANSFORMATION is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with CPEE-TRANSFORMATION (file COPYING in the main directory). If not,
18
+ # see <http://www.gnu.org/licenses/>.
19
+
20
+ def wrap(s1, s2, width=78, indent=ARGV.options.summary_width + 3)
21
+ lines = []
22
+ s = ARGV.options.summary_indent + s1 + ' ' * (indent - s1.length - ARGV.options.summary_indent.length) + s2
23
+ line, s = s[0..indent-2], s[indent..-1]
24
+ s.split(/\n/).each do |ss|
25
+ ss.split(/[ \t]+/).each do |word|
26
+ if line.size + word.size >= width
27
+ lines << line
28
+ line = (" " * (indent)) + word
29
+ else
30
+ line << " " << word
31
+ end
32
+ end
33
+ lines << line if line
34
+ line = (" " * (indent-1))
35
+ end
36
+ return lines.join("\n")
37
+ end
38
+
39
+ require 'optparse'
40
+
41
+ require_relative '../lib/cpee/transformation/transformer' rescue nil
42
+ require_relative '../lib/cpee/transformation/cpee' rescue nil
43
+ require_relative '../lib/cpee/transformation/text-df-PO-reduced' rescue nil
44
+
45
+ interactive = false
46
+ printtree = false
47
+
48
+ ARGV.options { |opt|
49
+ opt.summary_indent = ' ' * 2
50
+ opt.summary_width = 18
51
+ opt.banner = "Usage:\n#{opt.summary_indent}#{File.basename($0)} FNAME\n"
52
+ opt.on("Options:")
53
+ opt.on("--help", "-h", "This text") { puts opt; exit }
54
+ opt.on("--interactive", "-i", "Interactive mode") { interactive = true }
55
+ opt.on("--tree", "-t", "Print tree") { printtree = true }
56
+ opt.on("")
57
+ opt.on(wrap("[FNAME]","convert cpee tree in file FNAME to cpee and output to console."))
58
+ opt.parse!
59
+ }
60
+
61
+ if ARGV.length != 1
62
+ puts ARGV.options
63
+ exit
64
+ else
65
+ f = ARGV[0]
66
+ end
67
+
68
+ model = CPEE::Transformation::Source::CPEE.new(File.read(f))
69
+
70
+ trans = CPEE::Transformation::Transformer.new(model)
71
+ traces = trans.build_traces
72
+
73
+ if interactive
74
+ puts traces.legend
75
+ puts
76
+ tree = trans.build_tree(true)
77
+ else
78
+ tree = trans.build_tree(false)
79
+ end
80
+
81
+ if printtree
82
+ puts tree.to_s
83
+ else
84
+ puts trans.generate_model(CPEE::Transformation::Target::Text_df_PO_reduced)
85
+ end
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/ruby
2
+ # encoding: UTF-8
3
+ #
4
+ # This file is part of CPEE-TRANSFORMATION.
5
+ #
6
+ # CPEE-TRANSFORMATION is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Lesser General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # CPEE-TRANSFORMATION is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with CPEE-TRANSFORMATION (file COPYING in the main directory). If not,
18
+ # see <http://www.gnu.org/licenses/>.
19
+
20
+ def wrap(s1, s2, width=78, indent=ARGV.options.summary_width + 3)
21
+ lines = []
22
+ s = ARGV.options.summary_indent + s1 + ' ' * (indent - s1.length - ARGV.options.summary_indent.length) + s2
23
+ line, s = s[0..indent-2], s[indent..-1]
24
+ s.split(/\n/).each do |ss|
25
+ ss.split(/[ \t]+/).each do |word|
26
+ if line.size + word.size >= width
27
+ lines << line
28
+ line = (" " * (indent)) + word
29
+ else
30
+ line << " " << word
31
+ end
32
+ end
33
+ lines << line if line
34
+ line = (" " * (indent-1))
35
+ end
36
+ return lines.join("\n")
37
+ end
38
+
39
+ require 'optparse'
40
+
41
+ require_relative '../lib/cpee/transformation/transformer' rescue nil
42
+ require_relative '../lib/cpee/transformation/cpee' rescue nil
43
+ require_relative '../lib/cpee/transformation/mermaid' rescue nil
44
+
45
+ interactive = false
46
+ printtree = false
47
+
48
+ ARGV.options { |opt|
49
+ opt.summary_indent = ' ' * 2
50
+ opt.summary_width = 18
51
+ opt.banner = "Usage:\n#{opt.summary_indent}#{File.basename($0)} FNAME\n"
52
+ opt.on("Options:")
53
+ opt.on("--help", "-h", "This text") { puts opt; exit }
54
+ opt.on("--interactive", "-i", "Interactive mode") { interactive = true }
55
+ opt.on("--tree", "-t", "Print tree") { printtree = true }
56
+ opt.on("")
57
+ opt.on(wrap("[FNAME]","convert mermaid in file FNAME to cpee tree and output to console."))
58
+ opt.parse!
59
+ }
60
+
61
+ if ARGV.length != 1
62
+ puts ARGV.options
63
+ exit
64
+ else
65
+ f = ARGV[0]
66
+ end
67
+
68
+ model = CPEE::Transformation::Source::Mermaid.new(File.read(f))
69
+
70
+ trans = CPEE::Transformation::Transformer.new(model)
71
+ traces = trans.build_traces
72
+
73
+ if interactive
74
+ puts traces.legend
75
+ puts
76
+ tree = trans.build_tree(true)
77
+ else
78
+ tree = trans.build_tree(false)
79
+ end
80
+
81
+ if printtree
82
+ puts tree.to_s
83
+ else
84
+ puts trans.generate_model(CPEE::Transformation::Target::CPEE)
85
+ end
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/ruby
2
+ # encoding: UTF-8
3
+ #
4
+ # This file is part of CPEE-TRANSFORMATION.
5
+ #
6
+ # CPEE-TRANSFORMATION is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Lesser General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # CPEE-TRANSFORMATION is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with CPEE-TRANSFORMATION (file COPYING in the main directory). If not,
18
+ # see <http://www.gnu.org/licenses/>.
19
+
20
+ def wrap(s1, s2, width=78, indent=ARGV.options.summary_width + 3)
21
+ lines = []
22
+ s = ARGV.options.summary_indent + s1 + ' ' * (indent - s1.length - ARGV.options.summary_indent.length) + s2
23
+ line, s = s[0..indent-2], s[indent..-1]
24
+ s.split(/\n/).each do |ss|
25
+ ss.split(/[ \t]+/).each do |word|
26
+ if line.size + word.size >= width
27
+ lines << line
28
+ line = (" " * (indent)) + word
29
+ else
30
+ line << " " << word
31
+ end
32
+ end
33
+ lines << line if line
34
+ line = (" " * (indent-1))
35
+ end
36
+ return lines.join("\n")
37
+ end
38
+
39
+ require 'optparse'
40
+
41
+ require_relative '../lib/cpee/transformation/transformer' rescue nil
42
+ require_relative '../lib/cpee/transformation/cpee' rescue nil
43
+ require_relative '../lib/cpee/transformation/ptml' rescue nil
44
+
45
+ interactive = false
46
+ printtree = false
47
+
48
+ ARGV.options { |opt|
49
+ opt.summary_indent = ' ' * 2
50
+ opt.summary_width = 18
51
+ opt.banner = "Usage:\n#{opt.summary_indent}#{File.basename($0)} FNAME\n"
52
+ opt.on("Options:")
53
+ opt.on("--help", "-h", "This text") { puts opt; exit }
54
+ opt.on("--interactive", "-i", "Interactive mode") { interactive = true }
55
+ opt.on("--tree", "-t", "Print tree") { printtree = true }
56
+ opt.on("")
57
+ opt.on(wrap("[FNAME]","convert cpee tree in file FNAME to cpee and output to console."))
58
+ opt.parse!
59
+ }
60
+
61
+ if ARGV.length != 1
62
+ puts ARGV.options
63
+ exit
64
+ else
65
+ f = ARGV[0]
66
+ end
67
+
68
+ model = CPEE::Transformation::Source::PTML.new(File.read(f))
69
+
70
+ trans = CPEE::Transformation::Transformer.new(model)
71
+ traces = trans.build_traces
72
+
73
+ if interactive
74
+ puts traces.legend
75
+ puts
76
+ tree = trans.build_tree(true)
77
+ else
78
+ tree = trans.build_tree(false)
79
+ end
80
+
81
+ #pp tree
82
+
83
+ if printtree
84
+ puts tree.to_s
85
+ else
86
+ puts trans.generate_model(CPEE::Transformation::Target::CPEE)
87
+ end
metadata ADDED
@@ -0,0 +1,160 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cpee-transformation
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Juergen eTM Mangler
8
+ - Nataliia Klievtsova
9
+ bindir: tools
10
+ cert_chain: []
11
+ date: 1980-01-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: riddl
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.10'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: xml-smart
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.4'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: typhoeus
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.4'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: highline
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.0'
83
+ description: see http://cpee.org
84
+ email: juergen.mangler@gmail.com
85
+ executables:
86
+ - bpmn2_to_cpee.rb
87
+ - bpmn2_to_mermaid.rb
88
+ - bpmn2_to_ptml.rb
89
+ - cpee-trans
90
+ - cpee_to_cpee.rb
91
+ - cpee_to_mermaid.rb
92
+ - cpee_to_ptml.rb
93
+ - cpee_to_text_bf.rb
94
+ - cpee_to_text_df-poe.rb
95
+ - cpee_to_text_df-por.rb
96
+ - mermaid_to_cpee.rb
97
+ - ptml_to_cpee.rb
98
+ extensions: []
99
+ extra_rdoc_files:
100
+ - README.md
101
+ files:
102
+ - AUTHORS
103
+ - LICENSE
104
+ - README.md
105
+ - Rakefile
106
+ - cpee-transformation.gemspec
107
+ - lib/cpee/transformation/beautiful.rb
108
+ - lib/cpee/transformation/bpmn2.rb
109
+ - lib/cpee/transformation/cpee.rb
110
+ - lib/cpee/transformation/dataflow.rb
111
+ - lib/cpee/transformation/graphviz.rb
112
+ - lib/cpee/transformation/implementation.rb
113
+ - lib/cpee/transformation/implementation.xml
114
+ - lib/cpee/transformation/mermaid.rb
115
+ - lib/cpee/transformation/ptml.rb
116
+ - lib/cpee/transformation/structures.rb
117
+ - lib/cpee/transformation/target.rb
118
+ - lib/cpee/transformation/text-bf.rb
119
+ - lib/cpee/transformation/text-df-PO-extended.rb
120
+ - lib/cpee/transformation/text-df-PO-reduced.rb
121
+ - lib/cpee/transformation/transformation_text_cpee.xml
122
+ - lib/cpee/transformation/transformation_xml_cpee.xml
123
+ - lib/cpee/transformation/transformation_xml_text.xml
124
+ - lib/cpee/transformation/transformer.rb
125
+ - server/trans
126
+ - tools/bpmn2_to_cpee.rb
127
+ - tools/bpmn2_to_mermaid.rb
128
+ - tools/bpmn2_to_ptml.rb
129
+ - tools/cpee-trans
130
+ - tools/cpee_to_cpee.rb
131
+ - tools/cpee_to_dataflow.rb
132
+ - tools/cpee_to_mermaid.rb
133
+ - tools/cpee_to_ptml.rb
134
+ - tools/cpee_to_text_bf.rb
135
+ - tools/cpee_to_text_df-poe.rb
136
+ - tools/cpee_to_text_df-por.rb
137
+ - tools/mermaid_to_cpee.rb
138
+ - tools/ptml_to_cpee.rb
139
+ homepage: http://github.com/etm/cpee-transformation/
140
+ licenses:
141
+ - LGPL-3.0-or-later
142
+ metadata: {}
143
+ rdoc_options: []
144
+ require_paths:
145
+ - lib
146
+ required_ruby_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '3.4'
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ requirements: []
157
+ rubygems_version: 3.6.9
158
+ specification_version: 4
159
+ summary: CPEE Transformation between different formats
160
+ test_files: []