remark_analytics 1.0.12 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 530bd298dad02c3867f0b973dca75734788df84d97f61aba45627d3b151c00ba
4
- data.tar.gz: 030a94d0e351ca9acb22973b1a4f8b09970f3c683600dedbbabaa19cd0460d40
3
+ metadata.gz: 5c9200f611f025d8d8cf1509f2e5548cfa3c02a0c431b810e66a8165b0b3cd45
4
+ data.tar.gz: 2adad2aaeb9f0a21f716091d231d4c24a400ce6f420bb3b63c6a0706c190a63a
5
5
  SHA512:
6
- metadata.gz: 0636a20275afc49a5aef66ed764ff87fdfcf8917de1a3db796fb10225e9251b92db43be714649f146d1a0870a1365b1ae5b6f3bb1a535080a10fbd764bf571c4
7
- data.tar.gz: bea2425be93e8d0899afe41969a6047d90908327a6ed82877d4914ee2d266879e748ed9ae13cff5af649b371b9e84cda653b2acf01ae29a58af2e2484e04e2ed
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 Rails.application.secrets
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
- Rails.application.secrets.try(:REMARK_ANALYTICS_TENANT_NAME)
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 Rails.application.secrets.try(:NO_REMARK_ANALYTICS) || ENV['NO_REMARK_ANALYTICS'].present?
19
+ if ENV.fetch('NO_REMARK_ANALYTICS', nil).present?
20
20
  return
21
21
  end
22
22
 
23
- analytics_url = Rails.application.secrets.try(:REMARK_ANALYTICS_URL)
24
- username = Rails.application.secrets.try(:REMARK_ANALYTICS_USERNAME)
25
- password = Rails.application.secrets.try(:REMARK_ANALYTICS_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
@@ -1,3 +1,3 @@
1
1
  module RemarkAnalytics
2
- VERSION = '1.0.12'.freeze
2
+ VERSION = '1.0.14'.freeze
3
3
  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.12
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: 2023-04-24 00:00:00.000000000 Z
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.3.16
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