flor 1.1.0 → 1.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62c06708e2abc35f1b43c2cf9ecaf73d5f89633433c60af3864450d91ccabf47
4
- data.tar.gz: 33d4531561c77d0f43cd97a51775d1079a41885650df73583c26050846177087
3
+ metadata.gz: 553a980e772a1ce1d8990fc8d0744163b6615c5e9a4fe391d48ab73ac2219b2a
4
+ data.tar.gz: 7b922c56e568ac51cbb9cc3dbcb02c930984f94785ddd3b8ea76804ccff848de
5
5
  SHA512:
6
- metadata.gz: b27557dcfbf250d1b0af9c4220a140b66e84aceb0506d947a51a1440fabf385f21b2ce125c08178bf68d5c13b87ee3d9967fdf0a46d5ef3b473991b3329139c4
7
- data.tar.gz: 48fdc31b116360526afa4fe6b40e0b550c04bc451085aac55005f28add44bb30802029218f73fd898965b54f2a88acb95eb9420e73ca83d494b9fed1fdf64cf7
6
+ metadata.gz: fc920c9d3f305e3e31f174ebbb5d8e7f935742a9b5bcd5a75b80646d5803746315e91e4937156a01f3fcc512c477b8770e6a665a86bd61a81120f0e305027652
7
+ data.tar.gz: 4dd48c11b6f59d2efc4aec15060d0c7db07541b1af4037dc8402b6ef701f43b88928aaaf3306e6ae0e1237a79f5fb360c992cf58648e26edb398f7adf843970e
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## flor 1.1.1 released 2021-03-03
6
+
7
+ * Use YAML to have more compact msg_to_detail_s
8
+
9
+
5
10
  ## flor 1.1.0 released 2021-01-06
6
11
 
7
12
  * Introduce Tasker #set_payload and #set_vars
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2015-2020, John Mettraux, jmettraux+flor@gmail.com
2
+ Copyright (c) 2015-2021, John Mettraux, jmettraux+flor@gmail.com
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  # flor
3
3
 
