teamforge 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/teamforge/ctfsoap.rb +8 -1
- data/lib/teamforge/tfsoaprequest.rb +2 -2
- data/lib/teamforge/version.rb +1 -1
- data/lib/teamforge.rb +10 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a49fef423589b8104746311cff5add6da865341f
|
4
|
+
data.tar.gz: f625b972ce4155700e07d6aaaee618f45066bfdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c26e3f67ff90b99e8796393a58ff4afa2d1618def010b41a4169df93a0563ce70a02b493cfe394cf1c26693c5c86372fcc50e60f5022a239b0e14f78558067bc
|
7
|
+
data.tar.gz: 0ad08cca0c0942f3d31055c38c674dc283814bc4ecbff2140a630b4e4be3a7090f1272b1dc4fb72e4c7233be541354e474b683069c6e9065c6c840cab6cc0bac
|
data/lib/teamforge/ctfsoap.rb
CHANGED
@@ -16,7 +16,7 @@ module TeamForge
|
|
16
16
|
# response: The response message name that is expected from a successful call to the CTF server. A symbol is expected
|
17
17
|
# E.g. :loginResponse
|
18
18
|
# proxy: If a proxy server is being used to connect to the the CTF server it should be specified. It can be left blank.
|
19
|
-
def self.request(req_msg, server=nil, ssl=nil, proxy=nil)
|
19
|
+
def self.request(req_msg, server=nil, timeout=nil, ssl=nil, proxy=nil)
|
20
20
|
return unless req_msg.kind_of? Struct
|
21
21
|
|
22
22
|
server ||= @server
|
@@ -27,6 +27,9 @@ module TeamForge
|
|
27
27
|
@server = format_url(server, ssl)
|
28
28
|
end
|
29
29
|
|
30
|
+
timeout = timeout.to_i>0 ? timeout.to_i : TeamForge::DEFAULT_TIMEOUT
|
31
|
+
|
32
|
+
|
30
33
|
proxy ||= @proxy
|
31
34
|
|
32
35
|
@endpoint, method = req_msg.class.to_s.split("::").pop(2)
|
@@ -51,6 +54,10 @@ module TeamForge
|
|
51
54
|
# The client from Savon is instantiated with the proper namespace, the endpoint for the request, and SSL verification (from HTTPI) turned off
|
52
55
|
client = Savon::Client.new {wsdl.namespace = SERVICE_NAMESPACE; wsdl.endpoint = fq_path; http.auth.ssl.verify_mode= :none }
|
53
56
|
|
57
|
+
#set timeout for connection and response
|
58
|
+
client.http.open_timeout=timeout
|
59
|
+
client.http.read_timeout=timeout
|
60
|
+
|
54
61
|
# proxy support in case CTF needs to be accessed through a proxy
|
55
62
|
if proxy
|
56
63
|
client.http.proxy = @proxy
|
@@ -9,8 +9,8 @@ module TeamForge
|
|
9
9
|
# Calling this method 'request' on any Soap Message Struct in teamforge will send it to the server specified.
|
10
10
|
# The TeamForge module will remember the TeamForge server specified so it doesn't have to be entered each time.
|
11
11
|
######
|
12
|
-
def request(server=nil, ssl=nil, proxy=nil)
|
13
|
-
TeamForge.request(self, server, ssl, proxy)
|
12
|
+
def request(server=nil, timeout=nil, ssl=nil, proxy=nil)
|
13
|
+
TeamForge.request(self, server, timeout ,ssl, proxy)
|
14
14
|
end
|
15
15
|
|
16
16
|
|
data/lib/teamforge/version.rb
CHANGED
data/lib/teamforge.rb
CHANGED
@@ -15,6 +15,7 @@ module TeamForge
|
|
15
15
|
TYPE_NAMESPACE="http://schema.open.collab.net/sfee50/soap60/type"
|
16
16
|
SOAP_NAMESPACE="http://schemas.xmlsoap.org/soap/encoding/"
|
17
17
|
SERVICE_PATH="/ce-soap60/services/"
|
18
|
+
DEFAULT_TIMEOUT = 60
|
18
19
|
|
19
20
|
|
20
21
|
autoload :TrackerApp, "teamforge/services/trackerapp"
|
@@ -33,6 +34,15 @@ module TeamForge
|
|
33
34
|
autoload :PageApp, "teamforge/services/pageapp"
|
34
35
|
autoload :NewsApp, "teamforge/services/newsapp"
|
35
36
|
|
37
|
+
def self.timeout
|
38
|
+
@timeout
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.timeout=(timeout)
|
42
|
+
t = timeout.to_i
|
43
|
+
@timeout = t>0 ? t : DEFAULT_TIMEOUT
|
44
|
+
end
|
45
|
+
|
36
46
|
def self.proxy
|
37
47
|
@proxy
|
38
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamforge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Wolf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -79,3 +79,4 @@ signing_key:
|
|
79
79
|
specification_version: 4
|
80
80
|
summary: CollabNet TeamForge
|
81
81
|
test_files: []
|
82
|
+
has_rdoc: true
|