squash_rails 1.1.4 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/squash/rails/capistrano.rb +1 -1
- data/lib/squash/rails/configure.rb +1 -1
- data/lib/squash/rails/rack.rb +14 -0
- data/lib/squash/rails/sidekiq.rb +40 -0
- data/lib/squash/rails/tasks.rake +1 -1
- data/lib/squash/rails.rb +3 -1
- data/lib/squash/ruby/controller_methods.rb +1 -1
- data/lib/squash/ruby/railtie.rb +1 -1
- data/rails/init.rb +1 -1
- metadata +6 -5
data/lib/squash/rails/rack.rb
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2013 Square Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
module Squash
|
2
16
|
module Rails
|
3
17
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright 2013 Square Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Squash
|
16
|
+
|
17
|
+
# Sidekiq adapter for Squash. Reports all exceptions in Sidekiq to Squash,
|
18
|
+
# then re-raises them for Sidekiq to manage.
|
19
|
+
|
20
|
+
class Sidekiq
|
21
|
+
# @private
|
22
|
+
def call(worker, msg, queue)
|
23
|
+
begin
|
24
|
+
yield
|
25
|
+
rescue => err
|
26
|
+
Squash::Ruby.notify err,
|
27
|
+
:jid => worker.jid,
|
28
|
+
:sidekiq_message => msg,
|
29
|
+
:queue => queue
|
30
|
+
raise
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
::Sidekiq.configure_server do |config|
|
37
|
+
config.server_middleware do |chain|
|
38
|
+
chain.add ::Squash::Sidekiq
|
39
|
+
end
|
40
|
+
end
|
data/lib/squash/rails/tasks.rake
CHANGED
data/lib/squash/rails.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2013 Square Inc.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -60,3 +60,5 @@ module Squash::Ruby
|
|
60
60
|
alias_method_chain :exception_info_hash, :rails
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
require 'squash/rails/sidekiq' if defined?(Sidekiq)
|
data/lib/squash/ruby/railtie.rb
CHANGED
data/rails/init.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squash_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tim Morgan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-09-06 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: squash_ruby
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/squash/rails/capistrano.rb
|
118
118
|
- lib/squash/rails/configure.rb
|
119
119
|
- lib/squash/rails/rack.rb
|
120
|
+
- lib/squash/rails/sidekiq.rb
|
120
121
|
- lib/squash/rails/tasks.rake
|
121
122
|
- lib/squash/ruby/controller_methods.rb
|
122
123
|
- lib/squash/ruby/railtie.rb
|