4
- [![Build Status](https://secure.travis-ci.org/floraison/flor.svg)](http://travis-ci.org/floraison/flor)
4
+ [![tests](https://github.com/floraison/flor/workflows/test/badge.svg)](https://github.com/floraison/flor/actions)
5
5
  [![Gem Version](https://badge.fury.io/rb/flor.svg)](http://badge.fury.io/rb/flor)
6
6
 
7
7
  Flor is a "Ruby workflow engine", if that makes any sense.
data/lib/flor.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'pp'
4
4
  require 'json'
5
+ require 'yaml'
5
6
  require 'logger'
6
7
  require 'thread'
7
8
  require 'digest'
@@ -15,7 +16,7 @@ require 'dense'
15
16
 
16
17
  module Flor
17
18
 
18
- VERSION = '1.1.0'
19
+ VERSION = '1.1.1'
19
20
  end
20
21
 
21
22
  require 'flor/colours'
data/lib/flor/flor.rb CHANGED
@@ -329,6 +329,11 @@ module Flor
329
329
  isostamp(false, true, true, t)
330
330
  end
331
331
 
332
+ def monow
333
+
334
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
335
+ end
336
+
332
337
  # def to_time(ts)
333
338
  #
334
339
  # m = ts.match(/\A(\d{4})(\d{2})(\d{2})\.(\d{2})(\d{2})(\d{2})(\d+)([uU]?)\z/)
data/lib/flor/log.rb CHANGED
@@ -334,18 +334,22 @@ module Flor
334
334
  n = executor.execution['nodes'][nid]
335
335
  node = n ? Flor::Node.new(executor, n, m) : nil
336
336
 
337
- o.puts "#{_c.dg}<Flor.msg_to_detail_s>#{_c.rs}#{_c.yl}"
338
- o.puts Flor.to_pretty_s(m)
339
- o.puts "#{_c.dg}payload:#{_c.yl}"
340
- o.puts Flor.to_pretty_s(m['payload'], 0)
341
- o.puts "#{_c.dg}tree:"
337
+ o.puts "#{_c.rs}#{_c.dg}<Flor.msg_to_detail_s>"
338
+
339
+ o.puts "#{_c.dg}message:#{_c.yl}"
340
+ o.puts YAML.dump(m)
341
+
342
+ o.puts "#{_c.dg}tree:#{_c.yl}"
342
343
  o.puts(tree_to_s(node.lookup_tree(nid), nid, out: o)) if node
344
+
343
345
  o.puts "#{_c.dg}node:#{_c.yl}"
344
- o.puts(Flor.to_pretty_s(n)) if n
345
- o.puts "#{_c.dg}nodes:"
346
+ o.puts YAML.dump(n.merge('tree' => '(above)'))
347
+
348
+ o.puts "#{_c.dg}nodes:#{_c.yl}"
346
349
  o.puts nods_to_s(executor, m, opts)
347
350
  z = executor.execution['nodes'].size
348
351
  o.puts "#{_c.yl}#{z} node#{z == 1 ? '' : 's'}."
352
+
349
353
  o.puts "#{_c.dg}</Flor.msg_to_detail_s>#{_c.rs}"
350
354
 
351
355
  o.string
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'flor/punit/m_ram'
3
+ require 'flor/punit/m_receive_and_merge'
4
4
 
5
5
 
6
6
  # Parent class for "c-for-each" and "c-map"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'flor/punit/m_ram'
3
+ require 'flor/punit/m_receive_and_merge'
4
4
 
5
5
 
6
6
  class Flor::Pro::Concurrence < Flor::Procedure
@@ -387,10 +387,11 @@ class Flor::Pro::Concurrence < Flor::Procedure
387
387
 
388
388
  REWRITE_AS_ATTS = %w[
389
389
  on_receive on_merge
390
- child_on_error children_on_error ]
391
- #
392
- # heads of the child nodes that should get rewritten as attributes
393
- # of the concurrence ...
390
+ child_on_error children_on_error
391
+ ].freeze
392
+ #
393
+ # heads of the child nodes that should get rewritten as attributes
394
+ # of the concurrence ...
394
395
 
395
396
  def pre_execute_rewrite
396
397
 
File without changes
@@ -23,7 +23,7 @@ module Flor
23
23
  @exitstatus = exitstatus
24
24
  end
25
25
 
26
- def pid; @process.pid; end
26
+ def pid; @process.pid; rescue; nil; end
27
27
  end
28
28
 
29
29
  def spawn(conf, data)
@@ -41,7 +41,7 @@ module Flor
41
41
  henv.each { |k, v| builder.environment.put(k, v) }
42
42
 
43
43
  process = builder.start
44
- pid = process.pid
44
+ pid = process.respond_to?(:pid) ? process.pid : nil
45
45
 
46
46
  o = process.outputStream.to_io
47
47
  i = process.inputStream.to_io
@@ -61,10 +61,12 @@ module Flor
61
61
 
62
62
  rescue => err
63
63
 
64
- Process.detach(pid) \
65
- if pid
66
- (Process.kill(9, pid) rescue nil) \
67
- unless Flor.no?(conf['on_error_kill'])
64
+ if pid
65
+ Process.detach(pid)
66
+ (Process.kill(9, pid) rescue nil) unless Flor.no?(conf['on_error_kill'])
67
+ else
68
+ process.destroy rescue nil
69
+ end
68
70
 
69
71
  raise err if err.is_a?(SpawnError)
70
72
  raise WrappedSpawnError.new(conf, { to: to, t0: t0, pid: pid }, err)
@@ -72,7 +74,6 @@ module Flor
72
74
  ensure
73
75
 
74
76
  [ i, o, f ].each { |x| x.close rescue nil }
75
-
76
77
  end
77
78
 
78
79
  module CmdParser include Raabro
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-06 00:00:00.000000000 Z
11
+ date: 2021-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: munemo
@@ -237,7 +237,7 @@ files:
237
237
  - lib/flor/punit/do_trap.rb
238
238
  - lib/flor/punit/every.rb
239
239
  - lib/flor/punit/graft.rb
240
- - lib/flor/punit/m_ram.rb
240
+ - lib/flor/punit/m_receive_and_merge.rb
241
241
  - lib/flor/punit/on_timeout.rb
242
242
  - lib/flor/punit/part.rb
243
243
  - lib/flor/punit/schedule.rb