rubango 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/lib/totango/client.rb +14 -6
- data/lib/totango/config.rb +2 -1
- data/lib/totango/version.rb +1 -1
- metadata +35 -56
data/README.md
CHANGED
@@ -32,6 +32,10 @@ You now interact with `Totango.client` to do your bidding:
|
|
32
32
|
:module => "Current module"
|
33
33
|
})
|
34
34
|
|
35
|
+
By default, Totango will create a new thread to make the remote calls. If you already track the events using a background job, you should use synchronous calls. To turn synchronous calls on, use `Totango::Config`:
|
36
|
+
|
37
|
+
Totango::Config[:synchronous] = true
|
38
|
+
|
35
39
|
There is also the option for integration with different ruby frameworks.
|
36
40
|
|
37
41
|
### Rails
|
data/lib/totango/client.rb
CHANGED
@@ -33,12 +33,10 @@ module Totango
|
|
33
33
|
url = build_url(data)
|
34
34
|
|
35
35
|
if Totango.on?
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
STDERR.puts "[Totango] ERROR making call to Totango: #{e.class} ~> #{e.message}"
|
41
|
-
end
|
36
|
+
if Config[:synchronous]
|
37
|
+
make_request(url)
|
38
|
+
else
|
39
|
+
Thread.new { make_request(url) }
|
42
40
|
end
|
43
41
|
else
|
44
42
|
unless Config[:suppress_output]
|
@@ -50,6 +48,16 @@ module Totango
|
|
50
48
|
def build_url(data)
|
51
49
|
[BASE_URI, @srv_id, "&", ArgParser.parse(data).to_params].join
|
52
50
|
end
|
51
|
+
|
52
|
+
def make_request(url)
|
53
|
+
begin
|
54
|
+
open(url)
|
55
|
+
true
|
56
|
+
rescue => e
|
57
|
+
$stderr.puts "[Totango] ERROR making call to Totango: #{e.class} ~> #{e.message}"
|
58
|
+
false
|
59
|
+
end
|
60
|
+
end
|
53
61
|
end
|
54
62
|
end
|
55
63
|
|
data/lib/totango/config.rb
CHANGED
data/lib/totango/version.rb
CHANGED
metadata
CHANGED
@@ -1,91 +1,70 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubango
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
version: 0.1.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- jonah honeyman
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: rspec
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &8063460 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
31
22
|
type: :development
|
32
|
-
|
33
|
-
|
34
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *8063460
|
25
|
+
description: Enables easy integration of Totango tracking, with options for different
|
26
|
+
ruby web frameworks
|
27
|
+
email:
|
35
28
|
- jonah@honeyman.org
|
36
29
|
executables: []
|
37
|
-
|
38
30
|
extensions: []
|
39
|
-
|
40
31
|
extra_rdoc_files: []
|
41
|
-
|
42
|
-
files:
|
32
|
+
files:
|
43
33
|
- lib/totango/version.rb
|
44
|
-
- lib/totango/arg_parser.rb
|
45
|
-
- lib/totango/client.rb
|
46
|
-
- lib/totango/resource.rb
|
47
|
-
- lib/totango/adapters/base.rb
|
48
34
|
- lib/totango/adapters/rails.rb
|
35
|
+
- lib/totango/adapters/base.rb
|
49
36
|
- lib/totango/adapters/merb.rb
|
50
|
-
- lib/totango/adapter.rb
|
51
37
|
- lib/totango/tracker.rb
|
52
38
|
- lib/totango/config.rb
|
39
|
+
- lib/totango/adapter.rb
|
40
|
+
- lib/totango/arg_parser.rb
|
41
|
+
- lib/totango/resource.rb
|
42
|
+
- lib/totango/client.rb
|
53
43
|
- lib/totango.rb
|
54
44
|
- LICENSE
|
55
45
|
- README.md
|
56
|
-
has_rdoc: true
|
57
46
|
homepage: https://github.com/jonuts/rubango
|
58
47
|
licenses: []
|
59
|
-
|
60
48
|
post_install_message:
|
61
49
|
rdoc_options: []
|
62
|
-
|
63
|
-
require_paths:
|
50
|
+
require_paths:
|
64
51
|
- lib
|
65
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
53
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
71
|
-
|
72
|
-
version: "0"
|
73
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
59
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
segments:
|
79
|
-
- 1
|
80
|
-
- 3
|
81
|
-
- 6
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
82
63
|
version: 1.3.6
|
83
64
|
requirements: []
|
84
|
-
|
85
65
|
rubyforge_project: rubango
|
86
|
-
rubygems_version: 1.
|
66
|
+
rubygems_version: 1.8.10
|
87
67
|
signing_key:
|
88
68
|
specification_version: 3
|
89
69
|
summary: API wrapper for Totango tracking integration
|
90
70
|
test_files: []
|
91
|
-
|