rudder_analytics_sync 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -4
- data/lib/rudder_analytics_sync/operations/operation.rb +13 -20
- data/lib/rudder_analytics_sync/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2b0d385201227d9e778888a6874cf6be75a09b0a74c96243d18061af24996084
|
4
|
+
data.tar.gz: 56eefbf2bfc77688b912fa4f52795c115645461d2d8c7535f3fca78eb9743984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d29adcc4026b7178b02229f39a0f5f4df21b540bad1aca6bfad723d8e3899e7ed2e229ac21046200a65098e85a87a074b2329a4b7ef6a461a6931538a79f9ad
|
7
|
+
data.tar.gz: 861bd17aae4ca8147a49628bb6586570c832124b5193939c461fc2796f92416dee60122aeb2acb038ebf6dd7a66df47528c1415450c1b65869f08ad842377c7f
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# What is
|
1
|
+
# What is RudderStack?
|
2
2
|
|
3
3
|
**Short answer:**
|
4
4
|
Rudder is an open-source Segment alternative written in Go, built for the enterprise. .
|
@@ -6,8 +6,6 @@ Rudder is an open-source Segment alternative written in Go, built for the enterp
|
|
6
6
|
**Long answer:**
|
7
7
|
Rudder is a platform for collecting, storing and routing customer event data to dozens of tools. Rudder is open-source, can run in your cloud environment (AWS, GCP, Azure or even your data-centre) and provides a powerful transformation framework to process your event data on the fly.
|
8
8
|
|
9
|
-
Released under [MIT License 2.0](https://opensource.org/licenses/MIT)
|
10
|
-
|
11
9
|
## Installation
|
12
10
|
|
13
11
|
Add this line to your application's Gemfile:
|
@@ -61,4 +59,4 @@ end
|
|
61
59
|
```
|
62
60
|
|
63
61
|
## Contact Us
|
64
|
-
If you come across any issues while configuring or using RudderStack, please feel free to [contact us](https://rudderstack.com/contact/) or start a conversation on our [Discord](https://discordapp.com/invite/xNEdEGw) channel. We will be happy to help you.
|
62
|
+
If you come across any issues while configuring or using RudderStack, please feel free to [contact us](https://rudderstack.com/contact/) or start a conversation on our [Discord](https://discordapp.com/invite/xNEdEGw) channel. We will be happy to help you.
|
@@ -32,23 +32,10 @@ module RudderAnalyticsSync
|
|
32
32
|
attr_reader :options, :request, :context
|
33
33
|
|
34
34
|
def base_payload
|
35
|
-
|
35
|
+
check_identity!
|
36
36
|
current_time = Time.now.utc
|
37
37
|
|
38
|
-
anonymous_id = options[:anonymous_id] || uid()
|
39
|
-
user_id = options[:user_id]
|
40
|
-
context[:traits] = (context[:traits] || {}).merge(
|
41
|
-
{
|
42
|
-
anonymousId: anonymous_id
|
43
|
-
}
|
44
|
-
)
|
45
|
-
|
46
|
-
if (user_id)
|
47
|
-
context[:traits] = context[:traits].merge({userId: user_id})
|
48
|
-
end
|
49
|
-
|
50
38
|
payload = {
|
51
|
-
anonymousId: anonymous_id,
|
52
39
|
context: context,
|
53
40
|
integrations: options[:integrations] || { All: true },
|
54
41
|
timestamp: maybe_datetime_in_iso8601(options[:timestamp] || Time.now.utc),
|
@@ -57,16 +44,22 @@ module RudderAnalyticsSync
|
|
57
44
|
properties: options[:properties] || {}
|
58
45
|
}
|
59
46
|
|
60
|
-
if
|
61
|
-
|
47
|
+
# add the userId if present
|
48
|
+
if (options[:user_id])
|
49
|
+
payload = payload.merge({userId: options[:user_id]})
|
50
|
+
end
|
51
|
+
|
52
|
+
# add the anonymousId if present
|
53
|
+
if (options[:anonymous_id])
|
54
|
+
payload = payload.merge({anonymousId: options[:anonymous_id]})
|
62
55
|
end
|
63
56
|
payload
|
64
57
|
end
|
65
58
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
59
|
+
def check_identity!
|
60
|
+
raise ArgumentError, 'user_id or anonymous_id must be present' \
|
61
|
+
unless options[:user_id] || options[:anonymous_id]
|
62
|
+
end
|
70
63
|
end
|
71
64
|
end
|
72
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rudder_analytics_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RudderStack
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -167,8 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
|
171
|
-
rubygems_version: 2.5.2.3
|
170
|
+
rubygems_version: 3.0.3
|
172
171
|
signing_key:
|
173
172
|
specification_version: 4
|
174
173
|
summary: Privacy and Security focused Segment-alternative. Ruby SDK (sync)
|