remark_analytics 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf88039a5bf5fb14e148b4608bdfaaca16f3dbd663e7afa372e0f35fe1b77eb9
4
- data.tar.gz: 97fbce71002f789f74dfa729033f047eae89d717bf776bbc96bd808b2d3c34dd
3
+ metadata.gz: 750cd5e3f83a0db4b3b986bf7fbc6e06c91e6731f6816e9f8ace47c6939ce2f6
4
+ data.tar.gz: 80b15d392b5f6a76431b7d21710c9d98b3312e2d211ac2e3d9c86cb12fa351bf
5
5
  SHA512:
6
- metadata.gz: 836c9261ba9ce3d7bb2750de50ec7ac7617e8ba64ac6958182bab0cc753159e9a9e7c91efd8e4cd3659fd3e15ef02bbe920bd8737c8823225a2b487eb05b75c4
7
- data.tar.gz: b049ffe49a6c392221924997097cd08f18fe80abfbbb9025c1cba683a874377fa1a45bb41e3f2a48fbe3a012f8c2718b7dbe013780c1f62ab9b9710b457817e7
6
+ metadata.gz: 482cbd18f99aeb9bd309a85a629295e221ee0f0f0241cc516f24085c031853cdbc7e263a31cdcdd3cf3da7a7f5a6600b46640559e0f4cd22d74e458fb3cdf729
7
+ data.tar.gz: 89dc61dc6f260e5abbb3af19e522a55fcd8a22b6ca6368ddc99902fb930130aa9e8c760281fb8d7f80845e2b8832b352a9ff6b7e614d4c0b5c40d21713eeded5
@@ -0,0 +1,4 @@
1
+ module RemarkAnalytics
2
+ class Error < StandardError; end
3
+ class SecretsMissingError < Error; end
4
+ end
@@ -28,7 +28,11 @@ module RemarkAnalytics
28
28
 
29
29
  def self.post_event(event_params)
30
30
  if Rails.env.development? || Rails.env.test?
31
- RemarkAnalytics::Jobs::PostEventJob.perform_now(event_params)
31
+ begin
32
+ RemarkAnalytics::Jobs::PostEventJob.perform_now(event_params)
33
+ rescue RemarkAnalytics::SecretsMissingError => _e
34
+ # to pass tests
35
+ end
32
36
  return
33
37
  end
34
38
 
@@ -26,15 +26,15 @@ module RemarkAnalytics
26
26
  @events_endpoint = "#{analytics_url}/api/v1/events"
27
27
 
28
28
  if analytics_url.blank?
29
- raise StandardError 'REMARK_ANALYTICS_URL not set'
29
+ raise RemarkAnalytics::SecretsMissingError.new('REMARK_ANALYTICS_URL not set')
30
30
  end
31
31
 
32
32
  if username.blank?
33
- raise StandardError 'REMARK_ANALYTICS_USERNAME not set'
33
+ raise RemarkAnalytics::SecretsMissingError.new('REMARK_ANALYTICS_USERNAME not set')
34
34
  end
35
35
 
36
36
  if password.blank?
37
- raise StandardError 'REMARK_ANALYTICS_PASSWORD not set'
37
+ raise RemarkAnalytics::SecretsMissingError.new('REMARK_ANALYTICS_PASSWORD not set')
38
38
  end
39
39
 
40
40
  Faraday.new do |conn|
@@ -1,3 +1,3 @@
1
1
  module RemarkAnalytics
2
- VERSION = '1.0.6'.freeze
2
+ VERSION = '1.0.7'.freeze
3
3
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'remark_analytics/railtie'
4
4
  require 'remark_analytics/version'
5
+ require 'remark_analytics/errors'
5
6
  require 'remark_analytics/event'
6
7
 
7
8
  require 'remark_analytics/jobs/application_job'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remark_analytics
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
  - Nick Rockx
@@ -54,6 +54,7 @@ extra_rdoc_files: []
54
54
  files:
55
55
  - README.md
56
56
  - lib/remark_analytics.rb
57
+ - lib/remark_analytics/errors.rb
57
58
  - lib/remark_analytics/event.rb
58
59
  - lib/remark_analytics/jobs/application_job.rb
59
60
  - lib/remark_analytics/jobs/post_event_job.rb