arcus 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/arcus +3 -1
- data/lib/arcus/api.rb +6 -4
- data/lib/arcus/cli.rb +2 -0
- data/lib/arcus/version.rb +1 -1
- metadata +2 -2
data/bin/arcus
CHANGED
@@ -42,7 +42,9 @@ arcus = Arcus::Cli.new(
|
|
42
42
|
:api_uri => URI($settings["api_uri"]),
|
43
43
|
:default_response => $settings["default_response"],
|
44
44
|
:api_key => $settings["api_key"],
|
45
|
-
:api_secret => $settings["api_secret"]
|
45
|
+
:api_secret => $settings["api_secret"],
|
46
|
+
:read_timeout => $settings["http_read_timeout"] || 60,
|
47
|
+
:open_timeout => $settings["http_open_timeout"] || 10,
|
46
48
|
)
|
47
49
|
|
48
50
|
arcus.run
|
data/lib/arcus/api.rb
CHANGED
@@ -25,12 +25,12 @@ module Arcus
|
|
25
25
|
@@targets = []
|
26
26
|
|
27
27
|
class Settings
|
28
|
-
attr_accessor :api_uri, :api_xml, :api_key, :api_secret, :default_response, :verbose
|
28
|
+
attr_accessor :api_uri, :api_xml, :api_key, :api_secret, :default_response, :verbose, :open_timeout, :read_timeout
|
29
29
|
|
30
30
|
def initialize
|
31
31
|
@api_xml = File.dirname(__FILE__) + "/commands.xml"
|
32
32
|
@default_response = "json"
|
33
|
-
@verbose = false
|
33
|
+
@verbose = false
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -57,6 +57,8 @@ module Arcus
|
|
57
57
|
@api_uri = Api.settings.api_uri
|
58
58
|
@api_key = Api.settings.api_key
|
59
59
|
@api_secret = Api.settings.api_secret
|
60
|
+
@read_timeout = Api.settings.read_timeout
|
61
|
+
@open_timeout = Api.settings.open_timeout
|
60
62
|
@callbacks = callbacks
|
61
63
|
end
|
62
64
|
|
@@ -95,8 +97,8 @@ module Arcus
|
|
95
97
|
"xml"
|
96
98
|
end
|
97
99
|
http = Net::HTTP.new(@api_uri.host, @api_uri.port)
|
98
|
-
http.read_timeout =
|
99
|
-
http.open_timeout =
|
100
|
+
http.read_timeout = @read_timeout
|
101
|
+
http.open_timeout = @open_timeout
|
100
102
|
|
101
103
|
if @api_uri.scheme == "https"
|
102
104
|
http.use_ssl = true
|
data/lib/arcus/cli.rb
CHANGED
@@ -13,6 +13,8 @@ module Arcus
|
|
13
13
|
c.api_key = options[:api_key] if options[:api_key]
|
14
14
|
c.api_secret = options[:api_secret] if options[:api_secret]
|
15
15
|
c.default_response = options[:default_response] if options[:default_response]
|
16
|
+
c.open_timeout = options[:open_timeout] || 10
|
17
|
+
c.read_timeout = options[:read_timeout] || 60
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
data/lib/arcus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arcus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|