access_watch_rails 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c771a0d72ea5fd1d9abef9afa700e8fd2d0ca14
4
- data.tar.gz: 2508fb05f8192b23daeba64d5ec79c0836462cc7
3
+ metadata.gz: 0073ce87b87fe163c64672fa182a90e5d54aa226
4
+ data.tar.gz: 8b1cf27e6774e606e1b256f6eb257e8692277f0b
5
5
  SHA512:
6
- metadata.gz: 4bc134a59d2196038d4a2c6818832f6d7635f63943870e60ded809a54ab7f9a2d868af031ecc204de7a6a639275ad967127fe8eee331ba77df0ac0b520a6c9a8
7
- data.tar.gz: 5a933d609219a04bb6c605972b24b92e61d1120298e6b18140338706b51fd402d67e4a9c18cab38c49a202571f978f1975022f09c169fd1d011395277821ee93
6
+ metadata.gz: 91e9e79e86ccb2160dcd353126996f32aa9cd54b4654010ffe1279ea8159ed4c6cb84da42764f08e6d52193902a6caa56edf567a7c823320e2761faddab66ec9
7
+ data.tar.gz: ab892811ba68b3761a4a37fdcada44a7be7fa45e6ee3bc4715b666788e3135dc6944e93d03c1f04d6659908542d94f9327df3ec7f6998093dccb276fc453d513
@@ -1,12 +1,20 @@
1
1
  module AccessWacth
2
2
  class RailsLoader
3
- def self.start
3
+ @started = false
4
+
5
+ def self.start_on_rails_initialization
4
6
  return if !defined?(Rails)
5
7
  Rails::Railtie.initializer "access_watch.detect_config_file" do
6
- if (path = Rails.root.join("config/access_watch.yml")).exist?
7
- if config = AccessWacth::RailsLoader.load_config_file(path)[Rails.env]
8
- Rails.application.config.middleware.use(AccessWatch::RackLogger, config.symbolize_keys)
9
- end
8
+ AccessWacth::RailsLoader.start
9
+ end
10
+ end
11
+
12
+ def self.start
13
+ return if @started
14
+ if (path = Rails.root.join("config/access_watch.yml")).exist?
15
+ if config = AccessWacth::RailsLoader.load_config_file(path)[Rails.env]
16
+ Rails.application.config.middleware.use(AccessWatch::RackLogger, config.symbolize_keys)
17
+ @started = true
10
18
  end
11
19
  end
12
20
  end
@@ -1,3 +1,3 @@
1
1
  module AccessWatch
2
- RAILS_VERSION = "0.1.0"
2
+ RAILS_VERSION = "0.1.1"
3
3
  end
@@ -8,5 +8,5 @@ require "access_watch/rails_version"
8
8
 
9
9
  if defined?(Rails)
10
10
  require "access_watch/rails_loader"
11
- AccessWacth::RailsLoader.start
11
+ AccessWacth::RailsLoader.start_on_rails_initialization
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: access_watch_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-03 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler