bugsify 1.0.3 → 1.0.6
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/SECURITY.md +21 -0
- data/bugsify.gemspec +12 -12
- data/lib/bugsify/{client.rb → client/client.rb} +1 -1
- data/lib/bugsify/config/config.rb +44 -0
- data/lib/bugsify/{engines → engine}/bugsify.rb +1 -2
- data/lib/bugsify/middleware/middleware.rb +18 -0
- data/lib/bugsify/{notifier.rb → notifier/notifier.rb} +13 -5
- data/lib/bugsify/parser/parser.rb +55 -0
- data/lib/bugsify/reporter/reporter.rb +17 -0
- data/lib/bugsify.rb +9 -8
- metadata +15 -18
- data/lib/bugsify/config.rb +0 -27
- data/lib/bugsify/middlewares/padrino.rb +0 -39
- data/lib/bugsify/middlewares/rails.rb +0 -42
- data/lib/bugsify/middlewares/sinatra.rb +0 -39
- data/lib/bugsify/reporters/rack.rb +0 -18
- data/lib/bugsify/reporters/rails.rb +0 -26
- data/lib/bugsify/version.rb +0 -5
- data/sig/bugsify.rbs +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 838dd41504e18f406fae5acd2ca9d503ffa57a9c7a17f0ac9ee80f5f4cca0e55
|
|
4
|
+
data.tar.gz: 8938abe6fe325774366e97adc7aa384508c66f2b58c06fba02b4f23b0c4e9945
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de161b06733c2e74c76826884e062e51e6b35227f408155a7c76b5c33f6f3d130acced17cde511cdf4387934966cd09497f7879e35f16388bfb509c137aa3df3
|
|
7
|
+
data.tar.gz: c5ff82ea0f5faf8a403b24f2add50c233c2945b2dc8e5347b51971a270b1c3831255cd96568100d1d27180edca8b42f39a7b7fca386d3e08e06c0754e7fdfab2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/SECURITY.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Use this section to tell people about which versions of your project are
|
|
6
|
+
currently being supported with security updates.
|
|
7
|
+
|
|
8
|
+
| Version | Supported |
|
|
9
|
+
| ------- | ------------------ |
|
|
10
|
+
| 5.1.x | :white_check_mark: |
|
|
11
|
+
| 5.0.x | :x: |
|
|
12
|
+
| 4.0.x | :white_check_mark: |
|
|
13
|
+
| < 4.0 | :x: |
|
|
14
|
+
|
|
15
|
+
## Reporting a Vulnerability
|
|
16
|
+
|
|
17
|
+
Use this section to tell people how to report a vulnerability.
|
|
18
|
+
|
|
19
|
+
Tell them where to go, how often they can expect to get an update on a
|
|
20
|
+
reported vulnerability, what to expect if the vulnerability is accepted or
|
|
21
|
+
declined, etc.
|
data/bugsify.gemspec
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative "lib/bugsify/
|
|
3
|
+
require_relative "lib/bugsify/config/config"
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name =
|
|
7
|
-
spec.version = Bugsify::VERSION
|
|
8
|
-
spec.authors =
|
|
9
|
-
spec.email =
|
|
6
|
+
spec.name = Bugsify::Config::NAME
|
|
7
|
+
spec.version = Bugsify::Config::VERSION
|
|
8
|
+
spec.authors = Bugsify::Config::AUTHORS
|
|
9
|
+
spec.email = Bugsify::Config::EMAIL
|
|
10
10
|
|
|
11
|
-
spec.summary =
|
|
12
|
-
spec.description =
|
|
13
|
-
spec.homepage =
|
|
14
|
-
spec.license =
|
|
15
|
-
spec.required_ruby_version =
|
|
11
|
+
spec.summary = Bugsify::Config::SUMMARY
|
|
12
|
+
spec.description = Bugsify::Config::DESCRIPTION
|
|
13
|
+
spec.homepage = Bugsify::Config::HOMEPAGE
|
|
14
|
+
spec.license = Bugsify::Config::LICENSE
|
|
15
|
+
spec.required_ruby_version = Bugsify::Config::REQUIRED_RUBY_VERSION
|
|
16
16
|
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
18
|
-
spec.metadata["source_code_uri"] =
|
|
19
|
-
spec.metadata["changelog_uri"] =
|
|
18
|
+
spec.metadata["source_code_uri"] = Bugsify::Config::SOURCE_CODE_URI
|
|
19
|
+
spec.metadata["changelog_uri"] = Bugsify::Config::CHANGELOG_URI
|
|
20
20
|
|
|
21
21
|
spec.files = Dir.chdir(__dir__) do
|
|
22
22
|
`git ls-files -z`.split("\x0").reject do |f|
|
|
@@ -12,7 +12,7 @@ module Bugsify
|
|
|
12
12
|
# rubocop:disable Metrics/AbcSize
|
|
13
13
|
# rubocop:disable Metrics/MethodLength
|
|
14
14
|
def request(uri, method, body = nil)
|
|
15
|
-
uri = URI.parse("https://
|
|
15
|
+
uri = URI.parse("https://server.codepop.co.rs/collectors/#{uri}")
|
|
16
16
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
17
17
|
http.use_ssl = true
|
|
18
18
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bugsify
|
|
4
|
+
# Config
|
|
5
|
+
module Config
|
|
6
|
+
def self.included(host_class)
|
|
7
|
+
host_class.extend ClassMethods
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# ClassMethods
|
|
11
|
+
module ClassMethods
|
|
12
|
+
def config
|
|
13
|
+
@config ||= Configuration.new
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def configure
|
|
17
|
+
yield config
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
extend ClassMethods
|
|
22
|
+
|
|
23
|
+
# Configuration
|
|
24
|
+
class Configuration
|
|
25
|
+
attr_accessor :api_key
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
specs = {
|
|
29
|
+
name: "bugsify",
|
|
30
|
+
version: "1.0.6",
|
|
31
|
+
authors: ["Aleksandar Popovic"],
|
|
32
|
+
email: ["aleksandar.popovic@hotmail.com"],
|
|
33
|
+
summary: "Ruby notifier for codepop.co.rs",
|
|
34
|
+
description: "Bugsify error monitoring & exception reporter for Ruby",
|
|
35
|
+
homepage: "https://github.com/CodepopTechnology/BugsifyRuby",
|
|
36
|
+
license: "MIT",
|
|
37
|
+
required_ruby_version: ">= 2.6.0",
|
|
38
|
+
source_code_uri: "https://github.com/CodepopTechnology/BugsifyRuby",
|
|
39
|
+
changelog_uri: "https://github.com/CodepopTechnology/BugsifyRuby/blob/main/CHANGELOG.md"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
specs.each { |k, v| const_set(k.upcase, v) }
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
if Gem.loaded_specs.key?("rails")
|
|
4
4
|
require "rails"
|
|
5
|
-
require_relative "../middlewares/rails"
|
|
6
5
|
|
|
7
6
|
module Bugsify
|
|
8
7
|
# BugsifyEngine
|
|
9
8
|
class BugsifyEngine < Rails::Engine
|
|
10
9
|
initializer "bugsify_engine.add_middleware" do |app|
|
|
11
|
-
app.middleware.use
|
|
10
|
+
app.middleware.use Middleware
|
|
12
11
|
end
|
|
13
12
|
end
|
|
14
13
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bugsify
|
|
4
|
+
# Middleware
|
|
5
|
+
class Middleware
|
|
6
|
+
include Parser
|
|
7
|
+
|
|
8
|
+
def initialize(app)
|
|
9
|
+
@app = app
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def call(env)
|
|
13
|
+
@app.call(env)
|
|
14
|
+
rescue Exception => e
|
|
15
|
+
Gem.loaded_specs.key?("rails") ? rails(e) : rack(e)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -3,8 +3,18 @@
|
|
|
3
3
|
module Bugsify
|
|
4
4
|
# Error
|
|
5
5
|
module Notifier
|
|
6
|
+
include Client
|
|
7
|
+
|
|
8
|
+
def capture_exception(exception)
|
|
9
|
+
raise "Argument #{exception} is not exception" unless exception.is_a?(Exception)
|
|
10
|
+
|
|
11
|
+
manual(exception)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
6
16
|
# rubocop:disable Metrics/MethodLength
|
|
7
|
-
def
|
|
17
|
+
def auto_capture_exception(args = {})
|
|
8
18
|
params = {
|
|
9
19
|
errorClass: args[:errorClass],
|
|
10
20
|
errorBacktrace: args[:errorBacktrace],
|
|
@@ -13,8 +23,8 @@ module Bugsify
|
|
|
13
23
|
applicationEnvironment: args[:applicationEnvironment]
|
|
14
24
|
}
|
|
15
25
|
|
|
16
|
-
|
|
17
|
-
"
|
|
26
|
+
Api.new.request(
|
|
27
|
+
"ruby",
|
|
18
28
|
"Post",
|
|
19
29
|
params,
|
|
20
30
|
&method(:parse)
|
|
@@ -22,8 +32,6 @@ module Bugsify
|
|
|
22
32
|
end
|
|
23
33
|
# rubocop:enable Metrics/MethodLength
|
|
24
34
|
|
|
25
|
-
private
|
|
26
|
-
|
|
27
35
|
def parse(response)
|
|
28
36
|
puts response
|
|
29
37
|
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "debug"
|
|
4
|
+
|
|
5
|
+
module Bugsify
|
|
6
|
+
# Rails
|
|
7
|
+
module Parser
|
|
8
|
+
include Reporter
|
|
9
|
+
|
|
10
|
+
def rails(e)
|
|
11
|
+
trace = e.backtrace.select { |l| l.start_with?(Rack::Directory.new("").root) }.join("\n ")
|
|
12
|
+
payload = {
|
|
13
|
+
error_class: e.class,
|
|
14
|
+
error_backtrace: "\n#{e.class}\n#{e.message}\n#{trace}",
|
|
15
|
+
error_full_backtrace: e.backtrace.select { |l| l }.join("\n "),
|
|
16
|
+
runtime_version: runtime_version
|
|
17
|
+
}
|
|
18
|
+
report(payload)
|
|
19
|
+
raise e
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def rack(e)
|
|
23
|
+
payload = {
|
|
24
|
+
error_class: e.class,
|
|
25
|
+
error_backtrace: e,
|
|
26
|
+
error_full_backtrace: "\n#{e.class}\n#{e.message}\n#{e}",
|
|
27
|
+
runtime_version: runtime_version
|
|
28
|
+
}
|
|
29
|
+
report(payload)
|
|
30
|
+
raise e
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def manual(e)
|
|
34
|
+
payload = {
|
|
35
|
+
error_class: e.class,
|
|
36
|
+
error_backtrace: e,
|
|
37
|
+
runtime_version: runtime_version
|
|
38
|
+
}
|
|
39
|
+
report(payload)
|
|
40
|
+
raise e
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def runtime_version
|
|
46
|
+
{
|
|
47
|
+
ruby_version: RUBY_VERSION,
|
|
48
|
+
ruby_release_date: RUBY_RELEASE_DATE,
|
|
49
|
+
ruby_platform: RUBY_PLATFORM,
|
|
50
|
+
load_path: $LOAD_PATH,
|
|
51
|
+
env: ENV
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bugsify
|
|
4
|
+
# Rack
|
|
5
|
+
module Reporter
|
|
6
|
+
# @param [Object] event
|
|
7
|
+
def report(event)
|
|
8
|
+
Bugsify.send(:auto_capture_exception, {
|
|
9
|
+
errorClass: event[:error_class],
|
|
10
|
+
errorBacktrace: event[:error_backtrace],
|
|
11
|
+
errorFullBacktrace: event[:error_full_backtrace],
|
|
12
|
+
runtimeVersion: event[:runtime_version],
|
|
13
|
+
applicationEnvironment: ENV.fetch("RACK_ENV", nil)
|
|
14
|
+
})
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/bugsify.rb
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "bugsify/
|
|
4
|
-
require "bugsify/
|
|
5
|
-
require "bugsify/
|
|
6
|
-
require "bugsify/
|
|
7
|
-
require "bugsify/
|
|
8
|
-
require "bugsify/
|
|
9
|
-
require "bugsify/
|
|
10
|
-
require "bugsify/middlewares/padrino" if Gem.loaded_specs.key?("padrino")
|
|
3
|
+
require "bugsify/config/config"
|
|
4
|
+
require "bugsify/client/client"
|
|
5
|
+
require "bugsify/reporter/reporter"
|
|
6
|
+
require "bugsify/parser/parser"
|
|
7
|
+
require "bugsify/middleware/middleware"
|
|
8
|
+
require "bugsify/notifier/notifier"
|
|
9
|
+
require "bugsify/engine/bugsify"
|
|
11
10
|
|
|
12
11
|
# Bugsify
|
|
13
12
|
module Bugsify
|
|
14
13
|
include Config
|
|
15
14
|
include Client
|
|
15
|
+
include Reporter
|
|
16
|
+
include Parser
|
|
16
17
|
extend Notifier
|
|
17
18
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bugsify
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aleksandar Popovic
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Bugsify error monitoring & exception reporter for Ruby
|
|
14
14
|
email:
|
|
@@ -30,27 +30,24 @@ files:
|
|
|
30
30
|
- Makefile
|
|
31
31
|
- README.md
|
|
32
32
|
- Rakefile
|
|
33
|
+
- SECURITY.md
|
|
33
34
|
- bugsify.gemspec
|
|
34
35
|
- lib/bugsify.rb
|
|
35
|
-
- lib/bugsify/client.rb
|
|
36
|
-
- lib/bugsify/config.rb
|
|
37
|
-
- lib/bugsify/
|
|
38
|
-
- lib/bugsify/
|
|
39
|
-
- lib/bugsify/
|
|
40
|
-
- lib/bugsify/
|
|
41
|
-
- lib/bugsify/
|
|
42
|
-
- lib/bugsify/reporters/rack.rb
|
|
43
|
-
- lib/bugsify/reporters/rails.rb
|
|
44
|
-
- lib/bugsify/version.rb
|
|
36
|
+
- lib/bugsify/client/client.rb
|
|
37
|
+
- lib/bugsify/config/config.rb
|
|
38
|
+
- lib/bugsify/engine/bugsify.rb
|
|
39
|
+
- lib/bugsify/middleware/middleware.rb
|
|
40
|
+
- lib/bugsify/notifier/notifier.rb
|
|
41
|
+
- lib/bugsify/parser/parser.rb
|
|
42
|
+
- lib/bugsify/reporter/reporter.rb
|
|
45
43
|
- lib/generators/bugsify/install_generator.rb
|
|
46
|
-
|
|
47
|
-
homepage: https://github.com/bugsify/bugsify_ruby
|
|
44
|
+
homepage: https://github.com/CodepopTechnology/BugsifyRuby
|
|
48
45
|
licenses:
|
|
49
46
|
- MIT
|
|
50
47
|
metadata:
|
|
51
|
-
homepage_uri: https://github.com/
|
|
52
|
-
source_code_uri: https://github.com/
|
|
53
|
-
changelog_uri: https://github.com/
|
|
48
|
+
homepage_uri: https://github.com/CodepopTechnology/BugsifyRuby
|
|
49
|
+
source_code_uri: https://github.com/CodepopTechnology/BugsifyRuby
|
|
50
|
+
changelog_uri: https://github.com/CodepopTechnology/BugsifyRuby/blob/main/CHANGELOG.md
|
|
54
51
|
rubygems_mfa_required: 'true'
|
|
55
52
|
post_install_message:
|
|
56
53
|
rdoc_options: []
|
|
@@ -70,5 +67,5 @@ requirements: []
|
|
|
70
67
|
rubygems_version: 3.3.7
|
|
71
68
|
signing_key:
|
|
72
69
|
specification_version: 4
|
|
73
|
-
summary: Ruby notifier for
|
|
70
|
+
summary: Ruby notifier for codepop.co.rs
|
|
74
71
|
test_files: []
|
data/lib/bugsify/config.rb
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Bugsify
|
|
4
|
-
# Config
|
|
5
|
-
module Config
|
|
6
|
-
def self.included(host_class)
|
|
7
|
-
host_class.extend ClassMethods
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# ClassMethods
|
|
11
|
-
module ClassMethods
|
|
12
|
-
def config
|
|
13
|
-
@config ||= Configuration.new
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def configure
|
|
17
|
-
yield config
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
extend ClassMethods
|
|
22
|
-
|
|
23
|
-
class Configuration
|
|
24
|
-
attr_accessor :api_key
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
if Gem.loaded_specs.key?("padrino")
|
|
4
|
-
require_relative "../reporters/rack"
|
|
5
|
-
|
|
6
|
-
module Bugsify
|
|
7
|
-
module Middleware
|
|
8
|
-
# Padrino
|
|
9
|
-
class Padrino
|
|
10
|
-
include Bugsify::Reporter::Rack
|
|
11
|
-
|
|
12
|
-
def initialize(app)
|
|
13
|
-
@app = app
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# rubocop:disable Metrics/MethodLength
|
|
17
|
-
# rubocop:disable Lint/RescueException
|
|
18
|
-
def call(env)
|
|
19
|
-
@app.call(env)
|
|
20
|
-
rescue Exception => e
|
|
21
|
-
payload = {
|
|
22
|
-
error_class: e.class,
|
|
23
|
-
error_backtrace: e,
|
|
24
|
-
error_full_backtrace: "\n#{e.class}\n#{e.message}\n#{e}",
|
|
25
|
-
runtime_version: {
|
|
26
|
-
padrino: Gem.loaded_specs["padrino"].version,
|
|
27
|
-
rack: Gem.loaded_specs["rake"].version,
|
|
28
|
-
ruby: RUBY_VERSION
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
notify(payload)
|
|
32
|
-
raise e
|
|
33
|
-
end
|
|
34
|
-
# rubocop:enable Metrics/MethodLength
|
|
35
|
-
# rubocop:enable Lint/RescueException
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
if Gem.loaded_specs.key?("rails")
|
|
4
|
-
require_relative "../reporters/rails"
|
|
5
|
-
|
|
6
|
-
module Bugsify
|
|
7
|
-
module Middleware
|
|
8
|
-
# Rails
|
|
9
|
-
class Rails
|
|
10
|
-
include Bugsify::Reporter::Rails
|
|
11
|
-
|
|
12
|
-
def initialize(app)
|
|
13
|
-
@app = app
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# rubocop:disable Metrics/MethodLength
|
|
17
|
-
# rubocop:disable Lint/RescueException
|
|
18
|
-
# rubocop:disable Metrics/AbcSize
|
|
19
|
-
def call(env)
|
|
20
|
-
@app.call(env)
|
|
21
|
-
rescue Exception => e
|
|
22
|
-
trace = e.backtrace.select { |l| l.start_with?(Rack::Directory.new("").root) }.join("\n ")
|
|
23
|
-
payload = {
|
|
24
|
-
error_class: e.class,
|
|
25
|
-
error_backtrace: "\n#{e.class}\n#{e.message}\n#{trace}",
|
|
26
|
-
error_full_backtrace: e.backtrace.select { |l| l }.join("\n "),
|
|
27
|
-
runtime_version: {
|
|
28
|
-
rails: Gem.loaded_specs["rails"].version,
|
|
29
|
-
rack: Gem.loaded_specs["rake"].version,
|
|
30
|
-
ruby: RUBY_VERSION
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
notify(payload)
|
|
34
|
-
raise e
|
|
35
|
-
end
|
|
36
|
-
# rubocop:enable Metrics/MethodLength
|
|
37
|
-
# rubocop:enable Lint/RescueException
|
|
38
|
-
# rubocop:enable Metrics/AbcSize
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
if Gem.loaded_specs.key?("sinatra")
|
|
4
|
-
require_relative "../reporters/rack"
|
|
5
|
-
|
|
6
|
-
module Bugsify
|
|
7
|
-
module Middleware
|
|
8
|
-
# Sinatra
|
|
9
|
-
class Sinatra
|
|
10
|
-
include Bugsify::Reporter::Rack
|
|
11
|
-
|
|
12
|
-
def initialize(app)
|
|
13
|
-
@app = app
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# rubocop:disable Metrics/MethodLength
|
|
17
|
-
# rubocop:disable Lint/RescueException
|
|
18
|
-
def call(env)
|
|
19
|
-
@app.call(env)
|
|
20
|
-
rescue Exception => e
|
|
21
|
-
payload = {
|
|
22
|
-
error_class: e.class,
|
|
23
|
-
error_backtrace: e,
|
|
24
|
-
error_full_backtrace: "\n#{e.class}\n#{e.message}\n#{e}",
|
|
25
|
-
runtime_version: {
|
|
26
|
-
padrino: Gem.loaded_specs["sinatra"].version,
|
|
27
|
-
rack: Gem.loaded_specs["rake"].version,
|
|
28
|
-
ruby: RUBY_VERSION
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
notify(payload)
|
|
32
|
-
raise e
|
|
33
|
-
end
|
|
34
|
-
# rubocop:enable Metrics/MethodLength
|
|
35
|
-
# rubocop:enable Lint/RescueException
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Bugsify
|
|
4
|
-
module Reporter
|
|
5
|
-
# Rack
|
|
6
|
-
module Rack
|
|
7
|
-
def notify(event)
|
|
8
|
-
Bugsify.auto_notify({
|
|
9
|
-
errorClass: event[:error_class],
|
|
10
|
-
errorBacktrace: event[:error_backtrace],
|
|
11
|
-
errorFullBacktrace: event[:error_full_backtrace],
|
|
12
|
-
runtimeVersion: event[:runtime_version],
|
|
13
|
-
applicationEnvironment: ENV["RACK_ENV"]
|
|
14
|
-
})
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Bugsify
|
|
4
|
-
module Reporter
|
|
5
|
-
# Rails
|
|
6
|
-
module Rails
|
|
7
|
-
# rubocop:disable Metrics/MethodLength
|
|
8
|
-
def notify(event)
|
|
9
|
-
semaphore = Thread::Mutex.new
|
|
10
|
-
|
|
11
|
-
Thread.new do
|
|
12
|
-
semaphore.synchronize do
|
|
13
|
-
Bugsify.auto_notify({
|
|
14
|
-
errorClass: event[:error_class],
|
|
15
|
-
errorBacktrace: event[:error_backtrace],
|
|
16
|
-
errorFullBacktrace: event[:error_full_backtrace],
|
|
17
|
-
runtimeVersion: event[:runtime_version],
|
|
18
|
-
applicationEnvironment: ENV["RACK_ENV"]
|
|
19
|
-
})
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
# rubocop:enable Metrics/MethodLength
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
data/lib/bugsify/version.rb
DELETED
data/sig/bugsify.rbs
DELETED