armature_anvil 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fecf6c2c99d040d9e26b8e3ed28b27a70c8c5139
4
+ data.tar.gz: 2ac533328e5ccba0d06faceed5a014a941afe1eb
5
+ SHA512:
6
+ metadata.gz: b380ebb4dc8d4ee5e2080c3e430e9a9f6ea7284d38ff186a222f84595768aa0bbaaff38574234eb5f710cfb3b2dc0b375477907cf784e140e42a098c9f47853a
7
+ data.tar.gz: f9eb82b4f79454dbce3c7726ae74188ff7b34d9d1ff9cc85fa3ba3b20aa2822f112ee048195a620bc738cf8e4dacddabed8a077c210e3db04ba38d3009f7d90b
@@ -0,0 +1 @@
1
+ class Anvil; end
@@ -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: []