metatron 0.4.1 → 0.4.2

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: 2e077b3763744566a11540f23c00100c813636642f9440b381aef95ddf63ab17
4
- data.tar.gz: 8a14ede3959144a065e97a06535127179476610b37b212ceb6387e67bf5c2299
3
+ metadata.gz: fe8d0dcac1a47b872ca203dea9ec4e816e07fdb2bb14fd01f6458ca4b7789cef
4
+ data.tar.gz: 255bc8c1efdd1c173455f3b28533ceffd70e34115aad86dba1f685dfceba1318
5
5
  SHA512:
6
- metadata.gz: cb66ff44a2eca8ff650fa31fd87722374fad25f9b6cfd5ba5361ff9a9e64f7488a9dab2322d5fdf4d03db8149858cc4b5be68a7e3b38ef4dc6ca84a303486512
7
- data.tar.gz: 922ef0d9e17f96d73f2ad0b6e9305017112dcaf286a480589d1451df53307e6fe8fbb1c34b1662b7f601b6ea78659c66b67007b8dbc4ee9aaa45943f2804be02
6
+ metadata.gz: ca1ba6ad7b4b5aa5677b6e7bbd30fe7b643f1f9459232a950d97684430fec3d3c7b710c327aa5a98e8d9324ebe457950df9acb1b50df0678eb875b2f869b6a8d
7
+ data.tar.gz: 1c7bc21979e3087dd5e55a381d7fddb9ade45159a72a105ba6d306dd60a8cb34828bad8d9a3ee7db6e1025f5b839e287a3bc21daaa834cb8aa49f31ade19943d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metatron (0.4.1)
4
+ metatron (0.4.2)
5
5
  json (~> 2.6)
6
6
  puma (~> 6.3)
7
7
  sinatra (~> 3.1)
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "metatron"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
@@ -8,7 +8,7 @@ module Metatron
8
8
  configure do
9
9
  set :protection, except: :http_origin
10
10
  set :logging, true
11
- set :logger, Metatron::LOGGER
11
+ set :logger, Metatron.logger
12
12
  set :show_exceptions, false
13
13
  end
14
14
 
@@ -6,7 +6,7 @@ module Metatron
6
6
  class Ping < Sinatra::Application
7
7
  configure do
8
8
  set :logging, true
9
- set :logger, Metatron::LOGGER
9
+ set :logger, Metatron.logger
10
10
  end
11
11
 
12
12
  before do
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Metatron
4
+ # Extension point for integrating with Rails applications
5
+ class Railtie < ::Rails::Railtie
6
+ initializer "metatron.logger" do
7
+ Metatron.logger = Rails.logger
8
+ end
9
+ end
10
+ end
@@ -4,6 +4,6 @@ module Metatron
4
4
  VERSION = [
5
5
  0, # major
6
6
  4, # minor
7
- 1 # patch
7
+ 2 # patch
8
8
  ].join(".")
9
9
  end
data/lib/metatron.rb CHANGED
@@ -16,10 +16,8 @@ module Metatron
16
16
  class Error < StandardError; end
17
17
  class ConfigError < Error; end
18
18
 
19
- LOGGER = Logger.new($stdout)
20
-
21
- # Set up log level
22
- LOGGER.level = ENV.fetch("LOG_LEVEL", :warn)
19
+ singleton_class.attr_accessor :logger
20
+ self.logger = Logger.new($stdout, level: ENV.fetch("LOG_LEVEL", :warn))
23
21
  end
24
22
 
25
23
  # Internal requirements
@@ -50,3 +48,4 @@ require "metatron/templates/stateful_set"
50
48
  require "metatron/controller"
51
49
  require "metatron/sync_controller"
52
50
  require "metatron/controllers/ping"
51
+ require "metatron/railtie" if defined? Rails::Railtie
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metatron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy
@@ -251,9 +251,11 @@ files:
251
251
  - LICENSE.txt
252
252
  - README.md
253
253
  - Rakefile
254
+ - bin/console
254
255
  - lib/metatron.rb
255
256
  - lib/metatron/controller.rb
256
257
  - lib/metatron/controllers/ping.rb
258
+ - lib/metatron/railtie.rb
257
259
  - lib/metatron/sync_controller.rb
258
260
  - lib/metatron/template.rb
259
261
  - lib/metatron/templates/cluster_role.rb