caixanegra 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,2 @@
1
+ //= link_directory ../stylesheets/caixanegra .css
2
+ //= link_directory ../javascripts/caixanegra .js
@@ -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 || {}