keen 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +14 -14
- data/lib/keen/client/publishing_methods.rb +1 -1
- data/lib/keen/version.rb +1 -1
- data/spec/keen/client/publishing_methods_spec.rb +1 -1
- metadata +26 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23a71be7b45d1b303b5b5872cfed224d6ac80732
|
4
|
+
data.tar.gz: 31666e8d77d3d7d0a9c434a5d883fcd7cc9418b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4452cce3d9ca6a82aa95f9e773d917c5f7e2ef638e21602dfed113e2fdf27bc7cc5b9b0278babe6b281556c4b9f8af208d4bfd6225402847c64a7ee6ba111a47
|
7
|
+
data.tar.gz: c8b04e2657e971711c99b2983c9cff75f70745de18a1a2d4de5bef3957df0fcd5bf1778e514aef4e49d6e70c0d92830fafae77291adb6311efac1aacc7433eab
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -115,17 +115,17 @@ Here are some examples of querying with keen-gem. Let's assume you've added some
|
|
115
115
|
```ruby
|
116
116
|
# Various analysis types
|
117
117
|
Keen.count("purchases") # => 100
|
118
|
-
Keen.sum("purchases", :target_property => "price") # => 10000
|
119
|
-
Keen.minimum("purchases", :target_property => "price") # => 20
|
120
|
-
Keen.maximum("purchases", :target_property => "price") # => 100
|
121
|
-
Keen.average("purchases", :target_property => "price") # => 60
|
122
|
-
Keen.median("purchases", :target_property => "price") # => 60
|
123
|
-
Keen.percentile("purchases", :target_property => "price", :percentile => 90) # => 100
|
124
|
-
Keen.count_unique("purchases", :target_property => "username") # => 3
|
125
|
-
Keen.select_unique("purchases", :target_property => "username") # => ["Bob", "Linda", "Travis"]
|
118
|
+
Keen.sum("purchases", :target_property => "price", :timeframe => "today") # => 10000
|
119
|
+
Keen.minimum("purchases", :target_property => "price", :timeframe => "today") # => 20
|
120
|
+
Keen.maximum("purchases", :target_property => "price", :timeframe => "today") # => 100
|
121
|
+
Keen.average("purchases", :target_property => "price", :timeframe => "today") # => 60
|
122
|
+
Keen.median("purchases", :target_property => "price", :timeframe => "today") # => 60
|
123
|
+
Keen.percentile("purchases", :target_property => "price", :percentile => 90, :timeframe => "today") # => 100
|
124
|
+
Keen.count_unique("purchases", :target_property => "username", :timeframe => "today") # => 3
|
125
|
+
Keen.select_unique("purchases", :target_property => "username", :timeframe => "today") # => ["Bob", "Linda", "Travis"]
|
126
126
|
|
127
127
|
# Group by's and filters
|
128
|
-
Keen.sum("purchases", :target_property => "price", :group_by => "item.id") # => [{ "item.id": 123, "result": 240 }]
|
128
|
+
Keen.sum("purchases", :target_property => "price", :group_by => "item.id", :timeframe => "this_14_days") # => [{ "item.id": 123, "result": 240 }]
|
129
129
|
Keen.count("purchases", :timeframe => "today", :filters => [{
|
130
130
|
"property_name" => "referred_by",
|
131
131
|
"operator" => "eq",
|
@@ -142,12 +142,12 @@ Keen.count("purchases", :timeframe => {
|
|
142
142
|
}) # => 5
|
143
143
|
|
144
144
|
# Extractions
|
145
|
-
Keen.extraction("purchases") # => [{ "keen" => { "timestamp" => "2014-01-01T00:00:00Z" }, "price" => 20 }]
|
145
|
+
Keen.extraction("purchases", :timeframe => "today") # => [{ "keen" => { "timestamp" => "2014-01-01T00:00:00Z" }, "price" => 20 }]
|
146
146
|
|
147
147
|
# Funnels
|
148
148
|
Keen.funnel(:steps => [{
|
149
|
-
:actor_property => "username", :event_collection => "purchases" }, {
|
150
|
-
:actor_property => "username", :event_collection => "referrals" }]) # => [20, 15]
|
149
|
+
:actor_property => "username", :event_collection => "purchases", :timeframe => "yesterday" }, {
|
150
|
+
:actor_property => "username", :event_collection => "referrals", :timeframe => "yesterday" }]) # => [20, 15]
|
151
151
|
|
152
152
|
# Multi-analysis
|
153
153
|
Keen.multi_analysis("purchases", analyses: {
|
@@ -186,14 +186,14 @@ You can specify a `max_age` parameter as part of your query request, but make su
|
|
186
186
|
Sometimes you just want the URL for a query, but don't actually need to run it. Maybe to paste into a dashboard, or open in your browser. In that case, use the `query_url` method:
|
187
187
|
|
188
188
|
``` ruby
|
189
|
-
Keen.query_url("median", "purchases", :target_property => "price")
|
189
|
+
Keen.query_url("median", "purchases", :target_property => "price", { :timeframe => "today" })
|
190
190
|
# => "https://api.keen.io/3.0/projects/<project-id>/queries/median?target_property=price&event_collection=purchases&api_key=<api-key>"
|
191
191
|
```
|
192
192
|
|
193
193
|
If you don't want the API key included, pass the `:exclude_api_key` option:
|
194
194
|
|
195
195
|
``` ruby
|
196
|
-
Keen.query_url("median", "purchases", { :target_property => "price" }, :exclude_api_key => true)
|
196
|
+
Keen.query_url("median", "purchases", { :target_property => "price", :timeframe => "today" }, :exclude_api_key => true)
|
197
197
|
# => "https://api.keen.io/3.0/projects/<project-id>/queries/median?target_property=price&event_collection=purchases"
|
198
198
|
```
|
199
199
|
|
@@ -121,7 +121,7 @@ module Keen
|
|
121
121
|
# @return a URL that will track an event when hit
|
122
122
|
def redirect_url(event_collection, properties, redirect_url)
|
123
123
|
require 'open-uri'
|
124
|
-
encoded_url =
|
124
|
+
encoded_url = CGI::escape(redirect_url)
|
125
125
|
json = MultiJson.encode(properties)
|
126
126
|
data = [json].pack("m0").tr("+/", "-_").gsub("\n", "")
|
127
127
|
"#{self.api_url}#{api_event_collection_resource_path(event_collection)}?api_key=#{self.write_key}&data=#{data}&redirect=#{encoded_url}"
|
data/lib/keen/version.rb
CHANGED
@@ -328,7 +328,7 @@ describe Keen::Client::PublishingMethods do
|
|
328
328
|
describe "redirect_url" do
|
329
329
|
it "should return a url with a base-64 encoded json param and an encoded redirect url" do
|
330
330
|
client.redirect_url("sign_ups", { :name => "Bob" }, "http://keen.io/?foo=bar&bar=baz").should ==
|
331
|
-
"#{api_url}/3.0/projects/12345/events/sign_ups?api_key=#{write_key}&data=eyJuYW1lIjoiQm9iIn0=&redirect=http
|
331
|
+
"#{api_url}/3.0/projects/12345/events/sign_ups?api_key=#{write_key}&data=eyJuYW1lIjoiQm9iIn0=&redirect=http%3A%2F%2Fkeen.io%2F%3Ffoo%3Dbar%26bar%3Dbaz"
|
332
332
|
end
|
333
333
|
end
|
334
334
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Kleissner
|
@@ -9,132 +9,132 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-08-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.3'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.3'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: addressable
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ~>
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 2.3.5
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 2.3.5
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: guard
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - '>='
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: guard-rspec
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rb-inotify
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - '>='
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rb-fsevent
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - '>='
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - '>='
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rb-fchange
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - '>='
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - '>='
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: ruby_gntp
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - '>='
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- -
|
123
|
+
- - '>='
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: rb-readline
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - '>='
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- -
|
137
|
+
- - '>='
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
description: Send events and build analytics features into your Ruby applications.
|
@@ -143,9 +143,9 @@ executables: []
|
|
143
143
|
extensions: []
|
144
144
|
extra_rdoc_files: []
|
145
145
|
files:
|
146
|
-
-
|
147
|
-
-
|
148
|
-
-
|
146
|
+
- .gitignore
|
147
|
+
- .rspec
|
148
|
+
- .travis.yml
|
149
149
|
- Gemfile
|
150
150
|
- Guardfile
|
151
151
|
- LICENSE
|
@@ -184,17 +184,17 @@ require_paths:
|
|
184
184
|
- lib
|
185
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- -
|
187
|
+
- - '>='
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - '>='
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
196
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
197
|
+
rubygems_version: 2.0.14
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: Keen IO API Client
|