access_watch_rails 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/access_watch/rails_loader.rb +13 -5
- data/lib/access_watch/rails_version.rb +1 -1
- data/lib/access_watch_rails.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0073ce87b87fe163c64672fa182a90e5d54aa226
|
4
|
+
data.tar.gz: 8b1cf27e6774e606e1b256f6eb257e8692277f0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91e9e79e86ccb2160dcd353126996f32aa9cd54b4654010ffe1279ea8159ed4c6cb84da42764f08e6d52193902a6caa56edf567a7c823320e2761faddab66ec9
|
7
|
+
data.tar.gz: ab892811ba68b3761a4a37fdcada44a7be7fa45e6ee3bc4715b666788e3135dc6944e93d03c1f04d6659908542d94f9327df3ec7f6998093dccb276fc453d513
|
@@ -1,12 +1,20 @@
|
|
1
1
|
module AccessWacth
|
2
2
|
class RailsLoader
|
3
|
-
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
data/lib/access_watch_rails.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|