flor 0.0.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/CHANGELOG.md +13 -0
  2. data/LICENSE.txt +1 -1
  3. data/Makefile +66 -0
  4. data/README.md +57 -0
  5. data/fail.txt +7 -0
  6. data/flor.gemspec +12 -9
  7. data/intercepted.txt +123 -0
  8. data/lib/flor/colours.rb +140 -0
  9. data/lib/flor/conf.rb +88 -0
  10. data/lib/flor/core/executor.rb +473 -0
  11. data/lib/flor/core/node.rb +397 -0
  12. data/lib/flor/core/procedure.rb +600 -0
  13. data/lib/flor/core/texecutor.rb +209 -0
  14. data/lib/flor/core.rb +93 -0
  15. data/lib/flor/dollar.rb +248 -0
  16. data/lib/flor/errors.rb +36 -0
  17. data/lib/flor/flor.rb +556 -0
  18. data/lib/flor/log.rb +336 -0
  19. data/lib/flor/migrations/0001_tables.rb +122 -0
  20. data/lib/flor/parser.rb +414 -0
  21. data/lib/flor/pcore/_arr.rb +49 -0
  22. data/lib/flor/pcore/_atom.rb +43 -0
  23. data/lib/flor/pcore/_att.rb +160 -0
  24. data/lib/flor/pcore/_dump.rb +60 -0
  25. data/lib/flor/pcore/_err.rb +30 -0
  26. data/lib/flor/pcore/_happly.rb +73 -0
  27. data/lib/flor/pcore/_obj.rb +65 -0
  28. data/lib/flor/pcore/_skip.rb +63 -0
  29. data/lib/flor/pcore/apply.rb +60 -0
  30. data/lib/flor/pcore/arith.rb +46 -0
  31. data/lib/flor/pcore/break.rb +71 -0
  32. data/lib/flor/pcore/cmp.rb +72 -0
  33. data/lib/flor/pcore/cond.rb +57 -0
  34. data/lib/flor/pcore/cursor.rb +223 -0
  35. data/lib/flor/pcore/define.rb +96 -0
  36. data/lib/flor/pcore/fail.rb +45 -0
  37. data/lib/flor/pcore/ife.rb +56 -0
  38. data/lib/flor/pcore/loop.rb +53 -0
  39. data/lib/flor/pcore/map.rb +75 -0
  40. data/lib/flor/pcore/match.rb +70 -0
  41. data/lib/flor/pcore/move.rb +65 -0
  42. data/lib/flor/pcore/noeval.rb +46 -0
  43. data/lib/flor/pcore/noret.rb +47 -0
  44. data/lib/flor/pcore/push.rb +69 -0
  45. data/lib/flor/pcore/sequence.rb +39 -0
  46. data/lib/flor/pcore/set.rb +76 -0
  47. data/lib/flor/pcore/stall.rb +35 -0
  48. data/lib/flor/pcore/until.rb +122 -0
  49. data/lib/flor/pcore/val.rb +40 -0
  50. data/lib/flor/punit/cancel.rb +69 -0
  51. data/lib/flor/punit/cmap.rb +76 -0
  52. data/lib/flor/punit/concurrence.rb +149 -0
  53. data/lib/flor/punit/every.rb +46 -0
  54. data/lib/flor/punit/on.rb +81 -0
  55. data/lib/flor/punit/schedule.rb +68 -0
  56. data/lib/flor/punit/signal.rb +47 -0
  57. data/lib/flor/punit/sleep.rb +53 -0
  58. data/lib/flor/punit/task.rb +109 -0
  59. data/lib/flor/punit/trace.rb +51 -0
  60. data/lib/flor/punit/trap.rb +100 -0
  61. data/lib/flor/to_string.rb +81 -0
  62. data/lib/flor/tools/env.rb +103 -0
  63. data/lib/flor/tools/repl.rb +231 -0
  64. data/lib/flor/unit/executor.rb +260 -0
  65. data/lib/flor/unit/hooker.rb +186 -0
  66. data/lib/flor/unit/journal.rb +52 -0
  67. data/lib/flor/unit/loader.rb +181 -0
  68. data/lib/flor/unit/logger.rb +181 -0
  69. data/lib/flor/unit/models/execution.rb +105 -0
  70. data/lib/flor/unit/models/pointer.rb +31 -0
  71. data/lib/flor/unit/models/timer.rb +52 -0
  72. data/lib/flor/unit/models/trace.rb +31 -0
  73. data/lib/flor/unit/models/trap.rb +130 -0
  74. data/lib/flor/unit/models.rb +106 -0
  75. data/lib/flor/unit/scheduler.rb +419 -0
  76. data/lib/flor/unit/storage.rb +633 -0
  77. data/lib/flor/unit/tasker.rb +191 -0
  78. data/lib/flor/unit/waiter.rb +146 -0
  79. data/lib/flor/unit/wlist.rb +77 -0
  80. data/lib/flor/unit.rb +50 -0
  81. data/lib/flor.rb +40 -3
  82. metadata +152 -22
  83. checksums.yaml +0 -7
  84. data/Rakefile +0 -52
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+
2
+ # flor CHANGELOG.md
3
+
4
+
5
+ ## flor 0.9.0 released 2017-01-30
6
+
7
+ - initial release
8
+
9
+
10
+ ## flor 0.0.1 released 2015-11-04
11
+
12
+ - initial, empty, release (Juan's verandah)
13
+
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- Copyright (c) 2015-2015, John Mettraux, jmettraux+flon@gmail.com
2
+ Copyright (c) 2015-2017, 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/Makefile ADDED
@@ -0,0 +1,66 @@
1
+
2
+ ## gem tasks ##
3
+
4
+ NAME = \
5
+ $(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.name")
6
+ VERSION = \
7
+ $(shell ruby -e "s = eval(File.read(Dir['*.gemspec'][0])); puts s.version")
8
+
9
+ count_lines:
10
+ find lib -name "*.rb" | xargs cat | ruby -e "p STDIN.readlines.count { |l| l = l.strip; l[0, 1] != '#' && l != '' }"
11
+ cl: count_lines
12
+
13
+ gemspec_validate:
14
+ @echo "---"
15
+ ruby -e "s = eval(File.read(Dir['*.gemspec'].first)); s.validate"
16
+ @echo "---"
17
+
18
+ name: gemspec_validate
19
+ @echo "$(NAME) $(VERSION)"
20
+
21
+ build: gemspec_validate
22
+ gem build $(NAME).gemspec
23
+ mkdir -p pkg
24
+ mv $(NAME)-$(VERSION).gem pkg/
25
+
26
+ push: build
27
+ gem push pkg/$(NAME)-$(VERSION).gem
28
+
29
+
30
+ ## flor tasks ##
31
+
32
+ RUBY=bundle exec ruby
33
+ FLOR_ENV?=dev
34
+ TO?=nil
35
+ FROM?=nil
36
+
37
+ migrate:
38
+ $(RUBY) -Ilib -e "require 'flor/unit'; Flor::Unit.new('envs/$(FLOR_ENV)/etc/conf.json').storage.migrate($(TO), $(FROM))"
39
+
40
+ start:
41
+ $(RUBY) -Ilib -e "require 'flor/unit'; Flor::Unit.new('envs/$(FLOR_ENV)/etc/conf.json').start.join"
42
+ s: start
43
+
44
+
45
+ ## misc tasks ##
46
+
47
+ backup_notes_and_todos:
48
+ tar czvf flor_notes_$(shell date "+%Y%m%d_%H%M").tgz .notes.md .todo.md && mv flor_notes_*.tgz ~/Dropbox/backup/
49
+ ba: backup_notes_and_todos
50
+
51
+ t:
52
+ tree spec/unit/loader
53
+
54
+ mk:
55
+ # testing lib/flor/tools/env.rb
56
+ $(RUBY) -Ilib -e "require 'flor/tools/env'; Flor::Tools::Env.make('tmp', '$(FLOR_ENV)', gitkeep: true)"
57
+
58
+ doc:
59
+ $(RUBY) -Imak -r 'doc' -e "make_procedures_doc()"
60
+
61
+ repl:
62
+ $(RUBY) -Ilib -r 'flor/tools/repl' -e 'Flor::Tools::Repl.new("$(FLOR_ENV)")'
63
+ r: repl
64
+
65
+ .PHONY: doc repl
66
+
data/README.md CHANGED
@@ -1,6 +1,63 @@
1
1
 
2
2
  # flor
3
3
 
4
+ [![Build Status](https://secure.travis-ci.org/floraison/flor.svg)](http://travis-ci.org/floraison/flor)
5
+ [![Gem Version](https://badge.fury.io/rb/flor.svg)](http://badge.fury.io/rb/flor)
6
+
7
+ Flor is a "Ruby workflow engine", if that makes any sense.
8
+
9
+ ## Design
10
+
11
+ * Strives to propose a scheming interpreter for long running executions
12
+ * Is written in Ruby a rather straightforward language with at least two
13
+ wonderful implementations (MRI and JRuby, which is enterprise-friendly)
14
+ * Stores everything as JSON (if it breaks it's still readable)
15
+ * Stores in any database supported by [Sequel](http://sequel.jeremyevans.net/)
16
+ (the JSON goes in the "content" columns, along with some index columns)
17
+ * Favours naive/simple implementations over smart ones
18
+ * All in all should be easy to maintain (engine itself and executions running
19
+ on top of it)
20
+
21
+ ## Documentation
22
+
23
+ see [doc/](tree/master/doc).
24
+
25
+ ## Running the specs
26
+
27
+ (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).
28
+
29
+ ##### setting FLOR_DEBUG
30
+
31
+ This is a targetted run of a spec file:
32
+ ```
33
+ FLOR_DEBUG=msg,err bundle exec rspec spec/punit/cancel_spec.rb
34
+ ```
35
+
36
+ * `msg` displays the flor messages in a summary, colored format
37
+ * `err` displays errors with details, when and if they happen
38
+ * `src` displays the source before it gets parsed and launched
39
+ * `tree` displays the syntax tree as parsed from the source, right before launch
40
+ * `run` shows info about each [run](doc/glossary.md#run) that just ended
41
+ * `sto` displays debug information about the [storage](doc/glossary.md#storage), it's mostly SQL statements
42
+
43
+ #### `FLOR_DEBUG=dbg` and `FLOR_DEBUG=all`
44
+
45
+ There are two shortcuts for the flags above:
46
+ ```
47
+ FLOR_DEBUG=dbg bundle exec rspec spec/punit/cancel_spec.rb
48
+ # is equivalent to
49
+ FLOR_DEBUG=msg,err,src,tree,run bundle exec rspec spec/punit/cancel_spec.rb
50
+ ```
51
+ and
52
+ ```
53
+ FLOR_DEBUG=all bundle exec rspec spec/punit/cancel_spec.rb
54
+ # is equivalent to
55
+ FLOR_DEBUG=msg,err,src,tree,run,log,sto bundle exec rspec spec/punit/cancel_spec.rb
56
+ ```
57
+
58
+ I tend to use `FLOR_DEBUG=dbg` when developping flor.
59
+
60
+
4
61
  ## LICENSE
5
62
 
6
63
  MIT, see [LICENSE.txt](LICENSE.txt)
data/fail.txt ADDED
@@ -0,0 +1,7 @@
1
+
2
+ rspec ./spec/pcore/cursor_spec.rb:184 # Flor pcore cursor re-break/continue accepts "break" when breaking
3
+ rspec ./spec/pcore/cursor_spec.rb:230 # Flor pcore cursor re-break/continue accepts "break" when continuing
4
+ rspec ./spec/pcore/cursor_spec.rb:282 # Flor pcore cursor re-break/continue accepts "break" when continuing (nest-1)
5
+ rspec ./spec/pcore/cursor_spec.rb:327 # Flor pcore cursor re-break/continue rejects "continue" when breaking
6
+ rspec ./spec/pcore/cursor_spec.rb:371 # Flor pcore cursor re-break/continue rejects "move" when breaking
7
+
data/flor.gemspec CHANGED
@@ -9,27 +9,30 @@ Gem::Specification.new do |s|
9
9
 
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = [ 'John Mettraux' ]
12
- s.email = [ 'jmettraux@gmail.com' ]
13
- s.homepage = 'http://github.com/flon-io/flor'
12
+ s.email = [ 'jmettraux+flor@gmail.com' ]
13
+ s.homepage = 'http://github.com/floraison'
14
14
  #s.rubyforge_project = 'flor'
15
15
  s.license = 'MIT'
16
- s.summary = 'the flon programs, in Ruby'
16
+ s.summary = 'A Ruby workflow engine'
17
17
 
18
18
  s.description = %{
19
- the flon programs, in Ruby
19
+ A Ruby workflow engine (ruote next generation)
20
20
  }.strip
21
21
 
22
22
  #s.files = `git ls-files`.split("\n")
23
23
  s.files = Dir[
24
- 'Rakefile',
25
- 'lib/**/*.rb', 'spec/**/*.rb', 'test/**/*.rb',
24
+ 'Makefile',
25
+ 'lib/**/*.rb', #'spec/**/*.rb', 'test/**/*.rb',
26
26
  '*.gemspec', '*.txt', '*.rdoc', '*.md'
27
27
  ]
28
28
 
29
- #s.add_runtime_dependency 'tzinfo'
29
+ s.add_runtime_dependency 'munemo', '>= 1.0.1'
30
+ s.add_runtime_dependency 'raabro', '>= 1.1.3'
31
+ #s.add_runtime_dependency 'rufus-lru', '>= 1.1.0'
32
+ s.add_runtime_dependency 'fugit', '>= 0.9.5'
30
33
 
31
- s.add_development_dependency 'rake'
32
- s.add_development_dependency 'rspec', '>= 2.13.0'
34
+ s.add_development_dependency 'rspec', '3.4.0'
35
+ s.add_development_dependency 'sequel', '~> 4'
33
36
 
34
37
  s.require_path = 'lib'
35
38
  end
data/intercepted.txt ADDED
@@ -0,0 +1,123 @@
1
+ ================================================================================
2
+ "java.lang.ArrayIndexOutOfBoundsException: 7"
3
+ org.jruby.RubyArray.collect(RubyArray.java:2399)
4
+ org.jruby.RubyArray.collect19(RubyArray.java:2407)
5
+ org.jruby.RubyArray$INVOKER$i$0$0$collect19.call(RubyArray$INVOKER$i$0$0$collect19.gen)
6
+
7
+ rubyjit.RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399.chained_4_rescue_2$RUBY$SYNTHETIC__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb:236)
8
+ rubyjit.RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399.chained_3_ensure_3$RUBY$__ensure__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb)
9
+ rubyjit.RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399.block_0$RUBY$__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb:234)
10
+ rubyjit$RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399$block_0$RUBY$__file__.call(rubyjit$RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399$block_0$RUBY$__file__)
11
+ org.jruby.runtime.CompiledBlock19.yieldSpecificInternal(CompiledBlock19.java:117)
12
+
13
+
14
+ rubyjit.RSpec::Core::Example$$with_around_and_singleton_context_hooks_3b50427a6d5505735484cd86431f6a767c1d18f4548153399.block_0$RUBY$__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb:478)
15
+ rubyjit$RSpec::Core::Example$$with_around_and_singleton_context_hooks_3b50427a6d5505735484cd86431f6a767c1d18f4548153399$block_0$RUBY$__file__.call(rubyjit$RSpec::Core::Example$$with_around_and_singleton_context_hooks_3b50427a6d5505735484cd86431f6a767c1d18f4548153399$block_0$RUBY$__file__)
16
+
17
+
18
+
19
+ rubyjit.RSpec::Core::Example$$with_around_example_hooks_f42ef83f37556525813c37189c97bfafa418095d548153399.block_0$RUBY$__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb:435)
20
+ rubyjit$RSpec::Core::Example$$with_around_example_hooks_f42ef83f37556525813c37189c97bfafa418095d548153399$block_0$RUBY$__file__.call(rubyjit$RSpec::Core::Example$$with_around_example_hooks_f42ef83f37556525813c37189c97bfafa418095d548153399$block_0$RUBY$__file__)
21
+
22
+
23
+
24
+ rubyjit.RSpec::Core::Hooks::HookCollections$$run_5d8d48da1a9e19fa57aca42145bb7983771aa82e548153399.block_0$RUBY$__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/hooks.rb:478)
25
+ rubyjit$RSpec::Core::Hooks::HookCollections$$run_5d8d48da1a9e19fa57aca42145bb7983771aa82e548153399$block_0$RUBY$__file__.call(rubyjit$RSpec::Core::Hooks::HookCollections$$run_5d8d48da1a9e19fa57aca42145bb7983771aa82e548153399$block_0$RUBY$__file__)
26
+
27
+
28
+
29
+ rubyjit.RSpec::Core::Hooks::HookCollections$$run_around_example_hooks_for_46882d65b8cfc96e5a66894bebd6d613fe20048a548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/hooks.rb:616)
30
+ rubyjit.RSpec::Core::Hooks::HookCollections$$run_around_example_hooks_for_46882d65b8cfc96e5a66894bebd6d613fe20048a548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/hooks.rb)
31
+
32
+
33
+
34
+ rubyjit.RSpec::Core::Hooks::HookCollections$$run_5d8d48da1a9e19fa57aca42145bb7983771aa82e548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/hooks.rb:478)
35
+ rubyjit.RSpec::Core::Hooks::HookCollections$$run_5d8d48da1a9e19fa57aca42145bb7983771aa82e548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/hooks.rb)
36
+
37
+
38
+
39
+ rubyjit.RSpec::Core::Example$$with_around_example_hooks_f42ef83f37556525813c37189c97bfafa418095d548153399.chained_0_rescue_1$RUBY$SYNTHETIC__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb:435)
40
+ rubyjit.RSpec::Core::Example$$with_around_example_hooks_f42ef83f37556525813c37189c97bfafa418095d548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb)
41
+ rubyjit.RSpec::Core::Example$$with_around_example_hooks_f42ef83f37556525813c37189c97bfafa418095d548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb)
42
+
43
+
44
+
45
+ rubyjit.RSpec::Core::Example$$with_around_and_singleton_context_hooks_3b50427a6d5505735484cd86431f6a767c1d18f4548153399.chained_0_ensure_1$RUBY$__ensure__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb:478)
46
+ rubyjit.RSpec::Core::Example$$with_around_and_singleton_context_hooks_3b50427a6d5505735484cd86431f6a767c1d18f4548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb)
47
+ rubyjit.RSpec::Core::Example$$with_around_and_singleton_context_hooks_3b50427a6d5505735484cd86431f6a767c1d18f4548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb)
48
+
49
+
50
+
51
+ rubyjit.RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399.chained_2_rescue_1$RUBY$SYNTHETIC__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb:233)
52
+ rubyjit.RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399.chained_1_ensure_2$RUBY$__ensure__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb)
53
+ rubyjit.RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399.chained_0_ensure_1$RUBY$__ensure__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb:229)
54
+ rubyjit.RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb)
55
+ rubyjit.RSpec::Core::Example$$run_e23a0386b8914aee0fb2ff25382f02e76d718a30548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example.rb)
56
+
57
+
58
+ rubyjit.RSpec::Core::ExampleGroup$$run_examples_d1ecff0be8f52462c9431f9e5a26b42be542fee3548153399.block_0$RUBY$__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb:581)
59
+ rubyjit$RSpec::Core::ExampleGroup$$run_examples_d1ecff0be8f52462c9431f9e5a26b42be542fee3548153399$block_0$RUBY$__file__.call(rubyjit$RSpec::Core::ExampleGroup$$run_examples_d1ecff0be8f52462c9431f9e5a26b42be542fee3548153399$block_0$RUBY$__file__)
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+ rubyjit.RSpec::Core::ExampleGroup$$run_examples_d1ecff0be8f52462c9431f9e5a26b42be542fee3548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb:577)
68
+ rubyjit.RSpec::Core::ExampleGroup$$run_examples_d1ecff0be8f52462c9431f9e5a26b42be542fee3548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb)
69
+
70
+
71
+
72
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.chained_1_rescue_1$RUBY$SYNTHETIC__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb:543)
73
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.chained_0_ensure_1$RUBY$__ensure__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb)
74
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb:541)
75
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb)
76
+
77
+
78
+
79
+
80
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.block_0$RUBY$__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb:544)
81
+ rubyjit$RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399$block_0$RUBY$__file__.call(rubyjit$RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399$block_0$RUBY$__file__)
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.chained_1_rescue_1$RUBY$SYNTHETIC__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb:544)
90
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.chained_0_ensure_1$RUBY$__ensure__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb)
91
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb:541)
92
+ rubyjit.RSpec::Core::ExampleGroup$$run_a3bf101cd7bf6e139f3a52a1db889d129cb68613548153399.__file__(/home/travis/build/floraison/flor/vendor/bundle/jruby/1.9/gems/rspec-core-3.4.2/lib/rspec/core/example_group.rb)
93
+
94
+ --------------------------------------------------------------------------------
95
+ Failures:
96
+
97
+ 2) Flor unit Flor::Scheduler#hook may filter on point:/p:
98
+ Failure/Error: fail "**INTERCEPTED**"
99
+
100
+ RuntimeError:
101
+ **INTERCEPTED**
102
+ # ./spec/unit/hooks_spec.rb:117:in `(root)'
103
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:1:in `(root)'
104
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load'
105
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run'
106
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec'
107
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
108
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
109
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
110
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch'
111
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
112
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start'
113
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/exe/bundle:34:in `(root)'
114
+ # /home/travis/.rvm/gems/jruby-d20@global/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
115
+
116
+ Finished in 1 minute 49.84 seconds (files took 1.05 seconds to load)
117
+ 460 examples, 2 failures, 2 pending
118
+
119
+ Failed examples:
120
+
121
+ rspec ./spec/punit/schedule_spec.rb:64 # Flor punit schedule cron triggers repeatedly
122
+ rspec ./spec/unit/hooks_spec.rb:95 # Flor unit Flor::Scheduler#hook may filter on point:/p:
123
+
@@ -0,0 +1,140 @@
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
+
26
+ module Flor
27
+
28
+ class Colours
29
+
30
+ def reset; ""; end
31
+
32
+ def bright; ""; end
33
+ def dim; ""; end
34
+ def underlined; ""; end
35
+ def blink; ""; end
36
+ def reverse; ""; end
37
+ def hidden; ""; end
38
+
39
+ def default; ""; end
40
+ def black; ""; end
41
+ def red; ""; end
42
+ def green; ""; end
43
+ def yellow; ""; end
44
+ def blue; ""; end
45
+ def magenta; ""; end
46
+ def cyan; ""; end
47
+ def light_gray; ""; end
48
+
49
+ def dark_gray; ""; end
50
+ def light_red; ""; end
51
+ def light_green; ""; end
52
+ def light_yellow; ""; end
53
+ def light_blue; ""; end
54
+ def light_magenta; ""; end
55
+ def light_cyan; ""; end
56
+ def white; ""; end
57
+
58
+ def bg_default; ""; end
59
+ def bg_black; ""; end
60
+ def bg_red; ""; end
61
+ def bg_green; ""; end
62
+ def bg_yellow; ""; end
63
+ def bg_blue; ""; end
64
+ def bg_magenta; ""; end
65
+ def bg_cyan; ""; end
66
+ def bg_light_gray; ""; end
67
+
68
+ def bg_dark_gray; ""; end
69
+ def bg_light_red; ""; end
70
+ def bg_light_green; ""; end
71
+ def bg_light_yellow; ""; end
72
+ def bg_light_blue; ""; end
73
+ def bg_light_magenta; ""; end
74
+ def bg_light_cyan; ""; end
75
+ def bg_white; ""; end
76
+
77
+ alias brown yellow
78
+ alias purple magenta
79
+ alias dark_grey dark_gray
80
+ alias light_grey light_gray
81
+
82
+ alias rd red
83
+ alias bl blue
84
+ alias bu blue
85
+ alias ba black
86
+ alias bk black
87
+ alias gn green
88
+ alias gr green
89
+ alias dg dark_gray
90
+ alias gy light_gray
91
+ alias lg light_gray
92
+ alias yl yellow
93
+ alias ma magenta
94
+
95
+ alias rs reset
96
+ alias br bright
97
+ alias un underlined
98
+ alias rv reverse
99
+ alias bn blink
100
+
101
+ alias blg bg_light_gray
102
+ alias bri bright
103
+ alias und underlined
104
+ alias rev reverse
105
+ end
106
+
107
+ class NoColours < Colours
108
+
109
+ %w[
110
+ reset
111
+ bright dim underlined blink reverse hidden
112
+ default black red green yellow blue magenta cyan light_gray
113
+ dark_gray light_red light_green light_yellow light_blue light_magenta
114
+ light_cyan white
115
+ bg_default bg_black bg_red bg_green bg_yellow bg_blue bg_magenta bg_cyan
116
+ bg_light_gray
117
+ bg_dark_gray bg_light_red bg_light_green bg_light_yellow bg_light_blue
118
+ bg_light_magenta bg_light_cyan bg_white
119
+ ].each { |m| define_method(m) { '' } }
120
+ end
121
+
122
+ @colours = Colours.new
123
+ @no_colours = NoColours.new
124
+
125
+ def self.no_colours
126
+
127
+ @no_colours
128
+ end
129
+
130
+ def self.colours(opts={})
131
+
132
+ return @no_colours unless $stdout.tty?
133
+
134
+ opts[:colour] = true unless opts.has_key?(:color) || opts.has_key?(:colour)
135
+
136
+ return @colours if opts[:color] || opts[:colour]
137
+ @no_colours
138
+ end
139
+ end
140
+
data/lib/flor/conf.rb ADDED
@@ -0,0 +1,88 @@
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
+
26
+ module Flor
27
+
28
+ module Conf
29
+
30
+ #
31
+ # * uni_ unit prefix (or no prefix like for :env)
32
+ # * sch_ scheduler prefix
33
+ # * sto_ storage prefix
34
+ # * exe_ executor prefix
35
+ # * log_ logger prefix
36
+ #
37
+ #
38
+ # * :sch_heart_rate
39
+ # defaults to 0.3s, checks for exids to run and timers to triggers
40
+ # at least every 0.3s
41
+ #
42
+ # * :sch_reload_frequency
43
+ # resync (reload) with db after how much time? (defaults to 60 (seconds))
44
+ #
45
+ # * :sch_max_executors
46
+ # how many executor thread at most? (defaults to 7, 1 is OK in certain
47
+ # environments)
48
+ #
49
+ # * :exe_max_messages
50
+ # how many messages will an executor run in a single session
51
+ # (before quitting and passing the hand)
52
+ #
53
+
54
+ def self.read(s)
55
+
56
+ Flor::ConfExecutor.interpret(s)
57
+ end
58
+
59
+ LOG_DBG_KEYS = %w[ dbg msg err src tree tree_rw run ]
60
+ LOG_ALL_KEYS = %w[ all log sto ] + LOG_DBG_KEYS
61
+
62
+ def self.read_env
63
+
64
+ h =
65
+ (ENV['FLOR_DEBUG'] || '').split(',').inject({}) { |h, kv|
66
+ k, v = kv.split(':')
67
+ k = 'sto' if k == 'db'
68
+ k = "log_#{k}" if LOG_ALL_KEYS.include?(k)
69
+ h[k] = v ? JSON.parse(v) : true
70
+ h
71
+ }
72
+ LOG_ALL_KEYS.each { |k| h["log_#{k}"] = 1 } if h['log_all']
73
+ LOG_DBG_KEYS.each { |k| h["log_#{k}"] = 1 } if h['log_dbg']
74
+
75
+ h
76
+ end
77
+
78
+ def self.get_class(conf, key)
79
+
80
+ if v = conf[key]
81
+ Kernel.const_get(v)
82
+ else
83
+ nil
84
+ end
85
+ end
86
+ end
87
+ end
88
+