flor 0.9.5 → 0.10.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 (91) hide show
  1. data/CHANGELOG.md +10 -0
  2. data/Makefile +13 -5
  3. data/README.md +0 -35
  4. data/flor.gemspec +1 -0
  5. data/lib/flor.rb +6 -24
  6. data/lib/flor/changes.rb +26 -0
  7. data/lib/flor/colours.rb +65 -31
  8. data/lib/flor/conf.rb +84 -54
  9. data/lib/flor/core.rb +0 -23
  10. data/lib/flor/core/executor.rb +12 -42
  11. data/lib/flor/core/node.rb +19 -24
  12. data/lib/flor/core/procedure.rb +13 -24
  13. data/lib/flor/core/texecutor.rb +10 -28
  14. data/lib/flor/deep.rb +152 -0
  15. data/lib/flor/djan.rb +200 -0
  16. data/lib/flor/dollar.rb +0 -24
  17. data/lib/flor/errors.rb +0 -24
  18. data/lib/flor/flor.rb +43 -296
  19. data/lib/flor/id.rb +90 -0
  20. data/lib/flor/log.rb +12 -35
  21. data/lib/flor/migrations/0002_cunit_and_munit.rb +86 -0
  22. data/lib/flor/parser.rb +40 -46
  23. data/lib/flor/pcore/_arr.rb +0 -24
  24. data/lib/flor/pcore/_atom.rb +0 -24
  25. data/lib/flor/pcore/_att.rb +3 -25
  26. data/lib/flor/pcore/_dump.rb +0 -24
  27. data/lib/flor/pcore/_err.rb +0 -24
  28. data/lib/flor/pcore/_happly.rb +0 -24
  29. data/lib/flor/pcore/_obj.rb +0 -24
  30. data/lib/flor/pcore/_skip.rb +0 -24
  31. data/lib/flor/pcore/arith.rb +0 -24
  32. data/lib/flor/pcore/break.rb +0 -24
  33. data/lib/flor/pcore/case.rb +127 -0
  34. data/lib/flor/pcore/cmp.rb +0 -24
  35. data/lib/flor/pcore/cond.rb +24 -24
  36. data/lib/flor/pcore/cursor.rb +0 -24
  37. data/lib/flor/pcore/define.rb +0 -24
  38. data/lib/flor/pcore/fail.rb +0 -24
  39. data/lib/flor/pcore/if.rb +39 -0
  40. data/lib/flor/pcore/loop.rb +0 -24
  41. data/lib/flor/pcore/map.rb +0 -24
  42. data/lib/flor/pcore/match.rb +0 -24
  43. data/lib/flor/pcore/move.rb +0 -24
  44. data/lib/flor/pcore/noeval.rb +0 -24
  45. data/lib/flor/pcore/noret.rb +0 -24
  46. data/lib/flor/pcore/push.rb +1 -25
  47. data/lib/flor/pcore/rand.rb +59 -0
  48. data/lib/flor/pcore/sequence.rb +0 -24
  49. data/lib/flor/pcore/set.rb +0 -24
  50. data/lib/flor/pcore/stall.rb +0 -24
  51. data/lib/flor/pcore/until.rb +0 -24
  52. data/lib/flor/pcore/val.rb +0 -24
  53. data/lib/flor/punit/cancel.rb +0 -24
  54. data/lib/flor/punit/cmap.rb +0 -24
  55. data/lib/flor/punit/concurrence.rb +54 -24
  56. data/lib/flor/punit/every.rb +0 -24
  57. data/lib/flor/punit/graft.rb +41 -0
  58. data/lib/flor/punit/on.rb +0 -24
  59. data/lib/flor/punit/schedule.rb +0 -24
  60. data/lib/flor/punit/signal.rb +0 -24
  61. data/lib/flor/punit/sleep.rb +0 -24
  62. data/lib/flor/punit/task.rb +0 -26
  63. data/lib/flor/punit/trace.rb +0 -24
  64. data/lib/flor/punit/trap.rb +0 -24
  65. data/lib/flor/to_string.rb +4 -25
  66. data/lib/flor/tools/env.rb +0 -23
  67. data/lib/flor/tools/shell.rb +810 -0
  68. data/lib/flor/unit.rb +0 -23
  69. data/lib/flor/unit/executor.rb +35 -31
  70. data/lib/flor/unit/ganger.rb +9 -34
  71. data/lib/flor/unit/hooker.rb +5 -25
  72. data/lib/flor/unit/journal.rb +0 -23
  73. data/lib/flor/unit/loader.rb +63 -94
  74. data/lib/flor/unit/logger.rb +8 -27
  75. data/lib/flor/unit/models.rb +0 -24
  76. data/lib/flor/unit/models/execution.rb +13 -24
  77. data/lib/flor/unit/models/pointer.rb +0 -24
  78. data/lib/flor/unit/models/timer.rb +0 -24
  79. data/lib/flor/unit/models/trace.rb +0 -24
  80. data/lib/flor/unit/models/trap.rb +0 -24
  81. data/lib/flor/unit/scheduler.rb +157 -128
  82. data/lib/flor/unit/storage.rb +224 -167
  83. data/lib/flor/unit/taskers.rb +38 -25
  84. data/lib/flor/unit/waiter.rb +7 -26
  85. data/lib/flor/unit/wlist.rb +8 -24
  86. metadata +28 -7
  87. data/fail.txt +0 -16
  88. data/intercepted.txt +0 -123
  89. data/lib/flor/pcore/ife.rb +0 -56
  90. data/lib/flor/tools/repl.rb +0 -231
  91. data/out.txt +0 -206
