queenbee 0.0.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -2
- data/lib/queenbee.rb +1 -0
- data/lib/queenbee/event.rb +5 -0
- data/lib/queenbee/metrics.rb +0 -1
- data/lib/queenbee/queenbee_object.rb +1 -2
- data/lib/queenbee/version.rb +1 -1
- data/test/queenbee/event_test.rb +31 -0
- data/test/test_helper.rb +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f8b3222dfd546ac5d3570508ae022ad620625e6
|
4
|
+
data.tar.gz: 2c78a8f764858af2dc8e2403cd68b17b69c43c5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aca9eee132dfa8fd36092761f9cb30a5c16e504fbbbd107d50d831ec3b3e26a0d656b62b3c37b94429458c2f7d76d05ede12252ea8e09180442b63731304652
|
7
|
+
data.tar.gz: 074c1abe26c21d4debe0cced5c87c662587578bcf1ede5b8521a6060047a63be180c3bfa39e1768b765b9a7324b7984e397b088207e6e428371e3357eff86c67
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ In your app
|
|
28
28
|
Queenbee.token = ENV['QUEENBEE_TOKEN']
|
29
29
|
```
|
30
30
|
|
31
|
-
2. Send order
|
31
|
+
2. Send order/event
|
32
32
|
|
33
33
|
```ruby
|
34
34
|
Queenbee::Order.create(
|
@@ -45,7 +45,7 @@ Queenbee::Order.create(
|
|
45
45
|
)
|
46
46
|
```
|
47
47
|
|
48
|
-
Optional attributes are avaiable for subscription-type such as:
|
48
|
+
Optional attributes are avaiable for subscription-type application such as:
|
49
49
|
|
50
50
|
```ruby
|
51
51
|
subscribed_at: '2015-05-05 20:13:45',
|
@@ -78,6 +78,8 @@ rake test
|
|
78
78
|
|
79
79
|
## Complete list of parameters
|
80
80
|
|
81
|
+
### Order
|
82
|
+
|
81
83
|
- uid (string, must be unique per application)
|
82
84
|
- date (datetime. default to record creation timestamp. Should be used to send historic data)
|
83
85
|
- currency (string. i.e. 'CAD')
|
@@ -96,3 +98,10 @@ rake test
|
|
96
98
|
- subscribed_at (datetime. For recurring order)
|
97
99
|
- unsubscribed_at (datetime. For recurring order)
|
98
100
|
- fees (decimal)
|
101
|
+
|
102
|
+
### Event
|
103
|
+
|
104
|
+
- date (datetime. required. i.e. 2014-07-01 14:50:28)
|
105
|
+
- status: (string. required)
|
106
|
+
- message: (text. required)
|
107
|
+
- metadata: (hash. optional)
|
data/lib/queenbee.rb
CHANGED
data/lib/queenbee/metrics.rb
CHANGED
data/lib/queenbee/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path("../../test_helper", __FILE__)
|
2
|
+
|
3
|
+
module Queenbee
|
4
|
+
class EventTest < Test::Unit::TestCase
|
5
|
+
setup do
|
6
|
+
@valid_params = {
|
7
|
+
date: "2014-07-01 14:50:28",
|
8
|
+
status: "confirmed",
|
9
|
+
message: "From the API",
|
10
|
+
metadata: {color: "pink", "sport": "basket-ball", "age": 25, "fruit": "banana"}
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
should "create should return status 201" do
|
15
|
+
response = Queenbee::Event.create(@valid_params)
|
16
|
+
assert_equal "201", response.code
|
17
|
+
end
|
18
|
+
|
19
|
+
should "raise Queenbee::AuthenticationError if no token provided" do
|
20
|
+
Queenbee.token = nil
|
21
|
+
assert_raises(Queenbee::AuthenticationError) { Queenbee::Event.create }
|
22
|
+
end
|
23
|
+
|
24
|
+
should "raise Queenbee::InvalidRequestError if not enough parameters" do
|
25
|
+
begin
|
26
|
+
rescue JSON::ParserError
|
27
|
+
assert_raises(Queenbee::InvalidRequestError) { Queenbee::Event.create }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: queenbee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '3'
|
83
83
|
description: E-commerce analytics platform
|
84
84
|
email:
|
85
85
|
- olivier@yafoy.com
|
@@ -99,10 +99,12 @@ files:
|
|
99
99
|
- lib/queenbee/errors/authentication_error.rb
|
100
100
|
- lib/queenbee/errors/invalid_request_error.rb
|
101
101
|
- lib/queenbee/errors/queenbee_error.rb
|
102
|
+
- lib/queenbee/event.rb
|
102
103
|
- lib/queenbee/metrics.rb
|
103
104
|
- lib/queenbee/order.rb
|
104
105
|
- lib/queenbee/queenbee_object.rb
|
105
106
|
- lib/queenbee/version.rb
|
107
|
+
- test/queenbee/event_test.rb
|
106
108
|
- test/queenbee/metrics_test.rb
|
107
109
|
- test/queenbee/order_test.rb
|
108
110
|
- test/test_helper.rb
|
@@ -126,11 +128,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
128
|
version: '0'
|
127
129
|
requirements: []
|
128
130
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.6.11
|
130
132
|
signing_key:
|
131
133
|
specification_version: 4
|
132
134
|
summary: Gem to send e-commerce orders to the Queenbee central app.
|
133
135
|
test_files:
|
136
|
+
- test/queenbee/event_test.rb
|
134
137
|
- test/queenbee/metrics_test.rb
|
135
138
|
- test/queenbee/order_test.rb
|
136
139
|
- test/test_helper.rb
|