slowpoke 0.0.5 → 0.0.6

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: e62e08d7c8f539d12950be20902c145e767abb5f
4
- data.tar.gz: 83c6b4664e69bd932397535fc92aa4b06b1c130b
3
+ metadata.gz: 386bc598cac17cf2094f6260750e204fae2f1eb3
4
+ data.tar.gz: dbc8b84fbeb145cfc78ef211d033b7706a704287
5
5
  SHA512:
6
- metadata.gz: 4cda167ed1ea7d119fcb1ff9838a28b10985bf7062b00c10797cc9798748aacbd72129e709b1b95f44e2af4f5c92212bae1fb1296d140ce1f39d97719da7ac3e
7
- data.tar.gz: 8af57026d56a44421b8a1865c42fe70c8f15b52c1fd14f8d528924e16108a953561eb3fa9d46df51d3ecf379f4125ec5945008d955cfc6fc1e0189c06f923a01
6
+ metadata.gz: e8f0ec80ef1ee5c638ca7cddc25fd0592da42920dbcb5c5daaefb6b0cfb8de9afae611f69795e76a394a13c994f58b7ea171fc6dd5e9f1398296885be9ae0655
7
+ data.tar.gz: fcc475c88fcb9374ba26c1c7bd14bf132a378698300661d50709f0f3a2ace41a2ab94292f3098b8f31a6e4ad2fcc4500f6139c7e46451418d12bb03b03c52e03
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in slowpoke.gemspec
4
4
  gemspec
data/Rakefile CHANGED
@@ -1,2 +1 @@
1
1
  require "bundler/gem_tasks"
2
-
@@ -8,7 +8,6 @@ module Slowpoke
8
8
  def copy_503_html
9
9
  template "503.html", "public/503.html"
10
10
  end
11
-
12
11
  end
13
12
  end
14
13
  end
@@ -1,6 +1,6 @@
1
1
  require "slowpoke/version"
2
2
  require "rack-timeout"
3
- require "robustly"
3
+ require "safely_block"
4
4
  require "slowpoke/controller"
5
5
  require "slowpoke/postgres"
6
6
  require "slowpoke/railtie"
@@ -26,7 +26,6 @@ module Slowpoke
26
26
  def self.database_timeout
27
27
  @database_timeout ||= ENV["DATABASE_TIMEOUT"].to_i if ENV["DATABASE_TIMEOUT"]
28
28
  end
29
-
30
29
  end
31
30
 
32
31
  # custom error page
@@ -11,12 +11,11 @@ module Slowpoke
11
11
  def bubble_timeout
12
12
  yield
13
13
  rescue => exception
14
- if exception.respond_to?(:original_exception) and exception.original_exception.is_a?(Rack::Timeout::Error)
14
+ if exception.respond_to?(:original_exception) && exception.original_exception.is_a?(Rack::Timeout::Error)
15
15
  raise exception.original_exception
16
16
  else
17
17
  raise exception
18
18
  end
19
19
  end
20
-
21
20
  end
22
21
  end
@@ -10,7 +10,7 @@ module Slowpoke
10
10
  configure_connection_without_statement_timeout
11
11
  safely do
12
12
  timeout = Slowpoke.database_timeout || Slowpoke.timeout
13
- if timeout and !timeout.respond_to?(:call)
13
+ if timeout && !timeout.respond_to?(:call)
14
14
  if ActiveRecord::Base.logger
15
15
  ActiveRecord::Base.logger.silence do
16
16
  execute("SET statement_timeout = #{timeout * 1000}")
@@ -21,6 +21,5 @@ module Slowpoke
21
21
  end
22
22
  end
23
23
  end
24
-
25
24
  end
26
25
  end
@@ -1,10 +1,8 @@
1
1
  module Slowpoke
2
2
  class Railtie < Rails::Railtie
3
-
4
3
  initializer "slowpoke" do
5
4
  Rack::Timeout.timeout = Slowpoke.timeout
6
5
  ActiveRecord::Base.logger.class.send(:include, ::LoggerSilence) if ActiveRecord::Base.logger
7
6
  end
8
-
9
7
  end
10
8
  end
@@ -1,3 +1,3 @@
1
1
  module Slowpoke
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -1,15 +1,15 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'slowpoke/version'
4
+ require "slowpoke/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "slowpoke"
8
8
  spec.version = Slowpoke::VERSION
9
9
  spec.authors = ["Andrew Kane"]
10
10
  spec.email = ["andrew@chartkick.com"]
11
- spec.summary = %q{Timeouts made easy}
12
- spec.description = %q{Timeouts made easy}
11
+ spec.summary = "Timeouts made easy"
12
+ spec.description = "Timeouts made easy"
13
13
  spec.homepage = "https://github.com/ankane/slowpoke"
14
14
  spec.license = "MIT"
15
15
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "rack-timeout", ">= 0.1.0"
22
- spec.add_dependency "robustly"
22
+ spec.add_dependency "safely_block"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.7"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slowpoke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-04 00:00:00.000000000 Z
11
+ date: 2015-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack-timeout
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.1.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: robustly
28
+ name: safely_block
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="