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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2d81fd857f34eab10ccf08cd7bcd04daeec3690
4
- data.tar.gz: fc996cb6c05bac6debabdde2908e9c23fbff0231
3
+ metadata.gz: 9e715b416942d69af765a539ca08b65c76c0a8b6
4
+ data.tar.gz: 815085244792f1776c2d012d7fa4321f404830b9
5
5
  SHA512:
6
- metadata.gz: 2ebb852fc965e46e9f87f41e995c11fec83302f6584c365813f3fcefca02e542f44e5c9f173ad8fcef1ae0805cdd21cc214f0c6a4446885c83400aabd896cd6d
7
- data.tar.gz: dd17a21ed9287907ca22a69323ab8e0d9dffd8266ff1030875a51f076e54f6b8223f77a9dd516564cb339860d821a4a57bd51319ef9c3a0eabf1f21d5ce30506
6
+ metadata.gz: fbdbba9ae6df8c073b4f929f12f17002fb2d5488cd867d876d0c24731d57eeb2fd05882df0ec4d0371350bfec71f639cbd826f5416031b2a2d509fcc066fd49c
7
+ data.tar.gz: 093a8f3ea95baf5c995ec164bbd016c5a254e726e219cad0058e1ac7b3c17c7828470b77c8b020f8fa8f385fec0de497964cbea9e90e5b46dc86e50dd80beb30
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
+ gem 'pry'
3
+ gem 'pry-byebug'
2
4
 
3
5
  gem 'railties', :git => 'git://github.com/rails/rails.git', :branch => '4-1-stable'
4
6
 
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # Quiet Assets
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 has been made in referrence to [quiet_assets](https://github.com/evrone/quiet_assets).
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.quiet_assets = %w(pass_to_silent_route_list)
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.find { |path| env['PATH_INFO'].start_with?(path) }
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
@@ -1,3 +1,3 @@
1
1
  module QuietRoutes
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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.1
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-17 00:00:00.000000000 Z
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler