legionio 0.3.2 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) 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/README.md +157 -45
  8. data/Rakefile +0 -6
  9. data/bitbucket-pipelines.yml +16 -52
  10. data/docker_deploy.rb +10 -0
  11. data/exe/legion +3 -51
  12. data/exe/legionio +53 -0
  13. data/exe/lex_gen +5 -0
  14. data/{legion.gemspec → legionio.gemspec} +25 -20
  15. data/lib/legion.rb +4 -0
  16. data/lib/legion/cli.rb +56 -0
  17. data/lib/legion/cli/chain.rb +35 -0
  18. data/lib/legion/cli/cohort.rb +10 -0
  19. data/lib/legion/cli/function.rb +41 -0
  20. data/lib/legion/cli/lex/actor.rb +31 -0
  21. data/lib/legion/cli/lex/exchange.rb +32 -0
  22. data/lib/legion/cli/lex/message.rb +32 -0
  23. data/lib/legion/cli/lex/queue.rb +45 -0
  24. data/lib/legion/cli/lex/runner.rb +70 -0
  25. data/lib/legion/cli/lex/templates/actor.erb +6 -0
  26. data/{docs/_build/html/_sources/overview.rst.txt → lib/legion/cli/lex/templates/actor_spec.erb} +0 -0
  27. data/lib/legion/cli/lex/templates/base/bitbucket.yml.erb +69 -0
  28. data/lib/legion/cli/lex/templates/base/gemfile.erb +3 -0
  29. data/lib/legion/cli/lex/templates/base/gemspec.erb +26 -0
  30. data/lib/legion/cli/lex/templates/base/gitignore.erb +11 -0
  31. data/lib/legion/cli/lex/templates/base/lex.erb +9 -0
  32. data/lib/legion/cli/lex/templates/base/lex_spec.erb +5 -0
  33. data/lib/legion/cli/lex/templates/base/lic.erb +21 -0
  34. data/lib/legion/cli/lex/templates/base/rakefile.erb +6 -0
  35. data/lib/legion/cli/lex/templates/base/readme.md.erb +2 -0
  36. data/lib/legion/cli/lex/templates/base/rubocop.yml.erb +15 -0
  37. data/lib/legion/cli/lex/templates/base/spec_helper.rb.erb +11 -0
  38. data/lib/legion/cli/lex/templates/base/version.erb +7 -0
  39. data/lib/legion/cli/lex/templates/exchange.erb +11 -0
  40. data/lib/legion/cli/lex/templates/exchange_spec.erb +0 -0
  41. data/lib/legion/cli/lex/templates/message.erb +23 -0
  42. data/lib/legion/cli/lex/templates/message_spec.erb +0 -0
  43. data/lib/legion/cli/lex/templates/queue.erb +12 -0
  44. data/lib/legion/cli/lex/templates/queue_helper.erb +24 -0
  45. data/lib/legion/cli/lex/templates/queue_spec.erb +11 -0
  46. data/lib/legion/cli/lex/templates/runner.erb +11 -0
  47. data/lib/legion/cli/lex/templates/runner_spec.erb +11 -0
  48. data/lib/legion/cli/relationship.rb +22 -0
  49. data/lib/legion/cli/task.rb +49 -0
  50. data/lib/legion/cli/trigger.rb +88 -0
  51. data/lib/legion/cli/version.rb +5 -0
  52. data/lib/legion/extensions.rb +35 -1
  53. data/lib/legion/extensions/actors/base.rb +0 -2
  54. data/lib/legion/extensions/actors/poll.rb +0 -1
  55. data/lib/legion/extensions/actors/subscription.rb +1 -0
  56. data/lib/legion/extensions/core.rb +9 -4
  57. data/lib/legion/extensions/helpers/base.rb +3 -3
  58. data/lib/legion/extensions/helpers/logger.rb +3 -6
  59. data/lib/legion/extensions/helpers/task.rb +1 -1
  60. data/lib/legion/lex.rb +89 -0
  61. data/lib/legion/service.rb +34 -3
  62. data/lib/legion/version.rb +1 -1
  63. metadata +196 -82
  64. data/bin/console +0 -16
  65. data/bin/legion +0 -49
  66. data/bin/setup +0 -8
  67. data/bin/test +0 -32
  68. data/docs/Makefile +0 -20
  69. data/docs/_build/doctrees/environment.pickle +0 -0
  70. data/docs/_build/doctrees/index.doctree +0 -0
  71. data/docs/_build/doctrees/overview.doctree +0 -0
  72. data/docs/_build/html/.buildinfo +0 -4
  73. data/docs/_build/html/_sources/index.rst.txt +0 -28
  74. data/docs/_build/html/_static/alabaster.css +0 -701
  75. data/docs/_build/html/_static/basic.css +0 -855
  76. data/docs/_build/html/_static/custom.css +0 -1
  77. data/docs/_build/html/_static/doctools.js +0 -315
  78. data/docs/_build/html/_static/documentation_options.js +0 -12
  79. data/docs/_build/html/_static/file.png +0 -0
  80. data/docs/_build/html/_static/jquery-3.5.1.js +0 -10872
  81. data/docs/_build/html/_static/jquery.js +0 -2
  82. data/docs/_build/html/_static/language_data.js +0 -297
  83. data/docs/_build/html/_static/minus.png +0 -0
  84. data/docs/_build/html/_static/plus.png +0 -0
  85. data/docs/_build/html/_static/pygments.css +0 -82
  86. data/docs/_build/html/_static/searchtools.js +0 -514
  87. data/docs/_build/html/_static/underscore-1.3.1.js +0 -999
  88. data/docs/_build/html/_static/underscore.js +0 -31
  89. data/docs/_build/html/genindex.html +0 -101
  90. data/docs/_build/html/index.html +0 -117
  91. data/docs/_build/html/objects.inv +0 -6
  92. data/docs/_build/html/overview.html +0 -98
  93. data/docs/_build/html/search.html +0 -110
  94. data/docs/_build/html/searchindex.js +0 -1
  95. data/docs/conf.py +0 -54
  96. data/docs/index.rst +0 -28
  97. data/docs/make.bat +0 -35
  98. data/lib/legion/exceptions/handled_task.rb +0 -6
  99. data/lib/legion/exceptions/invalidjson.rb +0 -5
  100. data/lib/legion/exceptions/missingargument.rb +0 -6
  101. data/lib/legion/exceptions/wrongtype.rb +0 -10
  102. data/lib/legion/exceptions/wrongtypes/array.rb +0 -8
  103. data/lib/legion/exceptions/wrongtypes/hash.rb +0 -8
  104. data/lib/legion/exceptions/wrongtypes/integer.rb +0 -8
  105. data/lib/legion/exceptions/wrongtypes/string.rb +0 -8
