ejabberd_rest 0.0.11 → 0.1.0

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: de9a855ec18831a5f89b0c7aa55f8b2d38a4adea
4
- data.tar.gz: 0044b5414bf4f9ebe7001d90318748da19707b81
3
+ metadata.gz: 9f33078868544e0a3728ca9b0a465ebf3d5d3f60
4
+ data.tar.gz: d791738f39f02a94f38bc8c53c49976d055bc504
5
5
  SHA512:
6
- metadata.gz: a3a8cb4a53b518055e10dc8ba9ec47b1618064f50939a29eb8a8bcd6e72d5411686414a81d12665b343fd14a4e0e081189263ad64c86b1a31e94f5dc72ff439b
7
- data.tar.gz: 1806b55b6eca62393768c6f982e747605783d4a610700a408004e9a80e55390ff602245c28c08028a0637b35e105fd84179d989a2431f96a53237f83ad6dbc4c
6
+ metadata.gz: dc6f4dd2f95d7357378592ba4ae9a69389688cdc682cd1253f10202ffa80adaa8bc77a7d7d1fca9208a814ec89675315eea09dbeaf0a1b72d9f0b765ea73b6da
7
+ data.tar.gz: 65088cbbb8011fa6257d5161b1f2654d3d4e97fcf1ab982288b8dadbe03aa35b9ca9efdec08aac5002b3e093518043e6bfcd693ad6a8de0bdb608a370b9565e7
@@ -7,16 +7,15 @@ module EjabberdRest
7
7
 
8
8
  DEFAULT_MOD_REST_URL = "http://localhost:5285"
9
9
 
10
- def initialize(attributes={})
11
- mod_rest_url = attributes[:url] || DEFAULT_MOD_REST_URL
12
- debug = attributes[:debug] || false
13
- max_concurrency = attributes[:max_concurrency] || 100
10
+ def initialize(url=DEFAULT_MOD_REST_URL, options={})
11
+ manager = Typhoeus::Hydra.new(max_concurrency: options[:max_concurrency] || 25)
14
12
 
15
- manager = Typhoeus::Hydra.new(max_concurrency: 100)
16
- @connection = Faraday.new(mod_rest_url, parallel_manager: manager) do |builder|
13
+ @connection = Faraday.new(url, parallel_manager: manager) do |builder|
17
14
  builder.request :url_encoded
18
- builder.response :logger if debug
15
+ builder.response :logger if options[:debug]
19
16
  builder.adapter :typhoeus
17
+ builder.options.timeout = options[:timeout] || 3
18
+ builder.options.open_timeout = options[:open_timeout] || 1
20
19
  end
21
20
  end
22
21
 
@@ -145,13 +144,11 @@ module EjabberdRest
145
144
  end
146
145
 
147
146
 
148
-
149
147
  private
150
148
 
151
149
  def post(path, options={})
152
150
  @connection.post do |req|
153
151
  req.url path
154
- req.options[:timeout] = 60
155
152
  req.body = options[:body] if options[:body]
156
153
  end
157
154
  end
@@ -1,3 +1,3 @@
1
1
  module EjabberdRest
2
- VERSION = "0.0.11"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ejabberd_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fajar Budiprasetyo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-14 00:00:00.000000000 Z
11
+ date: 2014-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.2.0.rc.1
120
+ rubygems_version: 2.2.2
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Ruby interface for ejabberd mod_rest.