ihunter-whatcounts 0.3.5 → 0.3.6
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.
- data/lib/whatcounts.rb +1 -1
- data/lib/whatcounts/http_client.rb +2 -1
- data/lib/whatcounts/one_off_message.rb +7 -4
- metadata +3 -2
data/lib/whatcounts.rb
CHANGED
@@ -28,7 +28,8 @@ module WhatCounts
|
|
28
28
|
raise InvalidConfiguration,"Invalid WhatCounts configuration, are you sure it was configured?" unless @config
|
29
29
|
url = [@config.api_url,"?","c=#{command}&",@config.to_param_string,"&",requestable.to_param_string].join
|
30
30
|
res = Curl::Easy.perform(url) do |easy|
|
31
|
-
easy.
|
31
|
+
easy.connect_timeout = 10
|
32
|
+
easy.timeout = 30
|
32
33
|
end
|
33
34
|
WhatCounts::Response.new(url,res.body_str)
|
34
35
|
end
|
@@ -39,13 +39,16 @@ module WhatCounts
|
|
39
39
|
if self.data.kind_of? String
|
40
40
|
pairs << "data=#{CGI.escape(self.data)}"
|
41
41
|
elsif self.data.kind_of? Hash
|
42
|
-
data_pairs = self.data.inject([[],[]])
|
43
|
-
|
44
|
-
|
42
|
+
data_pairs = self.data.inject([[],[]]) do |acc,(k,v)|
|
43
|
+
acc[0] << CGI.escape(k)
|
44
|
+
acc[1] << CGI.escape(v)
|
45
|
+
acc
|
46
|
+
end
|
47
|
+
pairs << "data=#{data_pairs[0].join(',')}^#{data_pairs[1].join(',')}"
|
45
48
|
else
|
46
49
|
# TODO i duno what to do here, probably error? Maybe not since the param isn't required
|
47
50
|
end
|
48
|
-
end
|
51
|
+
end
|
49
52
|
pairs
|
50
53
|
end.join("&")
|
51
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ihunter-whatcounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Hunter
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/whatcounts/rails/mailer.rb
|
51
51
|
has_rdoc: false
|
52
52
|
homepage: http://github.com/ihunter/whatcounts
|
53
|
+
licenses:
|
53
54
|
post_install_message: PostInstall.txt
|
54
55
|
rdoc_options:
|
55
56
|
- --main
|
@@ -71,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
72
|
requirements: []
|
72
73
|
|
73
74
|
rubyforge_project: whatcounts
|
74
|
-
rubygems_version: 1.
|
75
|
+
rubygems_version: 1.3.5
|
75
76
|
signing_key:
|
76
77
|
specification_version: 3
|
77
78
|
summary: WhatCounts HTTP API interface
|