webvalve 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/webvalve/railtie.rb +5 -3
- data/lib/webvalve/version.rb +1 -1
- data/lib/webvalve.rb +18 -11
- 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: d20ff6188f40da891f473d759c59756663969c5d
|
4
|
+
data.tar.gz: 25c6f27d9285afaa2d0affe93f1e6b34052b9d64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c71debf9c31b8df724f6bf5751630a180dce3de6a3e3888057874abbb9533f6f8fca46b2198658eb3a00898792252c27dbb3aca041bbfc5e8a36737b46eb660
|
7
|
+
data.tar.gz: 197ad5715b1851d086b8ead3550318a937468bfa9b6b92072fb7743252a6075aac0db5882df8a4d0b2fb94743210fc242181785cc47e2b585dadc11c7a1c1143
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.9.7] - 2018-09-30
|
10
|
+
### Changed
|
11
|
+
- Improved WEBVALVED_ENABLED behavior from @haffla (https://github.com/Betterment/webvalve/pull/24)
|
12
|
+
|
9
13
|
## [0.9.6] - 2018-06-27
|
10
14
|
### Changed
|
11
15
|
- fix changelog links
|
@@ -14,6 +18,7 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/
|
|
14
18
|
### Changed
|
15
19
|
- WebMock 3+ support from @messanjah (https://github.com/Betterment/webvalve/pull/22)
|
16
20
|
|
17
|
-
[Unreleased]: https://github.com/Betterment/webvalve/compare/v0.9.
|
21
|
+
[Unreleased]: https://github.com/Betterment/webvalve/compare/v0.9.7...HEAD
|
22
|
+
[0.9.7]: https://github.com/Betterment/webvalve/compare/v0.9.6...v0.9.7
|
18
23
|
[0.9.6]: https://github.com/Betterment/webvalve/compare/v0.9.5...v0.9.6
|
19
24
|
[0.9.5]: https://github.com/Betterment/webvalve/compare/v0.9.4...v0.9.5
|
data/lib/webvalve/railtie.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
module WebValve
|
2
2
|
class Railtie < ::Rails::Railtie
|
3
|
-
|
4
|
-
|
3
|
+
initializer 'webvalve.set_autoload_paths', before: :set_autoload_paths do |app|
|
4
|
+
if WebValve.enabled?
|
5
5
|
WebValve.config_paths << app.root
|
6
6
|
|
7
7
|
WebValve.config_paths.each do |root|
|
8
8
|
app.config.eager_load_paths << root.join('webvalve').to_s
|
9
9
|
end
|
10
10
|
end
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
+
initializer 'webvalve.setup' do
|
14
|
+
if WebValve.enabled?
|
13
15
|
WebValve.config_paths.each do |root|
|
14
16
|
path = root.join('config', 'webvalve.rb').to_s
|
15
17
|
load path if File.exist?(path)
|
data/lib/webvalve/version.rb
CHANGED
data/lib/webvalve.rb
CHANGED
@@ -16,6 +16,7 @@ module WebValve
|
|
16
16
|
# @!method reset
|
17
17
|
# @see WebValve::Manager#reset
|
18
18
|
delegate :setup, :register, :whitelist_url, :reset, to: :manager
|
19
|
+
attr_writer :logger
|
19
20
|
|
20
21
|
def enabled?
|
21
22
|
if env.in?(ALWAYS_ENABLED_ENVS)
|
@@ -35,8 +36,24 @@ module WebValve
|
|
35
36
|
@config_paths ||= Set.new
|
36
37
|
end
|
37
38
|
|
39
|
+
def logger
|
40
|
+
@logger ||=
|
41
|
+
if defined?(::Rails)
|
42
|
+
# Rails.logger can be nil
|
43
|
+
::Rails.logger || default_logger
|
44
|
+
else
|
45
|
+
default_logger
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def default_logger
|
50
|
+
ActiveSupport::Logger.new(STDOUT).tap do |l|
|
51
|
+
l.formatter = ::Logger::Formatter.new
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
38
55
|
if defined?(::Rails)
|
39
|
-
delegate :env, :env=,
|
56
|
+
delegate :env, :env=, to: ::Rails
|
40
57
|
else
|
41
58
|
def env
|
42
59
|
@env ||= (ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development').inquiry
|
@@ -45,16 +62,6 @@ module WebValve
|
|
45
62
|
def env=(env)
|
46
63
|
@env = env&.inquiry
|
47
64
|
end
|
48
|
-
|
49
|
-
def logger
|
50
|
-
@logger ||= ActiveSupport::Logger.new(STDOUT).tap do |l|
|
51
|
-
l.formatter = ::Logger::Formatter.new
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def logger=(logger)
|
56
|
-
@logger = logger
|
57
|
-
end
|
58
65
|
end
|
59
66
|
|
60
67
|
def manager
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webvalve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|