legionio 0.3.1 → 0.4.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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +27 -10
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +7 -2
  5. data/CHANGELOG.md +21 -0
  6. data/Dockerfile +9 -0
  7. data/Gemfile +0 -11
  8. data/README.md +158 -42
  9. data/Rakefile +0 -6
  10. data/bitbucket-pipelines.yml +17 -52
  11. data/docker_deploy.rb +8 -0
  12. data/exe/legion +3 -49
  13. data/{bin/legion → exe/legionio} +5 -42
  14. data/exe/lex_gen +5 -0
  15. data/{legion.gemspec → legionio.gemspec} +25 -20
  16. data/lib/legion.rb +4 -0
  17. data/lib/legion/cli.rb +56 -0
  18. data/lib/legion/cli/chain.rb +35 -0
  19. data/lib/legion/cli/cohort.rb +10 -0
  20. data/lib/legion/cli/function.rb +41 -0
  21. data/lib/legion/cli/lex/actor.rb +31 -0
  22. data/lib/legion/cli/lex/exchange.rb +32 -0
  23. data/lib/legion/cli/lex/message.rb +32 -0
  24. data/lib/legion/cli/lex/queue.rb +45 -0
  25. data/lib/legion/cli/lex/runner.rb +70 -0
  26. data/lib/legion/cli/lex/templates/actor.erb +6 -0
  27. data/lib/legion/cli/lex/templates/actor_spec.erb +0 -0
  28. data/lib/legion/cli/lex/templates/base/bitbucket.yml.erb +69 -0
  29. data/lib/legion/cli/lex/templates/base/gemfile.erb +3 -0
  30. data/lib/legion/cli/lex/templates/base/gemspec.erb +26 -0
  31. data/lib/legion/cli/lex/templates/base/gitignore.erb +11 -0
  32. data/lib/legion/cli/lex/templates/base/lex.erb +9 -0
  33. data/lib/legion/cli/lex/templates/base/lex_spec.erb +5 -0
  34. data/lib/legion/cli/lex/templates/base/lic.erb +21 -0
  35. data/lib/legion/cli/lex/templates/base/rakefile.erb +6 -0
  36. data/lib/legion/cli/lex/templates/base/readme.md.erb +2 -0
  37. data/lib/legion/cli/lex/templates/base/rubocop.yml.erb +15 -0
  38. data/lib/legion/cli/lex/templates/base/spec_helper.rb.erb +11 -0
  39. data/lib/legion/cli/lex/templates/base/version.erb +7 -0
  40. data/lib/legion/cli/lex/templates/exchange.erb +11 -0
  41. data/lib/legion/cli/lex/templates/exchange_spec.erb +0 -0
  42. data/lib/legion/cli/lex/templates/message.erb +23 -0
  43. data/lib/legion/cli/lex/templates/message_spec.erb +0 -0
  44. data/lib/legion/cli/lex/templates/queue.erb +12 -0
  45. data/lib/legion/cli/lex/templates/queue_helper.erb +24 -0
  46. data/lib/legion/cli/lex/templates/queue_spec.erb +11 -0
  47. data/lib/legion/cli/lex/templates/runner.erb +11 -0
  48. data/lib/legion/cli/lex/templates/runner_spec.erb +11 -0
  49. data/lib/legion/cli/relationship.rb +22 -0
  50. data/lib/legion/cli/task.rb +49 -0
  51. data/lib/legion/cli/trigger.rb +88 -0
  52. data/lib/legion/cli/version.rb +5 -0
  53. data/lib/legion/extensions.rb +57 -62
  54. data/lib/legion/extensions/actors/base.rb +0 -2
  55. data/lib/legion/extensions/actors/poll.rb +0 -1
  56. data/lib/legion/extensions/actors/subscription.rb +1 -0
  57. data/lib/legion/extensions/builders/runners.rb +5 -0
  58. data/lib/legion/extensions/core.rb +9 -4
  59. data/lib/legion/extensions/helpers/base.rb +3 -3
  60. data/lib/legion/extensions/helpers/lex.rb +29 -1
  61. data/lib/legion/extensions/helpers/logger.rb +3 -6
  62. data/lib/legion/extensions/helpers/task.rb +1 -1
  63. data/lib/legion/extensions/transport.rb +9 -7
  64. data/lib/legion/lex.rb +89 -0
  65. data/lib/legion/service.rb +55 -4
  66. data/lib/legion/version.rb +1 -1
  67. metadata +196 -51
  68. data/bin/console +0 -16
  69. data/bin/setup +0 -8
  70. data/bin/test +0 -32
  71. data/lib/legion/exceptions/handled_task.rb +0 -6
  72. data/lib/legion/exceptions/invalidjson.rb +0 -5
  73. data/lib/legion/exceptions/missingargument.rb +0 -6
  74. data/lib/legion/exceptions/wrongtype.rb +0 -10
  75. data/lib/legion/exceptions/wrongtypes/array.rb +0 -8
  76. data/lib/legion/exceptions/wrongtypes/hash.rb +0 -8
  77. data/lib/legion/exceptions/wrongtypes/integer.rb +0 -8
  78. data/lib/legion/exceptions/wrongtypes/string.rb +0 -8
  79. data/settings/client.json +0 -25
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'legion'
6
- Legion::Service.new
7
-
8
- # You can add fixtures and/or initialization code here to make experimenting
9
- # with your gem easier. You can also use a different console, if you like.
10
-
11
- # (If you use this, don't forget to add pry to your Gemfile!)
12
- require 'pry'
13
- Pry.start
14
-
15
- require 'irb'
16
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/bin/test DELETED
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
- # rubocop:disable all
4
- require 'cli-tree'
5
- # require File.expand_path('lib/legion.rb')
6
- # Legion.setup
7
- require 'legion/json'
8
- require 'legion/logging'
9
- require 'legion/settings'
10
- require 'legion/data'
11
- Legion::Logging.setup(level: 'debug')
12
- Legion::Settings.load
13
- Legion::Settings.merge_settings('data', Legion::Data::Settings.default)
14
- Legion::Data.setup
15
- extensions = {name: 'extensions', children: []}
16
- Legion::Data::Model::Extension.each do | extension|
17
- runners = []
18
- extension.runners.each do |runner|
19
- functions = []
20
- runner.functions.each do |function|
21
- functions.push function.values[:name]
22
- end
23
- # runners.push runner.values[:name]
24
- runners.push({name: runner.values[:name], children: functions})
25
- end
26
- child = {name: extension.values[:name], children: runners}
27
- # extensions[:children].push extension.values[:name]
28
- extensions[:children].push child
29
- end
30
-
31
- tree = TreeNode.from_h(extensions)
32
- tree.print
@@ -1,6 +0,0 @@
1
- module Legion
2
- module Exception
3
- class HandledTask < StandardError
4
- end
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- module Legion
2
- module Exception
3
- class InvalidJson < StandardError; end
4
- end
5
- end
@@ -1,6 +0,0 @@
1
- module Legion
2
- module Exception
3
- class MissingArgument < StandardError
4
- end
5
- end
6
- end
@@ -1,10 +0,0 @@
1
- require_relative 'wrongtypes/array'
2
- require_relative 'wrongtypes/hash'
3
- require_relative 'wrongtypes/integer'
4
- require_relative 'wrongtypes/string'
5
-
6
- module Legion
7
- module Exception
8
- class WrongType < StandardError; end
9
- end
10
- end
@@ -1,8 +0,0 @@
1
- module Legion
2
- module Exception
3
- module WrongType
4
- class Array < TypeError
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Legion
2
- module Exception
3
- module WrongType
4
- class Hash < TypeError
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Legion
2
- module Exception
3
- module WrongType
4
- class Integer < TypeError
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Legion
2
- module Exception
3
- module WrongType
4
- class String < TypeError
5
- end
6
- end
7
- end
8
- end
@@ -1,25 +0,0 @@
1
- {
2
- "client": {
3
- "keepalive": {
4
- "thresholds": {
5
- "warning": 10
6
- }
7
- }
8
- },
9
- "data": {
10
- "connection": {
11
- "max_connections": 100,
12
- "preconnect": false
13
- }
14
- },
15
- "crypt": {
16
- "cluster_secret": "fkljwelkfjwelkfjwelkjfwe",
17
- "vault": {
18
- "read_cluster_secret": false,
19
- "connected": false,
20
- "renewer": false,
21
- "token": "s.660l1zqqjezPhPLo71tY7dsz",
22
- "protocol": "http"
23
- }
24
- }
25
- }