remark_analytics 1.0.11 → 1.0.13

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: '058b54841fb2844dbb60f1625d2bd10fe7a550c8f05f72c309ba1a1fcf05b121'
4
- data.tar.gz: 657290674e13f42ee59a1c3a592ad0b8827624dbdbe722effcb8b501f45fec76
3
+ metadata.gz: 6d88b6ba30cf5162e989ac4f5e02540e11484a9ff45c1e394d37dd06cceb81fe
4
+ data.tar.gz: 6ca366a66c3a59c2cd9d3039c735ef997e82b69966fbae7cb08077b5473fecba
5
5
  SHA512:
6
- metadata.gz: 74e3a8a05adfdb301290ff1995ad76ffcbc44a1c65afc5f792f3ad02a0396eb3a11e7d599a4a1d79b7d8d67cecafbbdc9882376085c660594ee96f374b943176
7
- data.tar.gz: a1d57cb885a7144c842f1c1b2a7c893ad5d5991893310c1753cd2ff394db1bb6c1f586a0ea2447138805de95d27df2208a4707a84ec7b8776b9a2de8b76de701
6
+ metadata.gz: 9dc6e5db6a2bf7ac7c1dae586111aaca36abbf1bd5c557edff5879fbdb9f3e40232ace415d29c84f9d8c703bdb3af20cdc079511d769d205328967f566f549ef
7
+ data.tar.gz: 88f6f12d4b835b5d71bb5d406de04548f338e0db63490c3c6377cab13c6ddcb938742f564d1e66d1f39c9138eed6bf7254574f27062c394e29ed77de00483a34
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,
@@ -24,7 +24,7 @@ module RemarkAnalytics
24
24
  if result[:tenant_name].blank? && Object.const_defined?('VP_SETTINGS')
25
25
  result[:tenant_name] = VP_SETTINGS[:tenant]
26
26
  end
27
- if result[:tenant_name].blank? && class_exists?('Admin::Setting')
27
+ if result[:tenant_name].blank? && RemarkAnalytics::Event.class_exists?('Admin::Setting')
28
28
  result[:tenant_name] = Admin::Setting.all[:tenant]
29
29
  end
30
30
 
@@ -45,7 +45,7 @@ module RemarkAnalytics
45
45
  RemarkAnalytics::Jobs::PostEventJob.perform_later(event_params)
46
46
  end
47
47
 
48
- def class_exists?(class_name)
48
+ def self.class_exists?(class_name)
49
49
  klass = Module.const_get(class_name)
50
50
  klass.is_a?(Class)
51
51
  rescue NameError
@@ -16,13 +16,13 @@ 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
26
  @events_endpoint = "#{analytics_url}/api/v1/events"
27
27
 
28
28
  if analytics_url.blank?
@@ -1,3 +1,3 @@
1
1
  module RemarkAnalytics
2
- VERSION = '1.0.11'.freeze
2
+ VERSION = '1.0.13'.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.11
4
+ version: 1.0.13
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: 2024-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.3.16
68
+ rubygems_version: 3.5.11
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Gem to fire events to ReMark Analytics API from a client application