bmc-daemon-lib 0.3.6 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -7
- data/bmc-daemon-lib.gemspec +1 -4
- data/lib/bmc-daemon-lib.rb +0 -2
- data/lib/bmc-daemon-lib/conf.rb +24 -30
- data/lib/bmc-daemon-lib/logger_pool.rb +2 -0
- metadata +1 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 239b8f0424a5cac440f94c96d90c22596b26b8d6
|
4
|
+
data.tar.gz: e5af414d7d6537423a7f689f535762dee3b28823
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3b5dbc5d9868a7addaf034e0eab01c5a7fe6c14445c8927bc9312f230feefae51a1094f3e08f9403bd468ff1d00273989b0ee6d77e4c43a0b295d1e5b8f5161
|
7
|
+
data.tar.gz: 5e11b9a03c718469a6dd2c0c89287d45028a280b4cf5eaa8f579aa699e37cc0892c5601b327a0e950009152b1d40611eb5c527aa9137ec0dc125af35327cc024
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bmc-daemon-lib (0.3.
|
4
|
+
bmc-daemon-lib (0.3.8)
|
5
5
|
chamber (~> 2.9)
|
6
|
-
newrelic_rpm
|
7
|
-
rollbar
|
8
6
|
|
9
7
|
GEM
|
10
8
|
remote: https://rubygems.org/
|
@@ -15,15 +13,11 @@ GEM
|
|
15
13
|
thor (~> 0.19.1)
|
16
14
|
diff-lcs (1.2.5)
|
17
15
|
hashie (3.4.4)
|
18
|
-
multi_json (1.12.1)
|
19
|
-
newrelic_rpm (3.16.2.321)
|
20
16
|
parser (2.3.1.2)
|
21
17
|
ast (~> 2.2)
|
22
18
|
powerpack (0.1.1)
|
23
19
|
rainbow (2.1.0)
|
24
20
|
rake (11.2.2)
|
25
|
-
rollbar (2.12.0)
|
26
|
-
multi_json
|
27
21
|
rspec (3.5.0)
|
28
22
|
rspec-core (~> 3.5.0)
|
29
23
|
rspec-expectations (~> 3.5.0)
|
data/bmc-daemon-lib.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
# Project version
|
4
|
-
spec.version = "0.3.
|
4
|
+
spec.version = "0.3.8"
|
5
5
|
|
6
6
|
# Project description
|
7
7
|
spec.name = "bmc-daemon-lib"
|
@@ -25,9 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency "rspec"
|
26
26
|
spec.add_development_dependency "rubocop"
|
27
27
|
|
28
|
-
|
29
28
|
# Runtime dependencies
|
30
29
|
spec.add_runtime_dependency "chamber", "~> 2.9"
|
31
|
-
spec.add_runtime_dependency "newrelic_rpm"
|
32
|
-
spec.add_runtime_dependency "rollbar"
|
33
30
|
end
|
data/lib/bmc-daemon-lib.rb
CHANGED
data/lib/bmc-daemon-lib/conf.rb
CHANGED
@@ -79,8 +79,8 @@ module BmcDaemonLib
|
|
79
79
|
Encoding.default_external = "utf-8"
|
80
80
|
|
81
81
|
# Init New Relic, Rollbar
|
82
|
-
prepare_newrelic
|
83
|
-
prepare_rollbar if self.feature?(:rollbar)
|
82
|
+
# prepare_newrelic
|
83
|
+
#prepare_rollbar if self.feature?(:rollbar)
|
84
84
|
|
85
85
|
# Try to access any key to force parsing of the files
|
86
86
|
self[:dummy]
|
@@ -132,12 +132,13 @@ module BmcDaemonLib
|
|
132
132
|
# Guess if the specific feature si available
|
133
133
|
case name
|
134
134
|
when :newrelic
|
135
|
-
|
135
|
+
return false if Gem.datadir('newrelic_rpm').nil?
|
136
|
+
return self.at(:newrelic, :license)
|
136
137
|
when :rollbar
|
137
|
-
|
138
|
-
|
139
|
-
false
|
138
|
+
return false if Gem.datadir('rollbar').nil?
|
139
|
+
return self.at(:rollbar, :token)
|
140
140
|
end
|
141
|
+
return false
|
141
142
|
end
|
142
143
|
|
143
144
|
# Defaults generators
|
@@ -171,19 +172,9 @@ module BmcDaemonLib
|
|
171
172
|
end
|
172
173
|
end
|
173
174
|
|
174
|
-
|
175
|
-
protected
|
176
|
-
|
177
|
-
def self.load_files
|
178
|
-
load files: @files, namespaces: { environment: @app_env }
|
179
|
-
end
|
180
|
-
|
181
|
-
def self.add_config path
|
182
|
-
@files << File.expand_path(path) if path && File.readable?(path)
|
183
|
-
end
|
184
|
-
|
185
175
|
def self.prepare_newrelic
|
186
|
-
#
|
176
|
+
# Disable if no config present
|
177
|
+
return unless self.feature?(:newrelic)
|
187
178
|
section = self[:newrelic]
|
188
179
|
|
189
180
|
# Enable GC profiler
|
@@ -210,8 +201,8 @@ module BmcDaemonLib
|
|
210
201
|
end
|
211
202
|
|
212
203
|
def self.prepare_rollbar
|
213
|
-
#
|
214
|
-
|
204
|
+
# Disable if no config present
|
205
|
+
return unless self.feature?(:rollbar)
|
215
206
|
section = self[:rollbar]
|
216
207
|
|
217
208
|
# Configure
|
@@ -219,23 +210,26 @@ module BmcDaemonLib
|
|
219
210
|
config.enabled = true
|
220
211
|
config.access_token = section[:token].to_s
|
221
212
|
config.code_version = @app_version
|
222
|
-
|
223
|
-
#config.logger
|
224
|
-
config.
|
225
|
-
|
226
|
-
# Report asynchronously
|
213
|
+
config.environment = @app_env
|
214
|
+
#config.logger = Logger.new(logfile_path(:rollbar))
|
215
|
+
config.logger = LoggerPool.instance.get :rollbar
|
227
216
|
config.use_async = true
|
228
|
-
# Here we'll disable in 'test':
|
229
|
-
# if Rails.env.test? || Rails.env.development?
|
230
|
-
# config.enabled = false
|
231
|
-
# end
|
232
|
-
#logfile_path(:newrelic)
|
233
217
|
end
|
234
218
|
|
235
219
|
# Notify startup
|
236
220
|
Rollbar.info("#{@app_name} #{@app_ver} [#{@host}]")
|
237
221
|
end
|
238
222
|
|
223
|
+
protected
|
224
|
+
|
225
|
+
def self.load_files
|
226
|
+
load files: @files, namespaces: { environment: @app_env }
|
227
|
+
end
|
228
|
+
|
229
|
+
def self.add_config path
|
230
|
+
@files << File.expand_path(path) if path && File.readable?(path)
|
231
|
+
end
|
232
|
+
|
239
233
|
private
|
240
234
|
|
241
235
|
def self.ensure_init
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bmc-daemon-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno MEDICI
|
@@ -80,34 +80,6 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.9'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: newrelic_rpm
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rollbar
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
83
|
description: 'Shared utilities to build a daemon: logger, configuration, helpers'
|
112
84
|
email: bmc-daemon-lib@bmconseil.com
|
113
85
|
executables: []
|