armature-anvil 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/lib/anvil.rb +1 -0
- data/lib/anvil/client.rb +29 -0
- data/lib/anvil/vulnerability.rb +16 -0
- metadata +46 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 820e8650a86bdd660e553c909f57d4717bb4e60a
|
4
|
+
data.tar.gz: 6072e4d4b13c18772a5c0e38f15c34d514a61457
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ed470e71ea1860411481c12e56deb14113adc5c1808d85d10a075df45b8f2626eebf84171ab11f59d29c28f79be03c8e5685c5eb6bc8b274e8c6cec590bbc7d2
|
7
|
+
data.tar.gz: 4c75a2d6449b0a609bd7ab47c7aa39e3ca37c0130e8589fcf18017147c1ba07dbfb23d4a8ae52b98cb5912c18a5761e3aa7db63c26dfd45219d726c62d0b6622
|
data/lib/anvil.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
class Anvil; end
|
data/lib/anvil/client.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
module Anvil
|
2
|
+
class Client
|
3
|
+
require 'anvil/vulnerability'
|
4
|
+
|
5
|
+
attr_reader :api_key, :base_url
|
6
|
+
|
7
|
+
def initialize(api_key, environment)
|
8
|
+
@api_key = api_key
|
9
|
+
load_base_url_for(environment)
|
10
|
+
end
|
11
|
+
|
12
|
+
def vulnerabilities
|
13
|
+
Anvil::Vulnerability.new(self)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def load_base_url_for(environment)
|
19
|
+
case environment
|
20
|
+
when 'production'
|
21
|
+
@base_url = 'https://app.conviso.com.br'
|
22
|
+
when 'staging'
|
23
|
+
@base_url = 'https://homologa.conviso.com.br'
|
24
|
+
else
|
25
|
+
raise ArgumentError, "environment must be 'production' or 'staging'"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Anvil
|
2
|
+
class Vulnerability
|
3
|
+
attr_reader :client, :args
|
4
|
+
|
5
|
+
def initialize(client)
|
6
|
+
if client.class != Anvil::Client
|
7
|
+
raise ArgumentError, 'client param must be a Client class'
|
8
|
+
end
|
9
|
+
@client = client
|
10
|
+
end
|
11
|
+
|
12
|
+
def create!(*args)
|
13
|
+
'creating vulnerability'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: armature-anvil
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Anezio Campos
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-11-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Ruby wrapper for the REST API for Conviso Armature
|
14
|
+
email: newdevas@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/anvil.rb
|
20
|
+
- lib/anvil/client.rb
|
21
|
+
- lib/anvil/vulnerability.rb
|
22
|
+
homepage: http://app.conviso.com.br
|
23
|
+
licenses:
|
24
|
+
- MIT
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 2.4.2
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 2.4.6
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: Armature REST API Client
|
46
|
+
test_files: []
|