boa_vista 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -2
- data/lib/boa_vista/client.rb +2 -0
- data/lib/boa_vista/http.rb +2 -0
- data/lib/boa_vista/version.rb +1 -1
- data/lib/boa_vista.rb +6 -0
- data/spec/lib/boa_vista/version_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTY3NWZiM2IxM2I5MzJlYjNhMGE3NTM4NWVjMGZlNTdjZjQ0OTAzYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2E1M2ViZDIzNmMwYTQ5ZDVjNDEzNWVhMGQ1NWEyOTRhZTE3ZDIyNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmRlMjAzNmZmOTUwZmZkMmIzNzIyYWRjMzFjMjNjOTUzYzgxYWRlYTc1ZDFh
|
10
|
+
OWY2NjkwYjhmNjg3YmZjNjBjZjgyNGQ5NjRhY2JiZTkyNTgwNzFiMDA4YzY1
|
11
|
+
MWJiYzUxYWEzMDgxNDUzOGNlN2UwY2JhOWIzZGQxOTQyMWQ1Mjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzM3MDg0NWNhZWQxZTk3Nzg5ZGVhZmEzOWEzYjdhY2Q5YTRiNjk5YjQ2ZDA0
|
14
|
+
NzAwZDZkMTg3OTYxYmU5Y2Q4NGY3ZThlMTIyMDk0MDYzMDAwY2Q1ZDUzNjI2
|
15
|
+
NGVkOWIyYmNmMjUxZmM3ZjUzNGJhNDFkN2FiZGRhNjc0YjkxYTA=
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
boa_vista
|
2
2
|
=========
|
3
|
-
[![wercker status](https://app.wercker.com/status/08f2a5316ce97f6f16acd51e3c1d3aee/s "wercker status")](https://app.wercker.com/project/bykey/08f2a5316ce97f6f16acd51e3c1d3aee)
|
4
|
-
[![Code Climate](https://codeclimate.com/github/GabrielMalakias/boa_vista/badges/gpa.svg)](https://codeclimate.com/github/GabrielMalakias/boa_vista)
|
3
|
+
[![wercker status](https://app.wercker.com/status/08f2a5316ce97f6f16acd51e3c1d3aee/s "wercker status")](https://app.wercker.com/project/bykey/08f2a5316ce97f6f16acd51e3c1d3aee)[![Code Climate](https://codeclimate.com/github/GabrielMalakias/boa_vista/badges/gpa.svg)](https://codeclimate.com/github/GabrielMalakias/boa_vista)
|
5
4
|
=======
|
6
5
|
|
7
6
|
Library to do requests and generate layouts for BoaVista SCPC.
|
data/lib/boa_vista/client.rb
CHANGED
@@ -15,9 +15,11 @@ module BoaVista
|
|
15
15
|
response = nil
|
16
16
|
execute_with_timeout do
|
17
17
|
response = BoaVista::Http.new(uri(create_request)).call.body
|
18
|
+
BoaVista.log(:debug, "Response of request: #{response}")
|
18
19
|
end
|
19
20
|
@response.new(parsed_response(response)).read
|
20
21
|
rescue Timeout::Error
|
22
|
+
BoaVista.log(:debug, "Request is Timeout")
|
21
23
|
fail Errors::Timeout.new('timed out')
|
22
24
|
end
|
23
25
|
end
|
data/lib/boa_vista/http.rb
CHANGED
@@ -15,6 +15,7 @@ module BoaVista
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def execute_request_using_proxy
|
18
|
+
BoaVista.log(:debug, "Executing request with proxy #{proxy_uri.host}")
|
18
19
|
request = Net::HTTP::Get.new(@uri.path)
|
19
20
|
|
20
21
|
proxy.start(@uri.path, @uri.port) do |http|
|
@@ -23,6 +24,7 @@ module BoaVista
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def execute_request
|
27
|
+
BoaVista.log(:debug, "Executing request for uri: #{@uri}")
|
26
28
|
Net::HTTP.get_response(@uri)
|
27
29
|
end
|
28
30
|
|
data/lib/boa_vista/version.rb
CHANGED
data/lib/boa_vista.rb
CHANGED
@@ -53,6 +53,12 @@ module BoaVista
|
|
53
53
|
def self.root
|
54
54
|
File.expand_path '../..', __FILE__
|
55
55
|
end
|
56
|
+
|
57
|
+
def self.log(level, message)
|
58
|
+
@log ||= Logger.new(STDOUT)
|
59
|
+
@log.level = Logger::DEBUG
|
60
|
+
@log.send(level, "[BoaVista] - #{message}")
|
61
|
+
end
|
56
62
|
end
|
57
63
|
|
58
64
|
require 'boa_vista/request/default'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boa_vista
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Souza
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-03-
|
12
|
+
date: 2016-03-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|