@@ -1 +0,0 @@
1
- Search.setIndex({docnames:["index","overview"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst","overview.rst"],objects:{},objnames:{},objtypes:{},terms:{"class":0,"function":0,These:0,acknowledg:0,action:0,add:0,ani:0,call:0,can:0,chain:0,cluster:0,complex:0,connect:0,contain:0,content:[],creat:0,delet:0,design:0,exampl:0,extens:0,foobar:[],get:0,incid:0,index:[],input:0,instal:0,legion:0,lex:0,list:0,make:0,merg:0,modul:[],more:0,out:0,output:0,page:[],pagerduti:0,platform:0,project:0,relationship:0,resolv:0,runner:0,search:[],second:[],servic:0,them:0,thi:[],thing:0,think:0,trigger:0,updat:0,user:0,whatev:0,which:0,within:0,without:0,work:0,workflow:0,yaml:0,you:0,your:0},titles:["LegionIO Overview","<no title>"],titleterms:{about:0,document:[],indic:[],legionio:0,overview:0,tabl:[],test3:[],test:[],welcom:[]}})
@@ -1,54 +0,0 @@
1
- # Configuration file for the Sphinx documentation builder.
2
- #
3
- # This file only contains a selection of the most common options. For a full
4
- # list see the documentation:
5
- # https://www.sphinx-doc.org/en/master/usage/configuration.html
6
-
7
- # -- Path setup --------------------------------------------------------------
8
-
9
- # If extensions (or modules to document with autodoc) are in another directory,
10
- # add these directories to sys.path here. If the directory is relative to the
11
- # documentation root, use os.path.abspath to make it absolute, like shown here.
12
- #
13
- # import os
14
- # import sys
15
- # sys.path.insert(0, os.path.abspath('.'))
16
-
17
-
18
- # -- Project information -----------------------------------------------------
19
-
20
- project = 'LegionIO'
21
- copyright = '2020, Esity'
22
- author = 'Esity'
23
-
24
- # The full version, including alpha/beta/rc tags
25
- release = '0.3.1'
26
-
27
-
28
- # -- General configuration ---------------------------------------------------
29
-
30
- # Add any Sphinx extension module names here, as strings. They can be
31
- # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32
- # ones.
33
- extensions = ['recommonmark']
34
-
35
- # Add any paths that contain templates here, relative to this directory.
36
- templates_path = ['_templates']
37
-
38
- # List of patterns, relative to source directory, that match files and
39
- # directories to ignore when looking for source files.
40
- # This pattern also affects html_static_path and html_extra_path.
41
- exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
42
-
43
-
44
- # -- Options for HTML output -------------------------------------------------
45
-
46
- # The theme to use for HTML and HTML Help pages. See the documentation for
47
- # a list of builtin themes.
48
- #
49
- html_theme = 'alabaster'
50
-
51
- # Add any paths that contain custom static files (such as style sheets) here,
52
- # relative to this directory. They are copied after the builtin static files,
53
- # so a file named "default.css" will overwrite the builtin "default.css".
54
- html_static_path = ['_static']
@@ -1,28 +0,0 @@
1
- .. LegionIO documentation master file, created by
2
- sphinx-quickstart on Thu Oct 15 08:16:27 2020.
3
- You can adapt this file completely to your liking, but it should at least
4
- contain the root `toctree` directive.
5
-
6
- LegionIO Overview
7
- ==============================
8
-
9
- About
10
- ------------
11
- LegionIO is a platform designed for connecting things. You install a LEX(Legion Extension)
12
- which adds functionality to your Legion service?project?cluster? Whatever it's called.
13
-
14
- A LEX contains 1 or more runners. Think of them as classes
15
- A runner contains 1 or more functions. These are the things you can call and make relationships out of
16
- Example
17
-
18
- * Lex: pagerduty
19
-
20
- * Runners: incident, user, service
21
-
22
- * Functions within the incident runner: trigger, acknowledge, resolve, merge
23
-
24
- * Functions within the services runner: create, delete, update, list, get
25
-
26
- Any function can be a trigger or an action(the input or output in the relationship).
27
-
28
- Legion works by creating chains of relationships to make make a complex workflow without complex yaml
@@ -1,35 +0,0 @@
1
- @ECHO OFF
2
-
3
- pushd %~dp0
4
-
5
- REM Command file for Sphinx documentation
6
-
7
- if "%SPHINXBUILD%" == "" (
8
- set SPHINXBUILD=sphinx-build
9
- )
10
- set SOURCEDIR=.
11
- set BUILDDIR=_build
12
-
13
- if "%1" == "" goto help
14
-
15
- %SPHINXBUILD% >NUL 2>NUL
16
- if errorlevel 9009 (
17
- echo.
18
- echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19
- echo.installed, then set the SPHINXBUILD environment variable to point
20
- echo.to the full path of the 'sphinx-build' executable. Alternatively you
21
- echo.may add the Sphinx directory to PATH.
22
- echo.
23
- echo.If you don't have Sphinx installed, grab it from
24
- echo.http://sphinx-doc.org/
25
- exit /b 1
26
- )
27
-
28
- %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
- goto end
30
-
31
- :help
32
- %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
-
34
- :end
35
- popd
@@ -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