attache 1.1.2 → 1.1.3

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: ed983d0f82a9272db5f51699ad336baa2a007931
4
- data.tar.gz: 5b1642a3c9ffb783f75c40ac49e01dc1fb3fc02b
3
+ metadata.gz: 142d8bbaf242702c8f4ffc3dd138981bf5e36515
4
+ data.tar.gz: 489c6110a4ccf9d646537d0e29ae3be1febd9d71
5
5
  SHA512:
6
- metadata.gz: 6ab88eaa04aba0643c3573f2740b3f1e785bd0adaad6d9bce2b335046677cec85d2198419b5224c6aeba08536bfc50d61734932be5af3f3f118195ee93438af8
7
- data.tar.gz: ed3f27711b4f149b15fc68ffb50ae884c9906d4a399e1aa22cbad0fc6757d30c7412758f3ce1a953843dac3b0e9a3cc0b75cabf47e702e8283553f6434c4ab59
6
+ metadata.gz: 42ca943075fad7ef4c8897f617bfec5c758687d45b31c50ee6d841459b6bc53351bb47c3a62d5614041de7a85158b07e9723de3196ea06b46fac10dae5a61ef6
7
+ data.tar.gz: bdc7479ebc633564b8ab06208f4bdafa74ca4cd6631e83f9d08daeb5061f147c0ea34c864048fa95d557b151c1f0a2818153e5564cde31c62e789190c5ab4f97
data/Rakefile CHANGED
@@ -1,6 +1,16 @@
1
- require "bundler/gem_tasks"
2
- require 'rspec/core/rake_task'
3
- require 'attache/tasks'
1
+ if ENV['RACK_ENV'] == 'production'
2
+ # Heroku
3
+ # https://gist.github.com/Geesu/d0b58488cfae51f361c6
4
+ namespace :assets do
5
+ task 'precompile' do
6
+ puts "Not applicable"
7
+ end
8
+ end
9
+ else
10
+ require "bundler/gem_tasks"
11
+ require 'rspec/core/rake_task'
12
+ require 'attache/tasks'
4
13
 
5
- RSpec::Core::RakeTask.new(:spec)
6
- task :default => :spec
14
+ RSpec::Core::RakeTask.new(:spec)
15
+ task :default => :spec
16
+ end
@@ -25,9 +25,5 @@ class Attache::Backup < Attache::Base
25
25
  else
26
26
  @app.call(env)
27
27
  end
28
- rescue Exception
29
- Attache.logger.error $@
30
- Attache.logger.error $!
31
- [500, { 'X-Exception' => $!.to_s }, []]
32
28
  end
33
29
  end
data/lib/attache/base.rb CHANGED
@@ -5,6 +5,16 @@ class Attache::Base
5
5
  else
6
6
  @app.call(env)
7
7
  end
8
+ rescue Timeout::Error
9
+ Attache.logger.error $@
10
+ Attache.logger.error $!
11
+ Attache.logger.error "ERROR 503 #{env['PATH_INFO']} REFERER #{env['HTTP_REFERER'].inspect}"
12
+ [503, { 'X-Exception' => $!.to_s }, []]
13
+ rescue Exception
14
+ Attache.logger.error $@
15
+ Attache.logger.error $!
16
+ Attache.logger.error "ERROR 500 #{env['PATH_INFO']} REFERER #{env['HTTP_REFERER'].inspect}"
17
+ [500, { 'X-Exception' => $!.to_s }, []]
8
18
  end
9
19
 
10
20
  def vhost_for(host)
@@ -37,9 +37,5 @@ class Attache::Delete < Attache::Base
37
37
  else
38
38
  @app.call(env)
39
39
  end
40
- rescue Exception
41
- Attache.logger.error $@
42
- Attache.logger.error $!
43
- [500, { 'X-Exception' => $!.to_s }, []]
44
40
  end
45
41
  end
@@ -73,11 +73,6 @@ class Attache::Download < Attache::Base
73
73
  else
74
74
  @app.call(env)
75
75
  end
76
- rescue Exception
77
- Attache.logger.error $@
78
- Attache.logger.error $!
79
- Attache.logger.error "ERROR REFERER #{env['HTTP_REFERER'].inspect}"
80
- [500, { 'X-Exception' => $!.to_s }, []]
81
76
  end
82
77
 
83
78
  private
@@ -66,11 +66,6 @@ class Attache::Tus::Upload < Attache::Base
66
66
  else
67
67
  @app.call(env)
68
68
  end
69
- rescue Exception
70
- Attache.logger.error $@
71
- Attache.logger.error $!
72
- Attache.logger.error "ERROR REFERER #{env['HTTP_REFERER'].inspect}"
73
- [500, { 'X-Exception' => $!.to_s }, []]
74
69
  end
75
70
 
76
71
  private
@@ -33,11 +33,6 @@ class Attache::Upload < Attache::Base
33
33
  else
34
34
  @app.call(env)
35
35
  end
36
- rescue Exception
37
- Attache.logger.error $@
38
- Attache.logger.error $!
39
- Attache.logger.error "ERROR REFERER #{env['HTTP_REFERER'].inspect}"
40
- [500, { 'X-Exception' => $!.to_s }, []]
41
36
  end
42
37
 
43
38
  def self.sanitize(filename)
@@ -1,3 +1,3 @@
1
1
  module Attache
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - choonkeat
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-17 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack