crossbelt-xbui 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.gitlab-ci.yml +56 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +40 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +103 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/crossbelt_xbui.gemspec +42 -0
- data/lib/crossbelt/plugins/exporters/xbui.rb +71 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 86ae414e6ced306ed57c1bf55590b191a3df3ed89cf00d383d942a6cd522ddc8
|
4
|
+
data.tar.gz: d1eb7703f5c577fc4bf714bd7735d08cfd84c130a4037013f01ce0a4dfed5f13
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 153bc867453af93b7433dae71d850f857ace6943d27bd4708ac80b3cce74f9cb0906df9769f97f6131f4ef286d66a42bec2fe3888ea10e47f7ad432b25fe08c2
|
7
|
+
data.tar.gz: bf236f8f2fa5f6ee0ad293d1cdbe706d56b318f375889d2065de763757ebbaf6cf6b6c7f0b154187321d0392f6a9be00a8d2b3afd66f7413683e0ab629068e57
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
image: "ruby:2.5"
|
2
|
+
|
3
|
+
variables:
|
4
|
+
CONTAINER_TEST_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH:$CI_COMMIT_REF
|
5
|
+
CONTAINER_RELEASE_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH:latest
|
6
|
+
CONTAINER_COMMIT_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH:$CI_COMMIT_SHA
|
7
|
+
LANG: en_US.UTF-8
|
8
|
+
LANGUAGE: en_US.UTF-8
|
9
|
+
|
10
|
+
# Cache gems in between builds
|
11
|
+
cache:
|
12
|
+
paths:
|
13
|
+
- vendor/ruby
|
14
|
+
|
15
|
+
stages:
|
16
|
+
- build
|
17
|
+
- test
|
18
|
+
|
19
|
+
rubocop:
|
20
|
+
stage: test
|
21
|
+
script:
|
22
|
+
- bundle install -j $(nproc) --path vendor
|
23
|
+
- bundle exec rubocop
|
24
|
+
|
25
|
+
spec_tests_2_5:
|
26
|
+
stage: test
|
27
|
+
image: ruby:2.5
|
28
|
+
script:
|
29
|
+
- apt-get update && apt-get install -y lsof # required for testing
|
30
|
+
- gem install bundler --no-ri --no-rdoc
|
31
|
+
- bundle install -j $(nproc) --path vendor
|
32
|
+
- bundle exec rake spec
|
33
|
+
#allow_failure: true
|
34
|
+
|
35
|
+
spec_tests_2_6:
|
36
|
+
stage: test
|
37
|
+
allow_failure: true
|
38
|
+
variables:
|
39
|
+
RUBYOPT: '--jit --jit-verbose=1'
|
40
|
+
image: ruby:2.6.0-rc1
|
41
|
+
script:
|
42
|
+
- apt-get update && apt-get install -y lsof # required for testing
|
43
|
+
- gem install bundler --no-ri --no-rdoc
|
44
|
+
- bundle install -j $(nproc) --path vendor
|
45
|
+
- bundle exec rake spec
|
46
|
+
|
47
|
+
build_gem:
|
48
|
+
stage: build
|
49
|
+
script:
|
50
|
+
- gem install bundler --no-ri --no-rdoc
|
51
|
+
- bundle install -j $(nproc) --path vendor
|
52
|
+
- bundle exec rake build
|
53
|
+
artifacts:
|
54
|
+
paths:
|
55
|
+
- pkg/
|
56
|
+
expire_in: 2 week
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-09-14 09:43:56 -0700 using RuboCop version 0.59.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 3
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 30
|
12
|
+
|
13
|
+
# Offense count: 5
|
14
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
15
|
+
# ExcludedMethods: refine
|
16
|
+
Metrics/BlockLength:
|
17
|
+
Max: 130
|
18
|
+
|
19
|
+
# Offense count: 2
|
20
|
+
# Configuration parameters: CountComments.
|
21
|
+
Metrics/ClassLength:
|
22
|
+
Max: 241
|
23
|
+
|
24
|
+
# Offense count: 9
|
25
|
+
# Configuration parameters: CountComments.
|
26
|
+
Metrics/MethodLength:
|
27
|
+
Max: 60
|
28
|
+
|
29
|
+
# Offense count: 4
|
30
|
+
Style/Documentation:
|
31
|
+
Exclude:
|
32
|
+
- 'lib/crossbelt/plugins/exporters/xbui.rb'
|
33
|
+
- 'spec/**/*'
|
34
|
+
- 'test/**/*'
|
35
|
+
|
36
|
+
# Offense count: 83
|
37
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
38
|
+
# URISchemes: http, https
|
39
|
+
Metrics/LineLength:
|
40
|
+
Max: 233
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at opselite@protonmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
group :development do
|
6
|
+
gem 'aruba'
|
7
|
+
gem 'bundler', '~> 1.15'
|
8
|
+
gem 'crossbelt-xbui', path: '.'
|
9
|
+
gem 'pry'
|
10
|
+
gem 'rake', '~> 10.0'
|
11
|
+
gem 'rb-readline'
|
12
|
+
gem 'rspec', '~> 3.0'
|
13
|
+
gem 'rubocop'
|
14
|
+
gem 'simplecov'
|
15
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
crossbelt-xbui (0.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
aruba (0.14.6)
|
10
|
+
childprocess (>= 0.6.3, < 0.10.0)
|
11
|
+
contracts (~> 0.9)
|
12
|
+
cucumber (>= 1.3.19)
|
13
|
+
ffi (~> 1.9.10)
|
14
|
+
rspec-expectations (>= 2.99)
|
15
|
+
thor (~> 0.19)
|
16
|
+
ast (2.4.0)
|
17
|
+
backports (3.11.4)
|
18
|
+
builder (3.2.3)
|
19
|
+
childprocess (0.9.0)
|
20
|
+
ffi (~> 1.0, >= 1.0.11)
|
21
|
+
coderay (1.1.2)
|
22
|
+
contracts (0.16.0)
|
23
|
+
cucumber (3.1.2)
|
24
|
+
builder (>= 2.1.2)
|
25
|
+
cucumber-core (~> 3.2.0)
|
26
|
+
cucumber-expressions (~> 6.0.1)
|
27
|
+
cucumber-wire (~> 0.0.1)
|
28
|
+
diff-lcs (~> 1.3)
|
29
|
+
gherkin (~> 5.1.0)
|
30
|
+
multi_json (>= 1.7.5, < 2.0)
|
31
|
+
multi_test (>= 0.1.2)
|
32
|
+
cucumber-core (3.2.0)
|
33
|
+
backports (>= 3.8.0)
|
34
|
+
cucumber-tag_expressions (~> 1.1.0)
|
35
|
+
gherkin (>= 5.0.0)
|
36
|
+
cucumber-expressions (6.0.1)
|
37
|
+
cucumber-tag_expressions (1.1.1)
|
38
|
+
cucumber-wire (0.0.1)
|
39
|
+
diff-lcs (1.3)
|
40
|
+
docile (1.3.1)
|
41
|
+
ffi (1.9.25)
|
42
|
+
gherkin (5.1.0)
|
43
|
+
jaro_winkler (1.5.1)
|
44
|
+
json (2.1.0)
|
45
|
+
method_source (0.9.0)
|
46
|
+
multi_json (1.13.1)
|
47
|
+
multi_test (0.1.2)
|
48
|
+
parallel (1.12.1)
|
49
|
+
parser (2.5.1.2)
|
50
|
+
ast (~> 2.4.0)
|
51
|
+
powerpack (0.1.2)
|
52
|
+
pry (0.11.3)
|
53
|
+
coderay (~> 1.1.0)
|
54
|
+
method_source (~> 0.9.0)
|
55
|
+
rainbow (3.0.0)
|
56
|
+
rake (10.5.0)
|
57
|
+
rb-readline (0.5.5)
|
58
|
+
rspec (3.8.0)
|
59
|
+
rspec-core (~> 3.8.0)
|
60
|
+
rspec-expectations (~> 3.8.0)
|
61
|
+
rspec-mocks (~> 3.8.0)
|
62
|
+
rspec-core (3.8.0)
|
63
|
+
rspec-support (~> 3.8.0)
|
64
|
+
rspec-expectations (3.8.1)
|
65
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
66
|
+
rspec-support (~> 3.8.0)
|
67
|
+
rspec-mocks (3.8.0)
|
68
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
+
rspec-support (~> 3.8.0)
|
70
|
+
rspec-support (3.8.0)
|
71
|
+
rubocop (0.59.0)
|
72
|
+
jaro_winkler (~> 1.5.1)
|
73
|
+
parallel (~> 1.10)
|
74
|
+
parser (>= 2.5, != 2.5.1.1)
|
75
|
+
powerpack (~> 0.1)
|
76
|
+
rainbow (>= 2.2.2, < 4.0)
|
77
|
+
ruby-progressbar (~> 1.7)
|
78
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
79
|
+
ruby-progressbar (1.10.0)
|
80
|
+
simplecov (0.16.1)
|
81
|
+
docile (~> 1.1)
|
82
|
+
json (>= 1.8, < 3)
|
83
|
+
simplecov-html (~> 0.10.0)
|
84
|
+
simplecov-html (0.10.2)
|
85
|
+
thor (0.20.0)
|
86
|
+
unicode-display_width (1.4.0)
|
87
|
+
|
88
|
+
PLATFORMS
|
89
|
+
ruby
|
90
|
+
|
91
|
+
DEPENDENCIES
|
92
|
+
aruba
|
93
|
+
bundler (~> 1.15)
|
94
|
+
crossbelt-xbui!
|
95
|
+
pry
|
96
|
+
rake (~> 10.0)
|
97
|
+
rb-readline
|
98
|
+
rspec (~> 3.0)
|
99
|
+
rubocop
|
100
|
+
simplecov
|
101
|
+
|
102
|
+
BUNDLED WITH
|
103
|
+
1.16.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Corey Osman
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Crossbelt::Inventory
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/crossbelt/inventory`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'crossbelt-inventory'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install crossbelt-inventory
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/logicminds/crossbelt-inventory. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the Crossbelt::Inventory project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/logicminds/crossbelt-inventory/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'crossbelt/inventory'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'crossbelt/plugins/exporters/xbui'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'crossbelt-xbui'
|
9
|
+
spec.version = Crossbelt::Plugins::Exporters::Xbui.version
|
10
|
+
spec.authors = ['Opselite']
|
11
|
+
spec.email = ['opselite@blockops.party']
|
12
|
+
|
13
|
+
spec.summary = 'XBUI crossbelt plugin'
|
14
|
+
spec.description = 'A crossbelt plugin that transmit data to the XB UI'
|
15
|
+
spec.homepage = 'https://crossbelt.blockops.party'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
19
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
20
|
+
# if spec.respond_to?(:metadata)
|
21
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
22
|
+
# else
|
23
|
+
# raise 'RubyGems 2.0 or newer is required to protect against ' \
|
24
|
+
# 'public gem pushes.'
|
25
|
+
# end
|
26
|
+
|
27
|
+
# Specify which files should be added to the gem when it is released.
|
28
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
29
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
30
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
31
|
+
end
|
32
|
+
spec.bindir = 'exe'
|
33
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
34
|
+
spec.require_paths = ['lib']
|
35
|
+
spec.add_development_dependency 'aruba', '~> 0.14.5'
|
36
|
+
spec.add_development_dependency 'bundler', '~> 1.15'
|
37
|
+
spec.add_development_dependency 'pry', '~> 0.11.3'
|
38
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
39
|
+
spec.add_development_dependency 'rb-readline', '~> 0.5.5'
|
40
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
41
|
+
spec.add_development_dependency 'rubocop', '~> 0.55.0'
|
42
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'net/http'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module Crossbelt
|
7
|
+
module Plugins
|
8
|
+
module Exporters
|
9
|
+
class Xbui
|
10
|
+
def self.requires
|
11
|
+
[:none]
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.utilizies
|
15
|
+
[:json]
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.type
|
19
|
+
'exporter'
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.version
|
23
|
+
'0.0.1'
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.name
|
27
|
+
'xbui'
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.description
|
31
|
+
'Outputs data to XBUI'
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.to_h
|
35
|
+
{
|
36
|
+
name: name,
|
37
|
+
type: type,
|
38
|
+
version: version,
|
39
|
+
desc: description
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.export(contents: nil, context: Object.new)
|
44
|
+
uri = URI('https://emjqbdo9s1.execute-api.us-east-1.amazonaws.com/dev/')
|
45
|
+
req_options = {
|
46
|
+
read_timeout: 5,
|
47
|
+
use_ssl: uri.scheme == 'https'
|
48
|
+
}
|
49
|
+
metadata = {
|
50
|
+
rigId: context.config.read_config('rigId', 'none'),
|
51
|
+
owner: 'me',
|
52
|
+
rigName: context.rig.nickname || context.rig.name
|
53
|
+
}
|
54
|
+
|
55
|
+
request = Net::HTTP::Post.new(uri.path)
|
56
|
+
request.body = context.rig.to_h.merge(metadata).to_json
|
57
|
+
request.content_type = 'application/json'
|
58
|
+
|
59
|
+
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
|
60
|
+
http.request(request)
|
61
|
+
end
|
62
|
+
if response.code == '200'
|
63
|
+
response.body
|
64
|
+
else
|
65
|
+
'Failed to send data'
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: crossbelt-xbui
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Opselite
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aruba
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.14.5
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.14.5
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.15'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.15'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.11.3
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.11.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rb-readline
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.5.5
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.5.5
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.55.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.55.0
|
111
|
+
description: A crossbelt plugin that transmit data to the XB UI
|
112
|
+
email:
|
113
|
+
- opselite@blockops.party
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".gitlab-ci.yml"
|
120
|
+
- ".rspec"
|
121
|
+
- ".rubocop.yml"
|
122
|
+
- ".rubocop_todo.yml"
|
123
|
+
- ".ruby-version"
|
124
|
+
- ".travis.yml"
|
125
|
+
- CODE_OF_CONDUCT.md
|
126
|
+
- Gemfile
|
127
|
+
- Gemfile.lock
|
128
|
+
- LICENSE.txt
|
129
|
+
- README.md
|
130
|
+
- Rakefile
|
131
|
+
- bin/console
|
132
|
+
- bin/setup
|
133
|
+
- crossbelt_xbui.gemspec
|
134
|
+
- lib/crossbelt/plugins/exporters/xbui.rb
|
135
|
+
homepage: https://crossbelt.blockops.party
|
136
|
+
licenses:
|
137
|
+
- MIT
|
138
|
+
metadata: {}
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options: []
|
141
|
+
require_paths:
|
142
|
+
- lib
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
requirements: []
|
154
|
+
rubyforge_project:
|
155
|
+
rubygems_version: 2.7.7
|
156
|
+
signing_key:
|
157
|
+
specification_version: 4
|
158
|
+
summary: XBUI crossbelt plugin
|
159
|
+
test_files: []
|