logtail-rails 0.1.1 → 0.1.5

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: 4cdf6c93289e9a34950f3ccdccc1fbe5baad830c2390493e618f8e9d2a7d1895
4
- data.tar.gz: a6889e39351d24bc481148844bd03299c5b1d810363fdbd33b37220963bcf54d
3
+ metadata.gz: f06ff6f125635b3e0222d5b1b4c9a4b1de20dd7a73084144bab4a60b6ae348bd
4
+ data.tar.gz: a94abe2bbc571c46981e65a6f70e00d973745b3147157fa9decd789cc5af78a2
5
5
  SHA512:
6
- metadata.gz: 26b593b3eb0079cd6520e6933f3e9234c30a519abc235cb23a7d4b680440658a7a79440e2a923c23b49eb789aea491335fe4353dafc6963867c6b6f1c1fdbad6
7
- data.tar.gz: d82c1de68a2f0d0afcd327dec621f40298ea72b954588fff38a73a61fe2823981d979a26452e83e28bb6a6b3959be1e964ee5e5e072e6dd873014b307f1e6ab7
6
+ metadata.gz: 754a9a6d710e7ac3bf553ef28d882e211356a54f0316b5dd1c56471548bda41bcc6af00c624396a5b5a56323e9959b58080cf76e4f885eb19aeb8578d4ea9b68
7
+ data.tar.gz: b060cafd810fd71accf2838538ee149e88fb325031e12ea55796984b4631e66c71029fc43b07a2a5821267e635d14cc25e9f95a1249acc6ad9b78fee70c67427
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 3.0.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  gemspec :path => '../'
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 3.1.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  gemspec :path => '../'
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 3.2.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  gemspec :path => '../'
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 4.0.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  if RUBY_PLATFORM == "java"
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 4.1.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  if RUBY_PLATFORM == "java"
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 4.2.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  if RUBY_PLATFORM == "java"
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 5.0.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  if RUBY_PLATFORM == "java"
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 5.1.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  if RUBY_PLATFORM == "java"
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 5.2.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  if RUBY_PLATFORM == "java"
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 6.0.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  if RUBY_PLATFORM == "java"
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'rails', '~> 6.1.0'
4
4
 
5
- gem 'logtail-ruby'
5
+ gem 'logtail'
6
6
  gem 'logtail-rack'
7
7
 
8
8
  if RUBY_PLATFORM == "java"
@@ -4,7 +4,7 @@ gem 'rack', git: 'https://github.com/rack/rack', branch: 'master'
4
4
  gem 'arel', git: 'https://github.com/rails/arel', branch: 'master'
5
5
  gem 'rails', git: 'https://github.com/rails/rails', branch: 'main'
6
6
 
7
- gem 'logtail-ruby'
7
+ gem 'logtail'
8
8
  gem 'logtail-rack'
9
9
 
10
10
  gemspec :path => '../'
@@ -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,28 +16,42 @@ 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
 
21
23
  if File.exist?(config_file) && !force
22
- puts "logtail.rb file already exists. Use `rake logtail:install force=true` to overwrite."
23
- return
24
+ puts "logtail.rb file already exists. Use `rake logtail:install force=true` to overwrite."
25
+ next
24
26
  end
25
27
 
26
- File.open(config_file, 'w') { |out| out.puts(content) }
27
-
28
- puts <<~EOF unless quiet
29
- Installed a default configuration file at #{config_file}.
30
- EOF
31
-
32
- puts <<~EOF unless quiet
33
- 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
35
- with the one you receive upon registration.
36
- EOF
37
-
38
- puts <<~EOF unless quiet
39
- Visit logtail.com/help if you are experiencing installation issues.
40
- EOF
28
+ File.open(config_file, 'w') { |out| out.puts(content(source_token)) }
29
+
30
+ return if quiet
31
+
32
+ if source_token.nil? || source_token == ''
33
+ puts <<~EOF
34
+ Installed a default configuration file at #{config_file}.
35
+ EOF
36
+
37
+ puts <<~EOF
38
+ To monitor your logs in production mode, sign up for an account
39
+ at logtail.com, and replace the source token in the logtail.rb file
40
+ with the one you receive upon registration.
41
+ EOF
42
+
43
+ puts <<~EOF
44
+ Visit logtail.com/help if you are experiencing installation issues.
45
+ EOF
46
+ else
47
+ puts <<~EOF
48
+ Installed a configuration file at #{config_file} with a source token
49
+ ending with '#{source_token[-4..]}'.
50
+ EOF
51
+
52
+ puts <<~EOF
53
+ Visit logtail.com/help if you are experiencing installation issues.
54
+ EOF
55
+ end
41
56
  end
42
57
  end
@@ -1,7 +1,7 @@
1
1
  module Logtail
2
2
  module Integrations
3
3
  module Rails
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
  end
7
7
  end
@@ -27,9 +27,9 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_runtime_dependency "rails", ">= 3.0.0"
31
- spec.add_runtime_dependency "logtail-ruby", "~> 0.1"
30
+ spec.add_runtime_dependency "logtail", "~> 0.1"
32
31
  spec.add_runtime_dependency "logtail-rack", "~> 0.1"
32
+ spec.add_runtime_dependency "rails", ">= 3.0.0"
33
33
 
34
34
  spec.add_development_dependency "bundler", ">= 0.0"
35
35
 
metadata CHANGED
@@ -1,31 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logtail-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.5
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-16 00:00:00.000000000 Z
11
+ date: 2021-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: logtail
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0
19
+ version: '0.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.0
26
+ version: '0.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: logtail-ruby
28
+ name: logtail-rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: logtail-rack
42
+ name: rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0.1'
47
+ version: 3.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0.1'
54
+ version: 3.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement