euax_gems_validator 1.0.0.beta6 → 1.0.0.beta8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +56 -2
- data/lib/euax_gems_validator/gems-service.rb +11 -4
- data/lib/euax_gems_validator/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc337057a4c28736e89241a6074b176368467e8d8353b31fad422d36e073f541
|
4
|
+
data.tar.gz: 003f5d42e5f8d1b65b3e116939efa5ad5323ee294b836f2a951f19b22271d36d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a77965308fd80e4ddbbc69acf8a5436431a1a9ad9379076ead6ba185e2a7418653ea2bf52c2612d936ab06712368b30a0df25f7e48f46d64405656758b4b44f7
|
7
|
+
data.tar.gz: b7d626387dd941660f4952b95892586c055784b78a2a2508a74d4dd9add5ef1b726c0d769be2798f81fc76fd1373592269d903fc40d3640efe488947a5c00f98
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,77 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
euax_gems_validator (1.0.0.beta6)
|
5
|
+
dotenv-rails (= 2.8.1)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
10
|
+
actionpack (5.2.8.1)
|
11
|
+
actionview (= 5.2.8.1)
|
12
|
+
activesupport (= 5.2.8.1)
|
13
|
+
rack (~> 2.0, >= 2.0.8)
|
14
|
+
rack-test (>= 0.6.3)
|
15
|
+
rails-dom-testing (~> 2.0)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
+
actionview (5.2.8.1)
|
18
|
+
activesupport (= 5.2.8.1)
|
19
|
+
builder (~> 3.1)
|
20
|
+
erubi (~> 1.4)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
23
|
+
activesupport (5.2.8.1)
|
24
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
|
+
i18n (>= 0.7, < 2)
|
26
|
+
minitest (~> 5.1)
|
27
|
+
tzinfo (~> 1.1)
|
28
|
+
builder (3.2.4)
|
9
29
|
bundler-audit (0.9.1)
|
10
30
|
bundler (>= 1.2.0, < 3)
|
11
31
|
thor (~> 1.0)
|
32
|
+
concurrent-ruby (1.1.10)
|
33
|
+
crass (1.0.6)
|
34
|
+
dotenv (2.8.1)
|
35
|
+
dotenv-rails (2.8.1)
|
36
|
+
dotenv (= 2.8.1)
|
37
|
+
railties (>= 3.2)
|
38
|
+
erubi (1.11.0)
|
39
|
+
i18n (1.12.0)
|
40
|
+
concurrent-ruby (~> 1.0)
|
41
|
+
loofah (2.19.0)
|
42
|
+
crass (~> 1.0.2)
|
43
|
+
nokogiri (>= 1.5.9)
|
44
|
+
method_source (1.0.0)
|
45
|
+
mini_portile2 (2.4.0)
|
46
|
+
minitest (5.15.0)
|
47
|
+
nokogiri (1.10.10)
|
48
|
+
mini_portile2 (~> 2.4.0)
|
49
|
+
rack (2.2.4)
|
50
|
+
rack-test (2.0.2)
|
51
|
+
rack (>= 1.3)
|
52
|
+
rails-dom-testing (2.0.3)
|
53
|
+
activesupport (>= 4.2.0)
|
54
|
+
nokogiri (>= 1.6)
|
55
|
+
rails-html-sanitizer (1.4.3)
|
56
|
+
loofah (~> 2.3)
|
57
|
+
railties (5.2.8.1)
|
58
|
+
actionpack (= 5.2.8.1)
|
59
|
+
activesupport (= 5.2.8.1)
|
60
|
+
method_source
|
61
|
+
rake (>= 0.8.7)
|
62
|
+
thor (>= 0.19.0, < 2.0)
|
12
63
|
rake (13.0.6)
|
13
64
|
thor (1.2.1)
|
65
|
+
thread_safe (0.3.6)
|
66
|
+
tzinfo (1.2.10)
|
67
|
+
thread_safe (~> 0.1)
|
14
68
|
|
15
69
|
PLATFORMS
|
16
70
|
ruby
|
17
71
|
|
18
72
|
DEPENDENCIES
|
19
73
|
bundler-audit
|
20
|
-
|
74
|
+
euax_gems_validator!
|
21
75
|
rake (~> 13.0)
|
22
76
|
|
23
77
|
BUNDLED WITH
|
@@ -1,7 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require 'dotenv'
|
3
|
+
p ENV['RAILS_ENV']
|
4
|
+
p "#{Dir.pwd}/config/environments/.env.#{ENV['RAILS_ENV'] || 'development'}"
|
5
|
+
Dotenv.load("#{Dir.pwd}/config/environments/.env.#{ENV['RAILS_ENV'] || 'development'}")
|
2
6
|
|
3
7
|
module GemsValidator
|
4
|
-
API_BASE_URL =
|
8
|
+
API_BASE_URL = ENV['API_BASE_URL']
|
9
|
+
API_VIEWER_USERNAME = ENV['API_VIEWER_USERNAME']
|
10
|
+
API_VIEWER_PASSWORD = ENV['API_VIEWER_PASSWORD']
|
11
|
+
p API_BASE_URL, API_VIEWER_USERNAME, API_VIEWER_PASSWORD
|
5
12
|
class GemsService
|
6
13
|
def initialize()
|
7
14
|
@pwd = Dir.pwd
|
@@ -35,9 +42,9 @@ module GemsValidator
|
|
35
42
|
def get_token
|
36
43
|
uri = URI("#{GemsValidator::API_BASE_URL}/sessions/token")
|
37
44
|
request = Net::HTTP::Post.new(uri)
|
38
|
-
request.body = { username:
|
45
|
+
request.body = { username: API_VIEWER_USERNAME, password: API_VIEWER_PASSWORD }.to_json
|
39
46
|
request['Content-Type'] = 'application/json'
|
40
|
-
|
47
|
+
# Remover o verify_mode quando for para prod
|
41
48
|
Net::HTTP.start(uri.host, uri.port, :use_ssl => true, verify_mode: 0) do |http|
|
42
49
|
response = http.request request
|
43
50
|
response.header['access_token']
|
@@ -48,7 +55,7 @@ module GemsValidator
|
|
48
55
|
uri = URI("#{GemsValidator::API_BASE_URL}/gems/formatted")
|
49
56
|
begin
|
50
57
|
access_token = get_token
|
51
|
-
|
58
|
+
# Remover o verify_mode quando for para prod
|
52
59
|
Net::HTTP.start(uri.host, uri.port, :use_ssl => true, verify_mode: 0) do |http|
|
53
60
|
request = Net::HTTP::Get.new uri
|
54
61
|
request["Authorization"] = access_token
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: euax_gems_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- henriquesml
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
12
|
-
dependencies:
|
11
|
+
date: 2022-12-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dotenv-rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.8.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.8.1
|
13
27
|
description: euax_gems_validator
|
14
28
|
email:
|
15
29
|
- henrique_schmeller@hotmail.com
|