qas_dock_gem 0.1.26 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d249a5d20d99877fe00332a0a5ff9a022bb057d13acc4cb0b60439dd127d1e0
4
- data.tar.gz: abb4bdb9e5042934195d7bf7059e2509f130745d43752e824f72e6884ed520ed
3
+ metadata.gz: ac287121baaad1a1e9e8a94577c7a807261525770994eb04d22595dc5620ac21
4
+ data.tar.gz: 0cf98a22db7e586431161c1ee700647c6b228a5436b36228dbcd40dce7078c49
5
5
  SHA512:
6
- metadata.gz: 93aae6cc184149825749bd5e53bd78fe53969fc1c69b70c763688cb4e2105de0a82cfd174ae60a334189e853a58c87290df175c194e314285f450c8c6a049a84
7
- data.tar.gz: 1b64aa86f1f30e86a6c9dc88c8a7e309316a0349be8de775d68248ace9183593e542d4281c8e6b118b21074a0bba580472307985546fd26ed36a457d74a1a73a
6
+ metadata.gz: ae3d28531cbbe5cb79735486200be185c04f7dd4701f93d07aaf1b622daf9c86cac668c59f219a1196951b14dcdf800f37f3f25370ac14f5b96e92b9e8605b58
7
+ data.tar.gz: 515a0dac88eb4a0a3ca64bc25f00546e2655b2393a2b2bbb85e03eb95f8d99869bec24738604517b35b2127b3a348505f31d9a8dcb4718f3be7d180a56d54fd4
data/.gitignore CHANGED
@@ -6,3 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /.idea/
10
+ Gemfile.lock
data/CODE_OF_CONDUCT.md CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  ## Our Pledge
4
4
 
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for
6
+ everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity
7
+ and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion,
8
+ or sexual identity and orientation.
6
9
 
7
10
  We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
11
 
@@ -18,67 +21,82 @@ Examples of behavior that contributes to a positive environment for our communit
18
21
 
19
22
  Examples of unacceptable behavior include:
20
23
 
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
24
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
23
25
  * Trolling, insulting or derogatory comments, and personal or political attacks
24
26
  * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
27
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
28
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
29
29
 
30
30
  ## Enforcement Responsibilities
31
31
 
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take
33
+ appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive,
34
+ or harmful.
33
35
 
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
36
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
37
+ issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for
38
+ moderation decisions when appropriate.
35
39
 
36
40
  ## Scope
37
41
 
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
42
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
43
+ the community in public spaces. Examples of representing our community include using an official e-mail address, posting
44
+ via an official social media account, or acting as an appointed representative at an online or offline event.
39
45
 
40
46
  ## Enforcement
41
47
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at lucas.gimenes23@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
48
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible
49
+ for enforcement at lucas.gimenes23@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
50
 
44
51
  All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
52
 
46
53
  ## Enforcement Guidelines
47
54
 
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
55
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem
56
+ in violation of this Code of Conduct:
49
57
 
50
58
  ### 1. Correction
51
59
 
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
60
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the
61
+ community.
53
62
 
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
63
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation
64
+ and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
65
 
56
66
  ### 2. Warning
57
67
 
58
68
  **Community Impact**: A violation through a single incident or series of actions.
59
69
 
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
70
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including
71
+ unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding
72
+ interactions in community spaces as well as external channels like social media. Violating these terms may lead to a
73
+ temporary or permanent ban.
61
74
 
62
75
  ### 3. Temporary Ban
63
76
 
64
77
  **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
78
 
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
79
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified
80
+ period of time. No public or private interaction with the people involved, including unsolicited interaction with those
81
+ enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
82
 
68
83
  ### 4. Permanent Ban
69
84
 
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
85
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate
86
+ behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
87
 
72
88
  **Consequence**: A permanent ban from any sort of public interaction within the community.
73
89
 
74
90
  ## Attribution