@@ -2,6 +2,16 @@
2
2
  # flor CHANGELOG.md
3
3
 
4
4
 
5
+ ## flor 0.10.0 released 2017-03-03
6
+
7
+ - Enhance shell, bring in bin/flosh (though not in gem)
8
+ - Rework "deep" tools (accept square bracket indexes)
9
+ - Implement vanilla "case"
10
+ - Implement "graft"
11
+ - Link unit name and unit identifier
12
+ - Scheduler rework, emphasis on optimistic locking for messages and timers
13
+
14
+
5
15
  ## flor 0.9.5 released 2017-02-10
6
16
 
7
17
  - Don't load exids for which there are "loaded" messages
data/Makefile CHANGED
@@ -34,16 +34,20 @@ push: build
34
34
  ## flor tasks ##
35
35
 
36
36
  RUBY=bundle exec ruby
37
+ #RUBY=bundle exec ruby --disable-did_you_mean
38
+ # gem uninstall did_you_mean
39
+
37
40
  FLOR_ENV?=dev
38
41
  TO?=nil
39
42
  FROM?=nil
40
43
 
44
+
41
45
  migrate:
42
46
  $(RUBY) -Ilib -e "require 'flor/unit'; Flor::Unit.new('envs/$(FLOR_ENV)/etc/conf.json').storage.migrate($(TO), $(FROM))"
43
47
 
44
48
  start:
45
49
  $(RUBY) -Ilib -e "require 'flor/unit'; Flor::Unit.new('envs/$(FLOR_ENV)/etc/conf.json').start.join"
46
- s: start
50
+ #s: start
47
51
 
48
52
 
49
53
  ## misc tasks ##
@@ -62,9 +66,13 @@ mk:
62
66
  doc:
63
67
  $(RUBY) -Imak -r 'doc' -e "make_procedures_doc()"
64
68
 
