optic-rails 0.0.3 → 0.0.4

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: 037a36f5c71f671b7a16453a1607bd13ef93d7eb854ced372d6acf07009012a5
4
- data.tar.gz: a1ce7fc57558e87b59f9614c1bd76dcb160ff312470423d945a364811c4be121
3
+ metadata.gz: 023f0944331b5b023b4dbe243e3d22de5f1b3da3b98862dd9e037c570106fd6e
4
+ data.tar.gz: b733b63462a0cd702303730b9211d886acf662d96d5de19ae0cbfb74318e45c7
5
5
  SHA512:
6
- metadata.gz: bfa40babcd6bbef3b11661c1f0683b271517c5032f02fa3326a81638eb73a632cd77bc31ebb6afc02174d60541a06116e30c19f1c643a36554beb3c2f1487250
7
- data.tar.gz: 81b948991bd3fea677fdd4a883bb7fbad0b31859dd1597eb5692b4a8c11110d0be7336d06655902bcf1dee18576e8aaa49efecb2a58d4f1e9903edebbda508af
6
+ metadata.gz: c97a65a391fabb9a134dcd2078cc86d47b3fa81082b65fc85e0251d13074e1f481a3ed23f1471aee5c5189d683dd43d1c1e179d88b7b75cb2a5d2b54df9d8ec4
7
+ data.tar.gz: 9ef26af07a6bf57fbc67f9267c9cb8e31323794d98a2dbde064fea259a82ba623d9e6efc6152ace851f9c4ea5ed752fda6e2d330df7e7e4e716c62026c8b55c3
@@ -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
- api_key = app.config.optic_api_key # TODO fail gracefully if missing
12
- uri = app.config.optic_uri
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
- logger = ::Rails.logger
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
@@ -1,5 +1,5 @@
1
1
  module Optic
2
2
  module Rails
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optic-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Vaynshtok