rudder_analytics_sync 1.0.6 → 1.0.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 157030c6f0cb2352bf8efda032c35fd760fdbf6f
4
- data.tar.gz: 59af93b4a244d8836f766995901e16cba9a24489
2
+ SHA256:
3
+ metadata.gz: 2b0d385201227d9e778888a6874cf6be75a09b0a74c96243d18061af24996084
4
+ data.tar.gz: 56eefbf2bfc77688b912fa4f52795c115645461d2d8c7535f3fca78eb9743984
5
5
  SHA512:
6
- metadata.gz: 4f66625ad1e88c3bb0c36790e606b86c207914cd35e6a6641883ddd33ab39c3bb176c81b9cd33325ac68c558f0260da42f40d0b019316d1b420eca1eb2f6afc3
7
- data.tar.gz: 2b5ff7739615de79136ac718a89f975ffde9a7972c8aa6e48baf1034cd1aa72377c8e232fefe6c7d5271f6da108f6b557e52f0a22d68bdadbc33b58c87460d35
6
+ metadata.gz: 3d29adcc4026b7178b02229f39a0f5f4df21b540bad1aca6bfad723d8e3899e7ed2e229ac21046200a65098e85a87a074b2329a4b7ef6a461a6931538a79f9ad
7
+ data.tar.gz: 861bd17aae4ca8147a49628bb6586570c832124b5193939c461fc2796f92416dee60122aeb2acb038ebf6dd7a66df47528c1415450c1b65869f08ad842377c7f
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # What is Rudder?
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
- # check_identity!
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 (user_id)
61
- payload = payload.merge({userId: user_id})
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
- # def check_identity!
67
- # raise ArgumentError, 'user_id or anonymous_id must be present' \
68
- # unless options[:user_id] || options[:anonymous_id]
69
- # end
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RudderAnalyticsSync
4
- VERSION = '1.0.6'
4
+ VERSION = '1.0.7'
5
5
  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.6
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-08-05 00:00:00.000000000 Z
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
- rubyforge_project:
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)