65
- repl:
66
- $(RUBY) -Ilib -r 'flor/tools/repl' -e 'Flor::Tools::Repl.new("$(FLOR_ENV)")'
67
- r: repl
69
+ shell:
70
+ $(RUBY) -Ilib -r 'flor/tools/shell' -e 'Flor::Tools::Shell.new'
71
+ sh: shell
72
+
73
+ cleanshell:
74
+ rm -f envs/shell/var/flor.db
75
+ rm -fR envs/shell/var/tasks/*
68
76
 
69
- .PHONY: doc repl
77
+ .PHONY: doc shell cleanshell
70
78
 
data/README.md CHANGED
@@ -25,41 +25,6 @@ Flor is a "Ruby workflow engine", if that makes any sense.
25
25
 
26
26
  see [doc/](doc/).
27
27
 
28
- ## Running the specs
29
-
30
- (Most of the time, as developer of flor, I'm writing specs, running them with `FLOR_DEBUG=dbg` and hammering the code until the specs are green. The following lines are about setting `FLOR_DEBUG` for flor development).
31
-
32
- ##### setting FLOR_DEBUG
33
-
34
- This is a targetted run of a spec file:
35
- ```
36
- FLOR_DEBUG=msg,err bundle exec rspec spec/punit/cancel_spec.rb
37
- ```
38
-
39
- * `msg` displays the flor messages in a summary, colored format
40
- * `err` displays errors with details, when and if they happen
41
- * `src` displays the source before it gets parsed and launched
42
- * `tree` displays the syntax tree as parsed from the source, right before launch
43
- * `run` shows info about each [run](doc/glossary.md#run) that just ended
44
- * `sto` displays debug information about the [storage](doc/glossary.md#storage), it's mostly SQL statements
45
-
46
- #### `FLOR_DEBUG=dbg` and `FLOR_DEBUG=all`
47
-
48
- There are two shortcuts for the flags above:
49
- ```
50
- FLOR_DEBUG=dbg bundle exec rspec spec/punit/cancel_spec.rb
51
- # is equivalent to
52
- FLOR_DEBUG=msg,err,src,tree,run bundle exec rspec spec/punit/cancel_spec.rb
53
- ```
54
- and
55
- ```
56
- FLOR_DEBUG=all bundle exec rspec spec/punit/cancel_spec.rb
57
- # is equivalent to
58
- FLOR_DEBUG=msg,err,src,tree,run,log,sto bundle exec rspec spec/punit/cancel_spec.rb
59
- ```
60
-
61
- I tend to use `FLOR_DEBUG=dbg` when developping flor.
62
-
63
28
 
64
29
  ## LICENSE
65
30
 
@@ -37,6 +37,7 @@ A Ruby workflow engine (ruote next generation)
37
37
  # so Sequel is not a runtime dependency
38
38
 
39
39
  s.add_development_dependency 'rspec', '3.4.0'
40
+ s.add_development_dependency 'terminal-table'
40
41
 
41
42
  s.require_path = 'lib'
42
43
  end
@@ -1,32 +1,10 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
1
 
25
2
  require 'pp'
26
3
  require 'json'
27
4
  require 'logger'
28
5
  require 'thread'
29
6
  require 'digest'
7
+ require 'socket'
30
8
 
31
9
  require 'munemo'
32
10
  require 'raabro'
@@ -34,17 +12,21 @@ require 'raabro'
34
12
 
35
13
  module Flor
36
14
 
37
- VERSION = '0.9.5'
15
+ VERSION = '0.10.0'
38
16
  end
39
17
 
40
18
  require 'flor/colours'
19
+ require 'flor/djan'
41
20
 
21
+ require 'flor/id'
42
22
  require 'flor/log'
43
23
  require 'flor/flor'
24
+ require 'flor/deep'
44
25
  require 'flor/dollar'
45
26
  require 'flor/errors'
46
27
  require 'flor/parser'
47
28
  require 'flor/conf'
29
+ require 'flor/changes'
48
30
  require 'flor/to_string'
49
31
 
50
32
  require 'flor/core'
@@ -0,0 +1,26 @@
1
+
2
+ module Flor::Changes
3
+ extend self
4
+
5
+ def apply(h, cs)
6
+
7
+ #return cs if cs.is_a?(Hash)
8
+
9
+ h = Flor.dup(h)
10
+ cs.each { |c| do_apply(h, c) }
11
+
12
+ h
13
+ end
14
+
15
+ protected
16
+
17
+ def do_apply(h, c)
18
+
19
+ case c['op']
20
+ when 'add' then Flor.deep_insert(h, c['path'], c['value'])
21
+ when 'replace' then Flor.deep_set(h, c['path'], c['value'])
22
+ when 'remove' then Flor.deep_unset(h, c['path'])
23
+ end
24
+ end
25
+ end
26
+
@@ -1,27 +1,3 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
-
25
1
 
26
2
  module Flor
27
3
 
@@ -41,8 +17,8 @@ module Flor
41
17
  brown yellow purple magenta dark_grey dark_gray light_grey light_gray
42
18
 
43
19
  rd red bl blue bu blue ba black bk black gn green gr green dg dark_gray
44
- gy light_gray lg light_gray yl yellow ma magenta rs reset br bright
45
- un underlined rv reverse bn blink blg bg_light_gray bri bright
20
+ gy light_gray lg light_gray yl yellow y yellow ma magenta rs reset
21
+ br bright bri bright un underlined rv reverse bn blink blg bg_light_gray
46
22
  und underlined rev reverse
47
23
  ]]
48
24
 
@@ -50,9 +26,13 @@ module Flor
50
26
 
51
27
  Flor::COLS.each do |k, v|
52
28
  if v.match(/\A\d/)
53
- class_eval("def #{k}; \"[#{v}m\"; end")
29
+ class_eval(%{
30
+ def #{k}(s=nil)
31
+ s ? "[#{v}m" + s + "": "[#{v}m"
32
+ end })
54
33
  else
55
- class_eval("alias #{k} #{v}")
34
+ class_eval(
35
+ "alias #{k} #{v}")
56
36
  end
57
37
  end
58
38
  end
@@ -61,7 +41,7 @@ module Flor
61
41
 
62
42
  Flor::COLS.each do |k, v|
63
43
  if v.match(/\A\d/)
64
- class_eval("def #{k}; ''; end")
44
+ class_eval("def #{k}(s=''); s; end")
65
45
  else
66
46
  class_eval("alias #{k} #{v}")
67
47
  end
@@ -78,8 +58,14 @@ module Flor
78
58
 
79
59
  def self.colours(opts={})
80
60
 
81
- return @colours if opts[:color] == true || opts[:colour] == true
82
- return @no_colours if opts[:color] == false || opts[:colour] == false
61
+ c = nil
62
+ #
63
+ [ :color, :colour, :colors, :colours ].each do |k|
64
+ if opts.has_key?(k); c = opts[k]; break; end
65
+ end
66
+
67
+ return @colours if c == true
68
+ return @no_colours if c == false
83
69
 
84
70
  o = opts[:out] || $stdout
85
71
 
@@ -87,5 +73,53 @@ module Flor
87
73
  @colours :
88
74
  @no_colours
89
75
  end
76
+
77
+ def self.decolour(s)
78
+ s.gsub(/\x1b\[\d+(;\d+)?m/, '')
79
+ end
80
+
81
+ def self.no_colour_length(s)
82
+
83
+ decolour(s).length
84
+ end
85
+
86
+ def self.truncate_string(s, maxlen, post='...')
87
+
88
+ ncl = no_colour_length(s)
89
+ r = StringIO.new
90
+ l = 0
91
+
92
+ s.scan(/(\x1b\[\d+(?:;\d+)?m|[^\x1b]+)/) do |ss, _|
93
+ if ss[0, 1] == ""
94
+ r << ss
95
+ else
96
+ #p({ r: r.string, l: l, ssl: ss.length, maxlen: maxlen, reml: maxlen - l })
97
+ ss = ss[0, maxlen - l]
98
+ r << ss
99
+ l += ss.length
100
+ break if l >= maxlen
101
+ end
102
+ end
103
+
104
+ return r.string if l < maxlen
105
+
106
+ if post.is_a?(String)
107
+ r << post
108
+ elsif post.is_a?(Proc)
109
+ r << post.call(ncl, maxlen, s)
110
+ end
111
+
112
+ r.string
113
+ end
114
+
115
+ class << self
116
+
117
+ alias decolor decolour
118
+
119
+ alias bw_length no_colour_length
120
+ alias nocolor_length no_colour_length
121
+ alias no_color_length no_colour_length
122
+ alias nocolour_length no_colour_length
123
+ end
90
124
  end
91
125
 
@@ -1,55 +1,100 @@
1
- #--
2
- # Copyright (c) 2015-2017, John Mettraux, jmettraux+flor@gmail.com
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining a copy
5
- # of this software and associated documentation files (the "Software"), to deal
6
- # in the Software without restriction, including without limitation the rights
7
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- # copies of the Software, and to permit persons to whom the Software is
9
- # furnished to do so, subject to the following conditions:
10
- #
11
- # The above copyright notice and this permission notice shall be included in
12
- # all copies or substantial portions of the Software.
13
- #
14
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- # THE SOFTWARE.
21
- #
22
- # Made in Japan.
23
- #++
24
-
25
1
 
26
2
  module Flor
27
3
 
28
4
  module Conf
29
5
 
30
- #
31
6
  # * uni_ unit prefix (or no prefix like for :env)
32
7
  # * sch_ scheduler prefix
33
8
  # * sto_ storage prefix
34
9
  # * exe_ executor prefix
35
10
  # * log_ logger prefix
11
+ # * loa_ loader prefix
12
+ # * gan_ ganger prefix
13
+ # * (tas_ tasker prefix)
14
+ #
36
15
  #
16
+ # * :uni_name
17
+ # The name for the unit (Scheduler+Storage) pair.
18
+ # The name must match the following regex: `/\A[a-zA-Z0-9_]+\z/`
19
+ # Can also be set via the FLOR_UNIT environment variable.
37
20
  #
38
21
  # * :sch_heart_rate
39
- # defaults to 0.3s, checks for exids to run and timers to triggers
40
- # at least every 0.3s
22
+ # Defaults to 0.3s, every 0.3s the scheduler checks its @wake_up and
23
+ # @next_time fields to determine if it has to run (no db query)
24
+ # @wake_up is set to true when there are incoming messages give to
25
+ # this unit, @next_time simply holds the timestamp for the next timer
26
+ # that has to trigger
41
27
  #
42
- # * :sch_reload_frequency
43
- # resync (reload) with db after how much time? (defaults to 60 (seconds))
28
+ # * :sch_reload_after
29
+ # reload/resync with db after how much time? (defaults to 60 (seconds))
30
+ # minimizes communication with db in idle periods
44
31
  #
45
32
  # * :sch_max_executors
46
- # how many executor thread at most? (defaults to 7, 1 is OK in certain
33
+ # How many executor thread at most? (defaults to 7, 1 is OK in certain
47
34
  # environments)
48
35
  #
49
36
  # * :exe_max_messages
50
- # how many messages will an executor run in a single session
51
- # (before quitting and passing the hand)
37
+ # How many messages will an executor run in a single session
38
+ # (before quitting and passing the hand) Defaults to 77
39
+ # An executor will not run indefinitely as long as they are messages.
40
+ # The goal is to prevent an execution from monopolizing an executor.
41
+ #
42
+ # * :sch_msg_max_res_time
43
+ # Should an executor fail, its reserved messages may stay put.
44
+ # Each time the scheduler goes to the database to trigger messages,
45
+ # it first updates messages that have been "reserved" for too long
46
+ # and sets them back as "created" so that they may be picked again.
47
+ # This values defaults to 10 * 60 seconds. After 10 minutes in the
48
+ # "reserved" state, messages are put back in the "created" state
49
+ # (by a running unit (scheduler) if any).
50
+ #
51
+ # And finally:
52
+ #
53
+ # * :flor_debug or :debug
52
54
  #
55
+ # Usually set via the FLOR_DEBUG environment variable.
56
+ # * `msg` displays the flor messages in a summary, colored format
57
+ # * `err` displays errors with details, when and if they happen
58
+ # * `src` displays the source before it gets parsed and launched
59
+ # * `tree` displays the syntax tree as parsed from the source, right
60
+ # before launch
61
+ # * `run` shows info about each [run](doc/glossary.md#run) that just ended
62
+ # * `sto` displays debug information about the
63
+ # [storage](doc/glossary.md#storage), it's mostly SQL statements
64
+ #
65
+ # * `stdout` states that the debug messages must go to STDOUT
66
+ # * `stderr` states that the debug messages must go to STDERR
67
+ #
68
+ # For example `debug: 'msg,stdout'`
69
+
70
+ def self.read(s)
71
+
72
+ h = {}
73
+ h.merge!(Flor::ConfExecutor.interpret(s))
74
+ h.merge!(interpret_flor_debug(h['flor_debug'] || h['debug']))
75
+
76
+ h
77
+ end
78
+
79
+ def self.read_env
80
+
81
+ h = {}
82
+ h.merge!(interpret_env)
83
+ h.merge!(interpret_flor_debug(ENV['FLOR_DEBUG']))
84
+
85
+ h
86
+ end
87
+
88
+ def self.get_class(conf, key)
89
+
90
+ if v = conf[key]
91
+ Kernel.const_get(v)
92
+ else
93
+ nil
94
+ end
95
+ end
96
+
97
+ protected # somehow
53
98
 
54
99
  LOG_DBG_KEYS = %w[ dbg msg err src tree tree_rw run ]
55
100
  LOG_ALL_KEYS = %w[ all log sto ] + LOG_DBG_KEYS
@@ -75,34 +120,19 @@ module Flor
75
120
  if a.include?('colours') || a.include?('colors')
76
121
  # LOG_DEBUG=colours forces colors
77
122
 
78
- if a.include?('stdout')
79
- h['log_out'] = 'stdout'
80
- elsif a.include?('stderr')
81
- h['log_out'] = 'stderr'
82
- end
123
+ h['log_out'] = 'stdout' if h.delete('stdout')
124
+ h['log_out'] = 'stderr' if h.delete('stderr')
83
125
 
84
126
  h
85
127
  end
86
128
 
87
- def self.read(s)
88
-
89
- h = Flor::ConfExecutor.interpret(s)
129
+ def self.interpret_env
90
130
 
91
- h.merge!(interpret_flor_debug(h['flor_debug']))
92
- end
131
+ h = {}
132
+ u = ENV['FLOR_UNIT']
133
+ h['unit'] = u if u
93
134
 
94
- def self.read_env
95
-
96
- interpret_flor_debug(ENV['FLOR_DEBUG'])
97
- end
98
-
99
- def self.get_class(conf, key)
100
-
101
- if v = conf[key]
102
- Kernel.const_get(v)
103
- else
104
- nil
105
- end
135
+ h
106
136
  end
107
137
  end
108
138
  end