korboard 0.0.3 → 0.0.4

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/Readme.md CHANGED
@@ -0,0 +1,30 @@
1
+ Readme
2
+ ======
3
+
4
+
5
+ Configuration
6
+ -------------
7
+
8
+ This gem is used for interfacing with the Korboard API from Rails (its trivial to set it up without rails, just remove the config options)
9
+
10
+ Configuration is in application.rb (or an initializer )
11
+
12
+ YOUR_APPLICATION_NAME::Application.config.korboard.api_token ="api_secret_for_product"
13
+ YOUR_APPLICATION_NAME::Application.config.korboard.iteration_number = 1 (your iteration number)
14
+
15
+ Example Usage
16
+ -------------
17
+
18
+ call
19
+
20
+ Korboard::Client.new.record_visit(session[:session_id])
21
+
22
+ when you record an initial visit from a user
23
+
24
+ and
25
+
26
+ Korboard::Client.new.record_signup(user.id,session[:session_id])
27
+
28
+ to record a signup
29
+
30
+
@@ -27,6 +27,11 @@ class Korboard::Client
27
27
  record :visit,@iteration_number,identifier,options
28
28
  end
29
29
 
30
+ def record_invite identifier,options={ }
31
+ options.merge! :user_profile => { :session_id => identifier }
32
+ record :invite,@iteration_number,identifier,options
33
+ end
34
+
30
35
 
31
36
 
32
37
  def record metric ,iteration_number, identifier, options ={ }
@@ -35,11 +40,15 @@ class Korboard::Client
35
40
 
36
41
  path = "/v1.1/#{metric.to_s.pluralize}?token=#{@token}"
37
42
 
38
- resp, data = @http.post(path, data.to_json, @headers)
39
-
40
- print_response(resp,data) unless resp.code.to_i == 201
41
- return resp.code.to_i == 201
42
-
43
+ #wrap in a timeout so we don't slow shit down
44
+ Timeout::timeout(1){
45
+ resp, data = @http.post(path, data.to_json, @headers)
46
+ print_response(resp,data) unless resp.code.to_i == 201
47
+ return resp.code.to_i == 201
48
+ }
49
+ return false
50
+ rescue => e
51
+ puts e.message
43
52
  end
44
53
 
45
54
 
@@ -1,3 +1,3 @@
1
1
  module Korboard
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: korboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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-03-08 00:00:00.000000000Z
12
+ date: 2012-03-31 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: This gem allows developers to access the Korboard API from their app
15
15
  using Ruby