caixanegra 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +18 -0
- data/Rakefile +32 -0
- data/app/assets/config/caixanegra_manifest.js +2 -0
- data/app/assets/javascripts/caixanegra/api.js +69 -0
- data/app/assets/javascripts/caixanegra/caixanegra.js +1 -0
- data/app/assets/javascripts/caixanegra/designer.js +1281 -0
- data/app/assets/javascripts/caixanegra/sabertooth.js +310 -0
- data/app/assets/stylesheets/caixanegra/application.css +15 -0
- data/app/assets/stylesheets/caixanegra/designer.scss +804 -0
- data/app/controllers/caixanegra/api/designer/flows_controller.rb +44 -0
- data/app/controllers/caixanegra/api/designer/units_controller.rb +43 -0
- data/app/controllers/caixanegra/api_controller.rb +6 -0
- data/app/controllers/caixanegra/application_controller.rb +7 -0
- data/app/controllers/caixanegra/designer_controller.rb +9 -0
- data/app/helpers/caixanegra/application_helper.rb +4 -0
- data/app/models/caixanegra/unit.rb +131 -0
- data/app/views/caixanegra/designer/index.html.erb +109 -0
- data/app/views/layouts/caixanegra/application.html.erb +16 -0
- data/app/views/shared/caixanegra/_js_dependencies.html.erb +4 -0
- data/config/routes.rb +14 -0
- data/lib/caixanegra/engine.rb +25 -0
- data/lib/caixanegra/exceptions.rb +5 -0
- data/lib/caixanegra/executor.rb +201 -0
- data/lib/caixanegra/manager.rb +32 -0
- data/lib/caixanegra/version.rb +3 -0
- data/lib/caixanegra.rb +8 -0
- data/lib/tasks/caixanegra_tasks.rake +4 -0
- metadata +100 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fd21dec4c184b88b2898d5f011eb9e7288562c28f2204db0a6e85cca004153de
|
4
|
+
data.tar.gz: 49b39b216ac37609aa921ece85a263de64a7e932082d80761388e41d5c5eaf3d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8dcad855ae35dc5241379f3f4acc574ec4b0204877cea2d8770a08cf9774ffe7257f0a873ac0e067048ea432ee4c2689c94afea393aecd94942764b42ea67e06
|
7
|
+
data.tar.gz: a636a4d03ab305b54464f2003488fdb21f756f3876f4899da6b026b53e6f3326a4909a860ec7cb3390eecb68530e9070c44ed794a9fa484fbf25dbd35411d424
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2021 sergiorribeiro
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# caixanegra
|
2
|
+
![Gem](https://img.shields.io/gem/v/caixanegra?logo=ruby&logoColor=red)
|
3
|
+
|
4
|
+
## Getting Started
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'caixanegra'
|
16
|
+
```
|
17
|
+
## License
|
18
|
+
**caixanegra** is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Caixanegra'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
load 'rails/tasks/statistics.rake'
|
21
|
+
|
22
|
+
require 'bundler/gem_tasks'
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'test'
|
28
|
+
t.pattern = 'test/**/*_test.rb'
|
29
|
+
t.verbose = false
|
30
|
+
end
|
31
|
+
|
32
|
+
task default: :test
|
@@ -0,0 +1,69 @@
|
|
1
|
+
window.Caixanegra.API = class {
|
2
|
+
mountedPath() {
|
3
|
+
return document.querySelector("consts mounted_path").getAttribute("value");
|
4
|
+
}
|
5
|
+
|
6
|
+
units(unitScope) {
|
7
|
+
return new Promise((resolve, reject) => {
|
8
|
+
const request = new XMLHttpRequest();
|
9
|
+
|
10
|
+
request.addEventListener("load", (event) => {
|
11
|
+
resolve(JSON.parse(event.target.response));
|
12
|
+
});
|
13
|
+
request.addEventListener("error", () => {
|
14
|
+
reject();
|
15
|
+
});
|
16
|
+
|
17
|
+
request.open("GET", `${this.mountedPath()}/api/designer/units${unitScope === "" ? "" : `?scope=${unitScope}`}`);
|
18
|
+
request.send();
|
19
|
+
});
|
20
|
+
}
|
21
|
+
|
22
|
+
getFlow(id) {
|
23
|
+
return new Promise((resolve, reject) => {
|
24
|
+
const request = new XMLHttpRequest();
|
25
|
+
|
26
|
+
request.addEventListener("load", (event) => {
|
27
|
+
resolve(JSON.parse(event.target.response));
|
28
|
+
});
|
29
|
+
request.addEventListener("error", () => {
|
30
|
+
reject();
|
31
|
+
});
|
32
|
+
|
33
|
+
request.open("GET", `${this.mountedPath()}/api/designer/flows/${id}`);
|
34
|
+
request.send();
|
35
|
+
});
|
36
|
+
}
|
37
|
+
|
38
|
+
saveFlow(id, flow) {
|
39
|
+
return new Promise((resolve, reject) => {
|
40
|
+
const request = new XMLHttpRequest();
|
41
|
+
|
42
|
+
request.addEventListener("load", (event) => {
|
43
|
+
resolve();
|
44
|
+
});
|
45
|
+
request.addEventListener("error", () => {
|
46
|
+
reject();
|
47
|
+
});
|
48
|
+
|
49
|
+
request.open("PATCH", `${this.mountedPath()}/api/designer/flows/${id}`);
|
50
|
+
request.send(JSON.stringify(flow));
|
51
|
+
});
|
52
|
+
}
|
53
|
+
|
54
|
+
debugRun(id, unitScope, initialCarryOver) {
|
55
|
+
return new Promise((resolve, reject) => {
|
56
|
+
const request = new XMLHttpRequest();
|
57
|
+
|
58
|
+
request.addEventListener("load", (event) => {
|
59
|
+
resolve(JSON.parse(event.target.response));
|
60
|
+
});
|
61
|
+
request.addEventListener("error", () => {
|
62
|
+
reject();
|
63
|
+
});
|
64
|
+
|
65
|
+
request.open("PATCH", `${this.mountedPath()}/api/designer/flows/${id}/debug_run${unitScope === "" ? "" : `?scope=${unitScope}`}`);
|
66
|
+
request.send(JSON.stringify(initialCarryOver));
|
67
|
+
});
|
68
|
+
}
|
69
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
window.Caixanegra = window.Caixanegra || {}
|