logtail-rails 0.1.3 → 0.1.4

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
2
  SHA256:
3
- metadata.gz: bdd11e117af8f594fd2fb55777f343d51134aa56f1e70cab0e1283b3237f794b
4
- data.tar.gz: ed25f8b7c0c76b62511cc81096201c9e3276422b710c283d9b52ffee2d0d808a
3
+ metadata.gz: e8a2816aef51d0ea967a9442a2f564e52688eb284221db42fa5e70ce5bf958df
4
+ data.tar.gz: 9bc07029b6fc8b5312f4b71c391b7fc5ac1097f4d5610ffb397efbfd333bdc18
5
5
  SHA512:
6
- metadata.gz: 8743e32c93c66f5c97771ce69ae534d42101b12b29b670d34f4f8485d055a4661191cac6c06f7776cb5e3445ca5427da6309b6ad08f0c5478f40faee4466bb5b
7
- data.tar.gz: 0f963ca0d99383b3b83dd6bedf1bc6f168927aaa68ca413c0995c741d03f35fb1bf7a8406a1c6c218c25fbcaf3fc44fef755b25c3bc850c3658ad91e240febd0
6
+ metadata.gz: aabbf1f5c8f2b6ae439534d2fb01b9438d304c03edbc1de6383fd28db60be866fc287d74c4ab213881f19a99feb95d87964120143b0ca954f732ec55453a59b1
7
+ data.tar.gz: e59e3bc6c3856972092e02907dc1a97f203c6508ddc648dd56db30aee9485f028d4352bf2f05ca11736a8491c09978a2e07fc488c46514a6b3fce6977ee4789a
@@ -1,10 +1,11 @@
1
1
  namespace :logtail do
2
2
  desc 'Install a default config/initializers/logtail.rb file'
3
3
 
4
- def content
4
+ PLACEHOLDER = '<SOURCE_TOKEN>'.freeze
5
+ def content(source_token = nil)
5
6
  <<~RUBY
6
7
  if ENV['LOGTAIL_SKIP_LOGS'].blank? && !Rails.env.test?
7
- http_device = Logtail::LogDevices::HTTP.new('<ACCESS_TOKEN>')
8
+ http_device = Logtail::LogDevices::HTTP.new('#{source_token || PLACEHOLDER}')
8
9
  Rails.logger = Logtail::Logger.new(http_device)
9
10
  else
10
11
  Rails.logger = Logtail::Logger.new(STDOUT)
@@ -15,6 +16,7 @@ namespace :logtail do
15
16
  task install: :environment do
16
17
  quiet = ENV['quiet']
17
18
  force = ENV['force']
19
+ source_token = ENV['source_token']
18
20
 
19
21
  config_file = 'config/initializers/logtail.rb'
20
22
 
@@ -23,7 +25,7 @@ namespace :logtail do
23
25
  next
24
26
  end
25
27
 
26
- File.open(config_file, 'w') { |out| out.puts(content) }
28
+ File.open(config_file, 'w') { |out| out.puts(content(source_token)) }
27
29
 
28
30
  puts <<~EOF unless quiet
29
31
  Installed a default configuration file at #{config_file}.
@@ -31,7 +33,7 @@ namespace :logtail do
31
33
 
32
34
  puts <<~EOF unless quiet
33
35
  To monitor your logs in production mode, sign up for an account
34
- at logtail.com, and replace the access key in the logtail.rb file
36
+ at logtail.com, and replace the source token in the logtail.rb file
35
37
  with the one you receive upon registration.
36
38
  EOF
37
39
 
@@ -1,7 +1,7 @@
1
1
  module Logtail
2
2
  module Integrations
3
3
  module Rails
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logtail-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logtail
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-26 00:00:00.000000000 Z
11
+ date: 2021-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logtail