kontagent 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +0 -5
- data/Rakefile +1 -1
- data/kontagent.gemspec +1 -1
- data/lib/kontagent.rb +3 -3
- data/spec/kontagent_spec.rb +4 -11
- metadata +3 -3
data/Manifest
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('kontagent', '0.0.
|
5
|
+
Echoe.new('kontagent', '0.0.3') do |p|
|
6
6
|
p.description = "A gem that provides basic integration with Kontagent's REST API"
|
7
7
|
p.url = "http://github.com/gamesthatgive/kontagent"
|
8
8
|
p.author = "Kristofer Goss"
|
data/kontagent.gemspec
CHANGED
data/lib/kontagent.rb
CHANGED
@@ -31,11 +31,11 @@ module Kontagent
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.api_url
|
34
|
-
@api_url || raise "No configuration provided for 'api_url'"
|
34
|
+
@api_url || (raise "No configuration provided for 'api_url'")
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.api_key
|
38
|
-
@api_key || raise "No configuration provided for 'api_key'"
|
38
|
+
@api_key || (raise "No configuration provided for 'api_key'")
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.configuration=(options)
|
@@ -48,7 +48,7 @@ module Kontagent
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def self.create_tracking_tag
|
51
|
-
tag = UUID.random_create.to_s.gsub("-", "")
|
51
|
+
tag = UUIDTools::UUID.random_create.to_s.gsub("-", "")
|
52
52
|
yield tag if block_given?
|
53
53
|
tag
|
54
54
|
end
|
data/spec/kontagent_spec.rb
CHANGED
@@ -2,25 +2,18 @@ require "kontagent"
|
|
2
2
|
|
3
3
|
describe Kontagent do
|
4
4
|
before(:each) do
|
5
|
-
Kontagent.
|
5
|
+
Kontagent.configuration = { :api_url => "http://kontagent.com/api/v1", :api_key => "12345" }
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should initialize" do
|
9
|
-
Kontagent.
|
9
|
+
Kontagent.api_url.should == "http://kontagent.com/api/v1"
|
10
|
+
Kontagent.api_key.should == "12345"
|
10
11
|
Kontagent.base_url.should == "http://kontagent.com/api/v1/12345"
|
11
12
|
end
|
12
13
|
|
13
|
-
it "should not initialize without an API key" do
|
14
|
-
lambda { Kontagent.initialize!("api_url" => "http://kontagent.com/api/v1", "ab_url" => "http://kontagent.com") }.should raise_error
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should not initialize without an A/B url" do
|
18
|
-
lambda { Kontagent.initialize!("api_url" => "http://kontagent.com/api/v1", "api_key" => "12345") }.should raise_error
|
19
|
-
end
|
20
|
-
|
21
14
|
context "when adding an application" do
|
22
15
|
before(:each) do
|
23
|
-
@tracking_tag = UUID.random_create.to_s.gsub("-", "")
|
16
|
+
@tracking_tag = UUIDTools::UUID.random_create.to_s.gsub("-", "")
|
24
17
|
end
|
25
18
|
|
26
19
|
it "should record the user id" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kontagent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kristofer Goss
|