cpee-logging-xes-yaml 1.3.3 → 1.3.4

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: 5d0f1a3d5cdf89d14a2c7ff96d36f0d331496ca095d4c395c49c770e827ed279
4
- data.tar.gz: 67c87266391555e7dd326420e341549314d3b111b036637c965e42300972489d
3
+ metadata.gz: aab20ce260e56f4571add36cef8c7fe6f638fad4a723d28f8a13e6e93e99a32c
4
+ data.tar.gz: 122128fd3e956198fc7096409ff1f64bf47d0e17f5f2e72dd2f4cf3d138ea173
5
5
  SHA512:
6
- metadata.gz: 97bdab2b3cfaafb419e5dd20a87eab3ec096a08a15c22fac43f1a7209e3a440bb31246007c85f38dc51ed60ed28115d651191c4de24aae6d8480341e7d286cc1
7
- data.tar.gz: 434309fe76ed0653a8af989e4fd074c21d2164f37518d4808c54fe8bb77bd8c86b2bf1f6aa39fa556070a68d32a13b4262052a7caa2089237e84b14d7394f88b
6
+ metadata.gz: f36ec97639c73e0735250eee61c39febc1b43e2bab34912780be9a393ccedc45ef3cffdcfd97cd432145a73fcb0935e10dfc405bdd9500117de9afb53522b9de
7
+ data.tar.gz: 242461d18564a0c2fb9b2b5992e45a99e7506e79aab3eaa08be4c4a1bc4846733b39bc49b7b6e5c7714f719e74ce6afd6fa8225a91642be3188f61c597dfa4f2
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-logging-xes-yaml"
3
- s.version = "1.3.3"
3
+ s.version = "1.3.4"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Logging for the cloud process execution engine (cpee.org)"
@@ -16,7 +16,6 @@
16
16
  # CPEE-LOGGING-XES-YAML (file LICENSE in the main directory). If not, see
17
17
  # <http://www.gnu.org/licenses/>.
18
18
 
19
- curpath = __dir__
20
19
  require 'rubygems'
21
20
  require 'optparse'
22
21
  require 'fileutils'
@@ -27,16 +26,18 @@ require 'stringio'
27
26
  require 'typhoeus'
28
27
  require 'date'
29
28
 
30
- def wrap(s, width=78, indent=19, extra_indent=4)
29
+ def wrap(s, width=78, indent=19, extra_indent=2)
31
30
  lines = []
32
- line, s = s[0..indent-2], s[indent..-1]
33
- s.split(/\n/).each do |ss|
34
- ss.split(/[ \t]+/).each do |word|
31
+ line, s = s[0..indent-1], s[indent..-1]
32
+ s.split(/\n/).each_with_index do |ss,i|
33
+ ss.split(/[ \t]+/).each_with_index do |word,j|
35
34
  if line.size + word.size >= width
36
35
  lines << line
37
- line = (" " * (indent + extra_indent)) + word
36
+ line = (" " * (indent)) + word
38
37
  else
39
- line << " " << word
38
+ line << " " if i > 0 || j != 0
39
+ line << (" " * (extra_indent)) if i > 0 && j == 0
40
+ line << word
40
41
  end
41
42
  end
42
43
  lines << line if line
@@ -100,7 +101,7 @@ def extract(path)
100
101
  text = response.response_body
101
102
  end
102
103
  else
103
- text = File.read(File.join(__dir__,path))
104
+ text = File.read(path)
104
105
  end
105
106
  yaml = Psych.load_stream(text)
106
107
  changes = []
@@ -147,13 +148,16 @@ ARGV.options { |opt|
147
148
  opt.on("Options:")
148
149
  opt.on("--help", "-h", "This text") { puts opt; exit }
149
150
  opt.on("")
151
+ opt.on(wrap("\"#{exname}\" will be call \"c\" in the examples for each command."))
152
+ exname = 'c'
153
+ opt.on("")
150
154
  opt.on(wrap("new [DIR] scaffolds a sample logging service. Add a handler to a cpee instance to experience the pleasure."))
151
155
  opt.on("")
152
156
  opt.on(wrap("view [DIR] view the dependencies between processes and subprocesses. Works for local and remote logs. Examples:\n#{exname} view https://cpee.org/log/123.xes.yaml\n#{exname} view https://cpee.org/log/a.xes.yaml > index.txt\n#{exname} view ~/log/logs/456.xes.yaml"))
153
157
  opt.on("")
154
- opt.on(wrap("copy [DIR] copy dependent processes and subprocesses to the current directory. Works for local and remote logs. Examples:\n#{exname} copy https://cpee.org/log/123.xes.yaml\n#{exname} copy ~/log/logs/456.xes.yaml"))
158
+ opt.on(wrap("copy [DIR] copy dependent processes and subprocesses to the current directory. Works for local and remote logs. Examples: \n#{exname} copy https://cpee.org/log/123.xes.yaml\n#{exname} copy ~/log/logs/456.xes.yaml"))
155
159
  opt.on("")
156
- opt.on(wrap("extract-all [LOG] extract cpee testset from cpee xes-yaml log. Works for local and remote logs. Write logs to files in folder named like the instance uuid contained in the log. Examples:\n#{exname} extract https://cpee.org/log/123.xes.yaml\n#{exname} extract ~/log/logs/456.xes.yaml"))
160
+ opt.on(wrap("extract-all [LOG] extract cpee testset from cpee xes-yaml log. Works for local and remote logs. Write logs to files in folder named like the instance uuid contained in the log. Examples: \n#{exname} extract https://cpee.org/log/123.xes.yaml\n#{exname} extract ~/log/logs/456.xes.yaml"))
157
161
  opt.on("")
158
162
  opt.on(wrap("extract-last [LOG] extract cpee testset from cpee xes-yaml log. Works for local and remote logs. Write last revision of the model to stdout. Examples:\n#{exname} extract https://cpee.org/log/123.xes.yaml\n#{exname} extract ~/log/logs/456.xes.yaml"))
159
163
  opt.parse!
@@ -168,7 +172,7 @@ end
168
172
 
169
173
  if command == 'new'
170
174
  if !File.exist?(path)
171
- FileUtils.cp_r(File.join(curpath,'..','server'),path)
175
+ FileUtils.cp_r(File.join(__dir__,'..','server'),path)
172
176
  FileUtils.mkdir(File.join(path,'logs')) rescue nil
173
177
  else
174
178
  puts 'Directory already exists.'
@@ -196,7 +200,7 @@ elsif command == 'extract-all'
196
200
  unless desc.nil?
197
201
  description.replace_by(XML::Smart.string(desc).root())
198
202
  end
199
- dirname = File.join(__dir__,uuid)
203
+ dirname = File.join(uuid)
200
204
  filename = File.join(dirname,"#{uuid}_#{version}.xml")
201
205
  Dir.mkdir(dirname) unless Dir.exist?(dirname)
202
206
  File.write(filename, xml.to_s())
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-logging-xes-yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: tools
11
11
  cert_chain: []
12
- date: 2024-01-16 00:00:00.000000000 Z
12
+ date: 2024-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: riddl