optic-rails 0.0.3 → 0.0.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 +4 -4
- data/lib/optic/rails/railtie.rb +7 -3
- data/lib/optic/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 023f0944331b5b023b4dbe243e3d22de5f1b3da3b98862dd9e037c570106fd6e
|
4
|
+
data.tar.gz: b733b63462a0cd702303730b9211d886acf662d96d5de19ae0cbfb74318e45c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c97a65a391fabb9a134dcd2078cc86d47b3fa81082b65fc85e0251d13074e1f481a3ed23f1471aee5c5189d683dd43d1c1e179d88b7b75cb2a5d2b54df9d8ec4
|
7
|
+
data.tar.gz: 9ef26af07a6bf57fbc67f9267c9cb8e31323794d98a2dbde064fea259a82ba623d9e6efc6152ace851f9c4ea5ed752fda6e2d330df7e7e4e716c62026c8b55c3
|
data/lib/optic/rails/railtie.rb
CHANGED
@@ -6,12 +6,16 @@ module Optic
|
|
6
6
|
class Railtie < ::Rails::Railtie
|
7
7
|
initializer "optic_rails.launch_client_thread" do |app|
|
8
8
|
# TODO use tagged logger, make it clear which thread log messages are coming from
|
9
|
+
logger = ::Rails.logger
|
9
10
|
|
10
11
|
# Get configuration
|
11
|
-
|
12
|
-
|
12
|
+
if !app.config.respond_to? :optic_api_key
|
13
|
+
logger.warn "No optic_api_key found in Rails configuration, Optic agent will not run"
|
14
|
+
next
|
15
|
+
end
|
13
16
|
|
14
|
-
|
17
|
+
api_key = app.config.optic_api_key
|
18
|
+
uri = app.config.optic_uri
|
15
19
|
|
16
20
|
logger.debug "Starting supervisor thread"
|
17
21
|
supervisor = Thread.new do
|
data/lib/optic/rails/version.rb
CHANGED