euax_gems_validator 1.0.0.beta6 → 1.0.0.beta7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9e53a25cef4582348781768424b3b8140454b59e9db5ac0a8757fb44bd08982
4
- data.tar.gz: cdd36ccd5b908a867c799f6c82efdf439ed85c43ef499322e73d7f8bd2e1a8a8
3
+ metadata.gz: 8fa647d4918bab84f941d1df091ce6d497b21f113447ccb47d3f0d207f08b0f4
4
+ data.tar.gz: 892b8c73f51920a13724df31a311d90b4b8ace907e91c0876a81d216b486c545
5
5
  SHA512:
6
- metadata.gz: 0fb369686fd42d822a4389beff584b1d0399ad3d11a5f8d8d91149a28c3308b25a23f55052c4ba7d5085ab44589995bacf98a2a63712d8fe6ce153d9a3abb904
7
- data.tar.gz: 28c23787f0453a17bd1feaf2aef3972259201d2a78df03ef03838c4f8864fb77f565eeb99d7ceeea276b2d30f574174137f4dd59045dabddf73cbc6de6ae5353
6
+ metadata.gz: 829ce53373930b9251c8c13219b64b30027de1d1b45e7990df8bd9cfae22e2f2af5e5a33b36d4b0f64c64c2fffc4ee31de88c6e38ff008e4006792904d1ec729
7
+ data.tar.gz: d34f390a6394e240657b232c4ecc367392ea8e6faf72b76117fef9c11891eb173103a0c20c1e0d8cadc94da3f87cec3e4fbc36ae6a806db9dc66fd5d0fc0d7e5
data/Gemfile.lock CHANGED
@@ -1,23 +1,77 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gems-validator (0.7.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
- gems-validator!
74
+ euax_gems_validator!
21
75
  rake (~> 13.0)
22
76
 
23
77
  BUNDLED WITH
@@ -1,7 +1,12 @@
1
1
  # frozen_string_literal: true
2
+ require 'dotenv'
3
+ Dotenv.load("#{Dir.pwd}/config/environments/.env.#{ENV['RAILS_ENV'] || 'development'}")
2
4
 
3
5
  module GemsValidator
4
- API_BASE_URL = "https://fece-2804-14c-f288-9d8e-6f0c-1c9a-fd64-a09b.sa.ngrok.io"
6
+ API_BASE_URL = ENV['API_BASE_URL']
7
+ API_VIEWER_USERNAME = ENV['API_VIEWER_USERNAME']
8
+ API_VIEWER_PASSWORD = ENV['API_VIEWER_PASSWORD']
9
+ p API_BASE_URL, API_VIEWER_USERNAME, API_VIEWER_PASSWORD
5
10
  class GemsService
6
11
  def initialize()
7
12
  @pwd = Dir.pwd
@@ -35,9 +40,9 @@ module GemsValidator
35
40
  def get_token
36
41
  uri = URI("#{GemsValidator::API_BASE_URL}/sessions/token")
37
42
  request = Net::HTTP::Post.new(uri)
38
- request.body = { username: 'viewer', password: 'viewer@euax' }.to_json
43
+ request.body = { username: API_VIEWER_USERNAME, password: API_VIEWER_PASSWORD }.to_json
39
44
  request['Content-Type'] = 'application/json'
40
-
45
+ # Remover o verify_mode quando for para prod
41
46
  Net::HTTP.start(uri.host, uri.port, :use_ssl => true, verify_mode: 0) do |http|
42
47
  response = http.request request
43
48
  response.header['access_token']
@@ -48,7 +53,7 @@ module GemsValidator
48
53
  uri = URI("#{GemsValidator::API_BASE_URL}/gems/formatted")
49
54
  begin
50
55
  access_token = get_token
51
-
56
+ # Remover o verify_mode quando for para prod
52
57
  Net::HTTP.start(uri.host, uri.port, :use_ssl => true, verify_mode: 0) do |http|
53
58
  request = Net::HTTP::Get.new uri
54
59
  request["Authorization"] = access_token
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GemsValidator
4
- VERSION = "1.0.0.beta6"
4
+ VERSION = "1.0.0.beta7"
5
5
  end
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.beta6
4
+ version: 1.0.0.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - henriquesml
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-23 00:00:00.000000000 Z
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