75
91
 
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
92
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available
93
+ at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
94
 
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
95
+ Community Impact Guidelines were inspired
96
+ by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
97
 
81
98
  [homepage]: https://www.contributor-covenant.org
82
99
 
83
100
  For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
101
+ https://www.contributor-covenant.org/faq. Translations are available
102
+ at https://www.contributor-covenant.org/translations.
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source "https://rubygems.org"
3
+ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in qas_dock_gem.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0"
8
+ gem 'rake', '~> 13.0'
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # QasDockGem
2
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/qas_dock_gem`. To experiment with that code, run `bin/console` for an interactive prompt.
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
4
+ into a gem. Put your Ruby code in the file `lib/qas_dock_gem`. To experiment with that code, run `bin/console` for an
5
+ interactive prompt.
4
6
 
5
7
  TODO: Delete this and the text above, and describe your gem
6
8
 
@@ -26,13 +28,18 @@ TODO: Write usage instructions here
26
28
 
27
29
  ## Development
28
30
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
31
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive
32
+ prompt that will allow you to experiment.
30
33
 
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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
35
+ version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
36
+ push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
37
 
33
38
  ## Contributing
34
39
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/qas_dock_gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/qas_dock_gem/blob/master/CODE_OF_CONDUCT.md).
40
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/qas_dock_gem. This project is
41
+ intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
42
+ the [code of conduct](https://github.com/[USERNAME]/qas_dock_gem/blob/master/CODE_OF_CONDUCT.md).
36
43
 
37
44
  ## License
38
45
 
@@ -40,4 +47,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
47
 
41
48
  ## Code of Conduct
42
49
 
43
- Everyone interacting in the QasDockGem project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/qas_dock_gem/blob/master/CODE_OF_CONDUCT.md).
50
+ Everyone interacting in the QasDockGem project's codebases, issue trackers, chat rooms and mailing lists is expected to
51
+ follow the [code of conduct](https://github.com/[USERNAME]/qas_dock_gem/blob/master/CODE_OF_CONDUCT.md).
data/lib/qas_dock_gem.rb CHANGED
@@ -1,118 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "qas_dock_gem/version"
4
- require_relative "qas_dock_gem/services/aws_services"
3
+ require_relative 'qas_dock_gem/version'
4
+ require_relative 'qas_dock_gem/services/aws_services'
5
+ require_relative 'qas_dock_gem/services/redis_services'
6
+ require_relative 'qas_dock_gem/services/requests_api_services'
5
7
 
6
8
  module QasDockGem
7
- class RequestsAPI
8
- require "httparty"
9
- require "logger"
10
-
11
- def initialize
12
- @logger = Logger.new(STDOUT)
13
- end
14
-
15
- def initialize_headers(token, headers)
16
- headers_default = {"cache-control": "no-cache", "content-type": "application/json"}
17
-
18
- #seta o campo authorization caso o token seja diferente de nulo
19
- headers_default["Authorization"] = token unless token.nil?
20
-
21
- #define os headers parametrizados como um Hash caso seja nulo
22
- headers = {} if headers.nil?
23
-
24
- #realiza o merge dos headers defaults + os headers parametrizados
25
- headers_default.merge!(headers)
26
-
27
- #remove o campo content-type caso não seja informado
28
- headers_default.delete(:"content-type") if headers_default[:"content-type"] == "" or headers_default[:"content-type"].nil?
29
-
30
- #retorna os headers
31
- JSON.parse(headers_default.to_json)
32
- end
33
-
34
- def initialize_request(params)
35
- formated_params = init_request_body(params[:token], params[:payload], params[:headers]) if params.include?(:payload)
36
- formated_params = init_request_query(params[:token], params[:query], params[:headers]) if params.include?(:query)
37
- formated_params = init_request_basic_auth(params[:token], params[:basic_auth], params[:headers]) if params.include?(:basic_auth)
38
-
39
- #retorna os params formatados para a request
40
- formated_params
41
- end
42
-
43
- def init_request_body(token, payload, headers)
44
- final_headers = initialize_headers(token, headers)
45
- payload = {} if payload.nil?
46
- @logger.info("Payload: #{payload.to_json}")
47
- @logger.info("Headers: #{final_headers}")
48
-
49
- { :headers => final_headers, :body => payload.to_json }
50
- end
51
-
52
- def init_request_basic_auth(token, basic_auth, headers)
53
- final_headers = initialize_headers(token, headers)
54
- payload = {} if payload.nil?
55
- @logger.info("Headers: #{final_headers}")
56
- { :headers => final_headers, :basic_auth => basic_auth }
57
- end
58
-
59
- def init_request_query(token, query, headers)
60
- final_headers = initialize_headers(token, headers)
61
- query = {} if query.nil?
62
- @logger.info("Query: #{query}")
63
- @logger.info("Headers: #{final_headers}")
64
-
65
- { :headers => final_headers, :query => query }
66
- end
67
-
68
- def execute_post(params)
69
- formated_params = initialize_request(params)
70
- @logger.info("Realizando POST")
71
- @logger.info("URI: #{params[:uri]}")
72
- request = HTTParty.post(params[:uri], formated_params)
73
- @logger.info("URI Final: #{request.request.last_uri}")
74
- @logger.info("POST realizado \n")
75
- request
76
- end
77
-
78
- def execute_get(params)
79
- formated_params = initialize_request(params)
80
- @logger.info("Realizando GET")
81
- @logger.info("URI: #{params[:uri]}")
82
- request = HTTParty.get(params[:uri], formated_params)
83
- @logger.info("URI Final: #{request.request.last_uri}")
84
- @logger.info("GET realizado \n")
85
- request
86
- end
87
-
88
- def execute_patch(params)
89
- formated_params = initialize_request(params)
90
- @logger.info("Realizando PATCH")
91
- @logger.info("URI: #{params[:uri]}")
92
- request = HTTParty.patch(params[:uri], formated_params)
93
- @logger.info("URI Final: #{request.request.last_uri}")
94
- @logger.info("PATCH realizado \n")
95
- request
96
- end
97
-
98
- def execute_put(params)
99
- formated_params = initialize_request(params)
100
- @logger.info("Realizando PUT")
101
- @logger.info("URI: #{params[:uri]}")
102
- request = HTTParty.put(params[:uri], formated_params)
103
- @logger.info("URI Final: #{request.request.last_uri}")
104
- @logger.info("PUT realizado \n")
105
- request
106
- end
107
-
108
- def execute_delete(params)
109
- formated_params = initialize_request(params)
110
- @logger.info("Realizando DELETE")
111
- @logger.info("URI: #{params[:uri]}")
112
- request = HTTParty.put(params[:uri], formated_params)
113
- @logger.info("URI Final: #{request.request.last_uri}")
114
- @logger.info("DELETE realizado \n")
115
- request
116
- end
117
- end
118
- end
9
+ end
@@ -1,21 +1,23 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module QasDockGem
2
- class AwsServices
3
- def credentials_aws(access_key_id, secret_access_key_id, region)
4
- {
5
- access_key_id: access_key_id,
6
- secret_access_key: secret_access_key_id,
7
- region: region
8
- }
9
- end
10
-
11
- def init_secrets_manager(credentials)
12
- require "aws-sdk-secretsmanager"
13
- Aws::SecretsManager::Client.new(credentials)
14
- end
15
-
16
- def get_sm_secret_value(credentials, secret_name)
17
- secret = init_secrets_manager(credentials).get_secret_value(secret_id: "#{secret_name}")
18
- JSON.parse(secret.secret_string)
19
- end
20
- end
21
- end
4
+ class AwsServices
5
+ def credentials_aws(access_key_id, secret_access_key_id, region)
6
+ {
7
+ access_key_id: access_key_id,
8
+ secret_access_key: secret_access_key_id,
9
+ region: region
10
+ }
11
+ end
12
+
13
+ def init_secrets_manager(credentials)
14
+ require 'aws-sdk-secretsmanager'
15
+ Aws::SecretsManager::Client.new(credentials)
16
+ end
17
+
18
+ def get_sm_secret_value(credentials, secret_name)
19
+ secret = init_secrets_manager(credentials).get_secret_value(secret_id: secret_name.to_s)
20
+ JSON.parse(secret.secret_string)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module QasDockGem
4
+ class RedisService
5
+ def initialize
6
+ require 'logger'
7
+ require 'redis'
8
+ @logger = Logger.new($stdout)
9
+ end
10
+
11
+ def initialize_redis
12
+ redis_params = { host: ENV['uri_redis'], port: 6379, connect_timeout: 0.5, read_timeout: 1.0, write_timeout: 1.0 }
13
+ @redis = Redis.new(redis_params) # Realiza a tentativa de conexão com o redis com os params informados
14
+ begin
15
+ @redis.ping
16
+ @redis
17
+ rescue StandardError => e
18
+ @redis = nil
19
+ @logger.error("Params Redis: #{JSON.pretty_generate(JSON.parse(redis_params.to_json))}")
20
+ @logger.error("Exceção retornada do Redis: #{e.inspect} - Mensagem: #{e.message}")
21
+ end
22
+ end
23
+
24
+ def get_key_redis(key)
25
+ @logger.info("Buscando chave #{key} no Redis")
26
+ @redis = initialize_redis if @redis.nil?
27
+ begin
28
+ @redis.get(key)
29
+ rescue StandardError => e
30
+ @logger.error("Exceção retornada do redis ao consultar a chave: #{e}")
31
+ nil
32
+ end
33
+ end
34
+
35
+ def set_key_redis(key, value, ttl)
36
+ @logger.info("Cadastrando chave #{key} com valor: #{value} e tempo de duração: #{ttl}")
37
+ @redis = initialize_redis if @redis.nil?
38
+ begin
39
+ set_redis = @redis.set(key, value, ex: ttl)
40
+ @logger.info('Chave cadastrada com sucesso no redis') if set_redis == 'OK'
41
+ rescue StandardError => e
42
+ @logger.error("Exceção retornada do redis ao cadastrar a chave: #{e}")
43
+ nil
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,123 @@
1
+ # frozen_string_literal: true
2
+
3
+ module QasDockGem
4
+ class RequestsAPI
5
+ require 'httparty'
6
+
7
+ def initialize
8
+ require 'logger'
9
+ @logger = Logger.new($stdout)
10
+ end
11
+
12
+ def initialize_headers(token, headers)
13
+ headers_default = { "cache-control": 'no-cache', "content-type": 'application/json' }
14
+
15
+ # seta o campo authorization caso o token seja diferente de nulo
16
+ headers_default['Authorization'] = token unless token.nil?
17
+
18
+ # define os headers parametrizados como um Hash caso seja nulo
19
+ headers = {} if headers.nil?
20
+
21
+ # realiza o merge dos headers defaults + os headers parametrizados
22
+ headers_default.merge!(headers)
23
+
24
+ # remove o campo content-type caso não seja informado
25
+ if (headers_default[:"content-type"] == '') || headers_default[:"content-type"].nil?
26
+ headers_default.delete(:"content-type")
27
+ end
28
+
29
+ # retorna os headers
30
+ JSON.parse(headers_default.to_json)
31
+ end
32
+
33
+ def initialize_request(params)
34
+ formated_params = nil
35
+ if params.include?(:payload)
36
+ formated_params = init_request_body(params[:token], params[:payload], params[:headers])
37
+ end
38
+
39
+ formated_params = init_request_query(params[:token], params[:query], params[:headers]) if params.include?(:query)
40
+
41
+ if params.include?(:basic_auth)
42
+ formated_params = init_request_basic_auth(params[:token], params[:basic_auth], params[:headers])
43
+ end
44
+
45
+ # retorna os params formatados para a request
46
+ formated_params
47
+ end
48
+
49
+ def init_request_body(token, payload, headers)
50
+ final_headers = initialize_headers(token, headers)
51
+ payload = {} if payload.nil?
52
+ @logger.info("Payload: #{payload.to_json}")
53
+ @logger.info("Headers: #{final_headers}")
54
+
55
+ { headers: final_headers, body: payload.to_json }
56
+ end
57
+
58
+ def init_request_basic_auth(token, basic_auth, headers)
59
+ final_headers = initialize_headers(token, headers)
60
+ @logger.info("Headers: #{final_headers}")
61
+ { headers: final_headers, basic_auth: basic_auth }
62
+ end
63
+
64
+ def init_request_query(token, query, headers)
65
+ final_headers = initialize_headers(token, headers)
66
+ query = {} if query.nil?
67
+ @logger.info("Query: #{query}")
68
+ @logger.info("Headers: #{final_headers}")
69
+
70
+ { headers: final_headers, query: query }
71
+ end
72
+
73
+ def execute_post(params)
74
+ formated_params = initialize_request(params)
75
+ @logger.info('Realizando POST')
76
+ @logger.info("URI: #{params[:uri]}")
77
+ request = HTTParty.post(params[:uri], formated_params)
78
+ @logger.info("URI Final: #{request.request.last_uri}")
79
+ @logger.info("POST realizado \n")
80
+ request
81
+ end
82
+
83
+ def execute_get(params)
84
+ formated_params = initialize_request(params)
85
+ @logger.info('Realizando GET')
86
+ @logger.info("URI: #{params[:uri]}")
87
+ request = HTTParty.get(params[:uri], formated_params)
88
+ @logger.info("URI Final: #{request.request.last_uri}")
89
+ @logger.info("GET realizado \n")
90
+ request
91
+ end
92
+
93
+ def execute_patch(params)
94
+ formated_params = initialize_request(params)
95
+ @logger.info('Realizando PATCH')
96
+ @logger.info("URI: #{params[:uri]}")
97
+ request = HTTParty.patch(params[:uri], formated_params)
98
+ @logger.info("URI Final: #{request.request.last_uri}")
99
+ @logger.info("PATCH realizado \n")
100
+ request
101
+ end
102
+
103
+ def execute_put(params)
104
+ formated_params = initialize_request(params)
105
+ @logger.info('Realizando PUT')
106
+ @logger.info("URI: #{params[:uri]}")
107
+ request = HTTParty.put(params[:uri], formated_params)
108
+ @logger.info("URI Final: #{request.request.last_uri}")
109
+ @logger.info("PUT realizado \n")
110
+ request
111
+ end
112
+
113
+ def execute_delete(params)
114
+ formated_params = initialize_request(params)
115
+ @logger.info('Realizando DELETE')
116
+ @logger.info("URI: #{params[:uri]}")
117
+ request = HTTParty.put(params[:uri], formated_params)
118
+ @logger.info("URI Final: #{request.request.last_uri}")
119
+ @logger.info("DELETE realizado \n")
120
+ request
121
+ end
122
+ end
123
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QasDockGem
4
- VERSION = "0.1.26"
4
+ VERSION = '0.1.31'
5
5
  end
data/qas_dock_gem.gemspec CHANGED
@@ -1,25 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/qas_dock_gem/version"
3
+ require_relative 'lib/qas_dock_gem/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "qas_dock_gem"
7
- spec.version = QasDockGem::VERSION
8
- spec.authors = ["LucasKoritar23"]
9
- spec.email = ["lucas.gimenes23@gmail.com"]
6
+ spec.name = 'qas_dock_gem'
7
+ spec.version = QasDockGem::VERSION
8
+ spec.authors = ['LucasKoritar23']
9
+ spec.email = ['lucas.gimenes23@gmail.com']
10
10
 
11
- spec.summary = "A hello gem to the ruby world"
12
- spec.description = "I just created this gem to say hello for the ruby gems world, okay."
13
- spec.homepage = ""
14
- spec.license = "MIT"
11
+ spec.summary = 'A hello gem to the ruby world'
12
+ spec.description = 'I just created this gem to say hello for the ruby gems world, okay.'
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
15
 
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_development_dependency "bundler"
22
- spec.add_development_dependency "httparty"
23
- spec.add_development_dependency "logger"
24
- spec.add_development_dependency "aws-sdk-secretsmanager"
21
+ spec.add_development_dependency 'aws-sdk-secretsmanager'
22
+ spec.add_development_dependency 'bundler'
23
+ spec.add_development_dependency 'httparty'
24
+ spec.add_development_dependency 'logger'
25
+ spec.add_development_dependency 'redis'
25
26
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qas_dock_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - LucasKoritar23
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-06 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-secretsmanager
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +67,7 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: aws-sdk-secretsmanager
70
+ name: redis
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
@@ -79,7 +93,6 @@ files:
79
93
  - CHANGELOG.md
80
94
  - CODE_OF_CONDUCT.md
81
95
  - Gemfile
82
- - Gemfile.lock
83
96
  - LICENSE.txt
84
97
  - README.md
85
98
  - Rakefile
@@ -87,14 +100,15 @@ files:
87
100
  - bin/setup
88
101
  - lib/qas_dock_gem.rb
89
102
  - lib/qas_dock_gem/services/aws_services.rb
103
+ - lib/qas_dock_gem/services/redis_services.rb
104
+ - lib/qas_dock_gem/services/requests_api_services.rb
90
105
  - lib/qas_dock_gem/version.rb
91
- - qas_dock_gem-0.1.25.gem
92
106
  - qas_dock_gem.gemspec
93
107
  homepage: ''
94
108
  licenses:
95
109
  - MIT
96
110
  metadata: {}
97
- post_install_message:
111
+ post_install_message:
98
112
  rdoc_options: []
99
113
  require_paths:
100
114
  - lib
@@ -109,8 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
125
  requirements: []
112
- rubygems_version: 3.2.15
113
- signing_key:
126
+ rubygems_version: 3.1.2
127
+ signing_key:
114
128
  specification_version: 4
115
129
  summary: A hello gem to the ruby world
116
130
  test_files: []
data/Gemfile.lock DELETED
@@ -1,44 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- qas_dock_gem (0.1.14)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- aws-eventstream (1.1.1)
10
- aws-partitions (1.452.0)
11
- aws-sdk-core (3.114.0)
12
- aws-eventstream (~> 1, >= 1.0.2)
13
- aws-partitions (~> 1, >= 1.239.0)
14
- aws-sigv4 (~> 1.1)
15
- jmespath (~> 1.0)
16
- aws-sdk-secretsmanager (1.46.0)
17
- aws-sdk-core (~> 3, >= 3.112.0)
18
- aws-sigv4 (~> 1.1)
19
- aws-sigv4 (1.2.3)
20
- aws-eventstream (~> 1, >= 1.0.2)
21
- httparty (0.18.1)
22
- mime-types (~> 3.0)
23
- multi_xml (>= 0.5.2)
24
- jmespath (1.4.0)
25
- logger (1.4.3)
26
- mime-types (3.3.1)
27
- mime-types-data (~> 3.2015)
28
- mime-types-data (3.2021.0225)
29
- multi_xml (0.6.0)
30
- rake (13.0.3)
31
-
32
- PLATFORMS
33
- x86_64-linux-musl
34
-
35
- DEPENDENCIES
36
- aws-sdk-secretsmanager
37
- bundler
38
- httparty
39
- logger
40
- qas_dock_gem!
41
- rake (~> 13.0)
42
-
43
- BUNDLED WITH
44
- 2.2.17
Binary file