ares.rb 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 5f63b8df34b8310ba2ef1abf50ef52eeb482ef70
4
- data.tar.gz: a148150c8295ce9c06b2eeb6a148ebfbbead479a
3
+ metadata.gz: 3ce4d2cb5c9a8dc17f46448da5399032b727ba8b
4
+ data.tar.gz: 9834d57362825f7bb56f20e18813263e9d81a5ce
5
5
  SHA512:
6
- metadata.gz: 68469c5c283ed21ae31cb75647160f13e3f34e08c15b16da6fa2e866cd966d7dd02c0c8f80bcea74cb509dbaf4efd8404c22bcde08905b4d3575288421df2237
7
- data.tar.gz: 65730dbe0985777b75ed186fc25d1f766dde6924b9d1a987e42b3dbcb623db8f17baac53a4086daf95afbb1a67ee74f1eaa186e8b3150add94f8feadfc002505
6
+ metadata.gz: 769acc26c349b9478524f3340b593cc52aa7ac7df27d08c4ca4a7cd39bb0ed85bab7142f6e24108784d3a0b8ad44fc4de0231beeed990835ad9de3ed8a33c8fd
7
+ data.tar.gz: a3179163c1d0aa082d48131207938754394d8a6cae31f7700082032c80319b295d4a6351486ba99a7dc604b123ae2fecc6beeef8c62c39b6994fe21df59790f1
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
4
- - 2.2.1
3
+ - 2.2.3
4
+ - 2.1.7
5
5
  - 2.0.0
6
6
  script: bundle exec rspec
7
7
  addons:
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)
@@ -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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ares
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
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.0
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-07-31 00:00:00.000000000 Z
12
+ date: 2015-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ico-validator