quiet_routes 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +3 -3
- data/lib/quiet_routes.rb +1 -1
- data/lib/quiet_routes/version.rb +1 -1
- data/test/test_quiet_routes.rb +8 -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: 9e715b416942d69af765a539ca08b65c76c0a8b6
|
4
|
+
data.tar.gz: 815085244792f1776c2d012d7fa4321f404830b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbdbba9ae6df8c073b4f929f12f17002fb2d5488cd867d876d0c24731d57eeb2fd05882df0ec4d0371350bfec71f639cbd826f5416031b2a2d509fcc066fd49c
|
7
|
+
data.tar.gz: 093a8f3ea95baf5c995ec164bbd016c5a254e726e219cad0058e1ac7b3c17c7828470b77c8b020f8fa8f385fec0de497964cbea9e90e5b46dc86e50dd80beb30
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# Quiet
|
1
|
+
# Quiet Routes
|
2
2
|
[![Continuous Integration status](https://secure.travis-ci.org/evrone/quiet_assets.png)](http://travis-ci.org/evrone/quiet_assets)
|
3
3
|
|
4
|
-
Quiet Routes
|
4
|
+
Quiet Routes implemented with reference to [quiet_assets](https://github.com/evrone/quiet_assets).
|
5
5
|
This is turns off the Rails particular log.
|
6
6
|
For example, this can suppress the access log of ping target from the load balancer.
|
7
7
|
|
@@ -21,7 +21,7 @@ Then, from the command line, run:
|
|
21
21
|
|
22
22
|
After installation, place the following in your `config/application.rb` file:
|
23
23
|
|
24
|
-
config.
|
24
|
+
config.quiet_routes = %w(/silent_route1 /silent_route2 ...)
|
25
25
|
|
26
26
|
## Contributing
|
27
27
|
|
data/lib/quiet_routes.rb
CHANGED
@@ -15,7 +15,7 @@ module QuietRoutes
|
|
15
15
|
Rails::Rack::Logger.class_eval do
|
16
16
|
def call_with_quiet_routes(env)
|
17
17
|
begin
|
18
|
-
if QUIET_PATHS.
|
18
|
+
if QUIET_PATHS.include?(env['PATH_INFO'])
|
19
19
|
env[KEY] = Rails.logger.level
|
20
20
|
Rails.logger.level = Logger::ERROR
|
21
21
|
end
|
data/lib/quiet_routes/version.rb
CHANGED
data/test/test_quiet_routes.rb
CHANGED
@@ -40,6 +40,7 @@ class HelperTest < Minitest::Unit::TestCase
|
|
40
40
|
routes {
|
41
41
|
root to: 'home#index'
|
42
42
|
get '/status', to: 'home#status'
|
43
|
+
get '/status/log', to: 'home#status'
|
43
44
|
}
|
44
45
|
end
|
45
46
|
end
|
@@ -69,10 +70,16 @@ class HelperTest < Minitest::Unit::TestCase
|
|
69
70
|
initialize! { config.quiet_routes = ['/status'] }
|
70
71
|
|
71
72
|
app.call request('/status')
|
72
|
-
|
73
73
|
assert_equal '', output.string
|
74
74
|
end
|
75
75
|
|
76
|
+
def test_status_log_url_with_quiet_routes_option
|
77
|
+
initialize! { config.quiet_routes = ['/status'] }
|
78
|
+
|
79
|
+
app.call request('/status/log')
|
80
|
+
assert_match(/Started GET \"\/status\/log\" for at/, output.string)
|
81
|
+
end
|
82
|
+
|
76
83
|
def test_in_multi_thread_env
|
77
84
|
initialize! { config.quiet_routes = ['/status'] }
|
78
85
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quiet_routes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Tanaka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|