ares.rb 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/README.md +1 -0
- data/lib/ares.rb +10 -0
- data/lib/ares/http.rb +3 -3
- data/lib/ares/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ce4d2cb5c9a8dc17f46448da5399032b727ba8b
|
4
|
+
data.tar.gz: 9834d57362825f7bb56f20e18813263e9d81a5ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 769acc26c349b9478524f3340b593cc52aa7ac7df27d08c4ca4a7cd39bb0ed85bab7142f6e24108784d3a0b8ad44fc4de0231beeed990835ad9de3ed8a33c8fd
|
7
|
+
data.tar.gz: a3179163c1d0aa082d48131207938754394d8a6cae31f7700082032c80319b295d4a6351486ba99a7dc604b123ae2fecc6beeef8c62c39b6994fe21df59790f1
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Ares
|
2
2
|
|
3
|
+
[![Inline docs](http://inch-ci.org/github/ucetnictvi-on-line/ares.rb.svg?branch=master)](http://inch-ci.org/github/ucetnictvi-on-line/ares.rb)
|
3
4
|
[![Gem Version](https://badge.fury.io/rb/ares.rb.png)](http://badge.fury.io/rb/ares.rb)
|
4
5
|
[![Build Status](https://travis-ci.org/ucetnictvi-on-line/ares.rb.png?branch=master)](https://travis-ci.org/ucetnictvi-on-line/ares.rb)
|
5
6
|
[![Dependency Status](https://gemnasium.com/ucetnictvi-on-line/ares.rb.svg)](https://gemnasium.com/ucetnictvi-on-line/ares.rb)
|
data/lib/ares.rb
CHANGED
@@ -7,6 +7,16 @@ require 'ares/client'
|
|
7
7
|
require 'ico-validator'
|
8
8
|
|
9
9
|
module Ares
|
10
|
+
# Default timeout for Ares requests
|
11
|
+
DEFAULT_TIMEOUT = 5
|
12
|
+
|
13
|
+
# Timout for Ares requests
|
14
|
+
# Example:
|
15
|
+
# Ares.timeout = 4
|
16
|
+
# data = Ares.standard(ico: data.ico)
|
17
|
+
mattr_accessor :timeout
|
18
|
+
self.timeout = DEFAULT_TIMEOUT
|
19
|
+
|
10
20
|
class << self
|
11
21
|
include Ares::Logging
|
12
22
|
|
data/lib/ares/http.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Ares
|
2
2
|
module Http
|
3
3
|
def get(url, params = {})
|
4
|
-
response = HTTParty.get(url, query: params)
|
4
|
+
response = HTTParty.get(url, query: params, timeout: Ares.timeout)
|
5
5
|
response.body
|
6
6
|
end
|
7
7
|
|
8
8
|
def post(url, params = {})
|
9
|
-
response = HTTParty.post(url, query: params)
|
9
|
+
response = HTTParty.post(url, query: params, timeout: Ares.timeout)
|
10
10
|
response.body
|
11
11
|
end
|
12
12
|
end
|
13
|
-
end
|
13
|
+
end
|
data/lib/ares/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ares.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondřej Svoboda
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ico-validator
|