remark_analytics 1.0.12 → 1.0.14
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 +4 -4
- data/README.md +3 -3
- data/lib/remark_analytics/event.rb +1 -1
- data/lib/remark_analytics/jobs/post_event_job.rb +10 -4
- data/lib/remark_analytics/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c9200f611f025d8d8cf1509f2e5548cfa3c02a0c431b810e66a8165b0b3cd45
|
4
|
+
data.tar.gz: 2adad2aaeb9f0a21f716091d231d4c24a400ce6f420bb3b63c6a0706c190a63a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f72241758d5e912490a06f105693de7f8accda223369f19186052b78c8527516859653d3c372e8c032eb3f70e30e82c281f76d0ac9585184b7847df6628fff7a
|
7
|
+
data.tar.gz: b92d37cb9a0279beff3bb4bab1c18ecce74e3cc3e53a0f90b2cfe9a8b6cf579adf35777924df4c1e3539d2778c4d6fad667c91ca55a90639bd2febe8be5cd175
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ReMark Analytics
|
2
2
|
|
3
|
-
Welcome to the readme of ReMark Analytics. This library is used to emit events
|
3
|
+
Welcome to the readme of ReMark Analytics. This library is used to emit events
|
4
4
|
from Ruby applications to the ReMark Analytics API in order for ReMark's Data Analytics team to do magic with the built up data set.
|
5
5
|
|
6
6
|
## Installation
|
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
$ gem install remark_analytics
|
21
21
|
|
22
22
|
## Configuration
|
23
|
-
Make sure the following keys and their values become available in your application's
|
23
|
+
Make sure the following keys and their values become available in your application's ENV collection
|
24
24
|
|
25
25
|
- **REMARK_ANALYTICS_URL** (the url of the ReMark Analytics application)
|
26
26
|
- **REMARK_ANALYTICS_USERNAME** (the Basic Authentication user name)
|
@@ -36,7 +36,7 @@ or prevent the raise of missing secrets errors by setting just one secret
|
|
36
36
|
Examples:
|
37
37
|
|
38
38
|
```ruby
|
39
|
-
# You can register an event from everywhere in the code with
|
39
|
+
# You can register an event from everywhere in the code with
|
40
40
|
RemarkAnalytics::Event.emit({
|
41
41
|
name: 'event_name_that_is_easy_to_understand',
|
42
42
|
resource_id: resource.id,
|
@@ -19,7 +19,7 @@ module RemarkAnalytics
|
|
19
19
|
event_parameters[:application_version].presence || RemarkAnalytics::VERSION
|
20
20
|
result[:occured_at] = event_parameters[:occured_at].presence || Time.zone.now
|
21
21
|
result[:tenant_name] = event_parameters[:tenant_name].presence ||
|
22
|
-
|
22
|
+
ENV.fetch('REMARK_ANALYTICS_TENANT_NAME', nil)
|
23
23
|
|
24
24
|
if result[:tenant_name].blank? && Object.const_defined?('VP_SETTINGS')
|
25
25
|
result[:tenant_name] = VP_SETTINGS[:tenant]
|
@@ -16,13 +16,15 @@ module RemarkAnalytics
|
|
16
16
|
protected
|
17
17
|
|
18
18
|
def connection
|
19
|
-
if
|
19
|
+
if ENV.fetch('NO_REMARK_ANALYTICS', nil).present?
|
20
20
|
return
|
21
21
|
end
|
22
22
|
|
23
|
-
analytics_url =
|
24
|
-
username =
|
25
|
-
password =
|
23
|
+
analytics_url = ENV.fetch('REMARK_ANALYTICS_URL', nil)
|
24
|
+
username = ENV.fetch('REMARK_ANALYTICS_USERNAME', nil)
|
25
|
+
password = ENV.fetch('REMARK_ANALYTICS_PASSWORD', nil)
|
26
|
+
tenant_name = ENV.fetch('REMARK_ANALYTICS_TENANT_NAME', nil)
|
27
|
+
|
26
28
|
@events_endpoint = "#{analytics_url}/api/v1/events"
|
27
29
|
|
28
30
|
if analytics_url.blank?
|
@@ -37,6 +39,10 @@ module RemarkAnalytics
|
|
37
39
|
raise RemarkAnalytics::SecretsMissingError.new('REMARK_ANALYTICS_PASSWORD not set')
|
38
40
|
end
|
39
41
|
|
42
|
+
if tenant_name.blank?
|
43
|
+
raise RemarkAnalytics::SecretsMissingError.new('REMARK_ANALYTICS_TENANT_NAME not set')
|
44
|
+
end
|
45
|
+
|
40
46
|
Faraday.new do |conn|
|
41
47
|
conn.request(:authorization, :basic, username, password)
|
42
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remark_analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Rockx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -49,7 +49,8 @@ files:
|
|
49
49
|
homepage: https://bitbucket.org/ivaldi/rubygems-remark-analytics/src/master/
|
50
50
|
licenses:
|
51
51
|
- MIT
|
52
|
-
metadata:
|
52
|
+
metadata:
|
53
|
+
rubygems_mfa_required: 'true'
|
53
54
|
post_install_message:
|
54
55
|
rdoc_options: []
|
55
56
|
require_paths:
|
@@ -65,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
66
|
- !ruby/object:Gem::Version
|
66
67
|
version: '0'
|
67
68
|
requirements: []
|
68
|
-
rubygems_version: 3.
|
69
|
+
rubygems_version: 3.5.22
|
69
70
|
signing_key:
|
70
71
|
specification_version: 4
|
71
72
|
summary: Gem to fire events to ReMark Analytics API from a client application
|