opbeat 3.0.9 → 3.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -11
- data/HISTORY.md +4 -0
- data/README.md +4 -4
- data/gemfiles/Gemfile.rails-5.0.x +1 -1
- data/gemfiles/Gemfile.rails-HEAD +4 -4
- data/lib/opbeat/injections/sinatra.rb +4 -3
- data/lib/opbeat/version.rb +1 -1
- data/spec/opbeat/integration/sinatra_spec.rb +41 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fe06da9948bd4b055bbbd4a2cdfd9fb65ea47df
|
4
|
+
data.tar.gz: 03c5ef6ef57c78a97c11008a00bf2b669840448f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d0c1f9114d890b1cd2ffc4d901c69b0e2670eb4b49ebb7cc636bc0007cb687db67758148bef69b7c8b2793f38522ec936663bfcb01879c73576013070ea5834
|
7
|
+
data.tar.gz: 6bc4bcd743a8d3bcb439d2d3f3b185967f6f90b27b40c07f98e47f023491940a16359a3422674325fe1136545981c42d226f514b776a0b6c3930083790db0168
|
data/.travis.yml
CHANGED
@@ -4,7 +4,6 @@ cache: bundler
|
|
4
4
|
env:
|
5
5
|
- CI=true
|
6
6
|
rvm:
|
7
|
-
- 1.9.3
|
8
7
|
- 2.0.0
|
9
8
|
- 2.1.6
|
10
9
|
- 2.2.3
|
@@ -21,16 +20,6 @@ matrix:
|
|
21
20
|
gemfile: gemfiles/Gemfile.rails-HEAD
|
22
21
|
|
23
22
|
exclude:
|
24
|
-
# Rails 4.0+ requires ruby 2.0+
|
25
|
-
- rvm: 1.9.3
|
26
|
-
gemfile: gemfiles/Gemfile.rails-4.0.x
|
27
|
-
- rvm: 1.9.3
|
28
|
-
gemfile: gemfiles/Gemfile.rails-4.1.x
|
29
|
-
- rvm: 1.9.3
|
30
|
-
gemfile: gemfiles/Gemfile.rails-4.2.x
|
31
|
-
# Rails 5.0+ requires ruby 2.2+
|
32
|
-
- rvm: 1.9.3
|
33
|
-
gemfile: gemfiles/Gemfile.rails-5.0.x
|
34
23
|
- rvm: 2.0.0
|
35
24
|
gemfile: gemfiles/Gemfile.rails-5.0.x
|
36
25
|
- rvm: 2.1.6
|
data/HISTORY.md
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
Add the following to your `Gemfile`:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'opbeat', '~> 3.0.
|
12
|
+
gem 'opbeat', '~> 3.0.9'
|
13
13
|
```
|
14
14
|
|
15
15
|
The Opbeat gem adheres to [Semantic
|
@@ -97,13 +97,13 @@ You may specify extra context for errors ahead of time by using `Opbeat.set_cont
|
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
class DashboardController < ApplicationController
|
100
|
-
|
100
|
+
before_action do
|
101
101
|
Opbeat.set_context(timezone: current_user.timezone)
|
102
102
|
end
|
103
103
|
end
|
104
104
|
```
|
105
105
|
|
106
|
-
or by specifying it as a block using `Opbeat.
|
106
|
+
or by specifying it as a block using `Opbeat.with_context` eg:
|
107
107
|
|
108
108
|
```ruby
|
109
109
|
Opbeat.with_context(user_id: @user.id) do
|
@@ -198,7 +198,7 @@ $ rspec spec
|
|
198
198
|
|
199
199
|
## Legacy
|
200
200
|
|
201
|
-
Be aware that 3.0 is
|
201
|
+
Be aware that 3.0 is an almost complete rewrite of the Opbeat ruby client. It is not api compliant with version 2 and below.
|
202
202
|
|
203
203
|
## Resources
|
204
204
|
|
data/gemfiles/Gemfile.rails-HEAD
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
eval_gemfile File.expand_path('../Gemfile.base', __FILE__)
|
2
2
|
|
3
|
-
gem 'rack',
|
4
|
-
gem 'arel',
|
5
|
-
gem 'rails',
|
6
|
-
gem 'sinatra',
|
3
|
+
gem 'rack', git: 'https://github.com/rack/rack.git'
|
4
|
+
gem 'arel', git: 'https://github.com/rails/arel.git'
|
5
|
+
gem 'rails', git: 'https://github.com/rails/rails.git'
|
6
|
+
gem 'sinatra', git: 'https://github.com/sinatra/sinatra.git'
|
7
7
|
|
@@ -9,8 +9,9 @@ module Opbeat
|
|
9
9
|
|
10
10
|
def dispatch!(*args, &block)
|
11
11
|
dispatch_without_opb!(*args, &block).tap do
|
12
|
-
|
13
|
-
|
12
|
+
transaction = Opbeat.transaction(nil)
|
13
|
+
if route = env['sinatra.route'] and transaction
|
14
|
+
transaction.endpoint = route
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
@@ -39,7 +40,7 @@ module Opbeat
|
|
39
40
|
alias render_without_opb render
|
40
41
|
|
41
42
|
def render(*args, &block)
|
42
|
-
sig = options[:__opbeat_template_sig] || '
|
43
|
+
sig = options[:__opbeat_template_sig] || 'Unknown template'.freeze
|
43
44
|
|
44
45
|
Opbeat.trace sig, KIND do
|
45
46
|
render_without_opb(*args, &block)
|
data/lib/opbeat/version.rb
CHANGED
@@ -63,4 +63,45 @@ module Opbeat
|
|
63
63
|
end
|
64
64
|
|
65
65
|
end
|
66
|
+
|
67
|
+
|
68
|
+
RSpec.describe "sinatra integration without perfomance" do
|
69
|
+
include Rack::Test::Methods
|
70
|
+
|
71
|
+
def config
|
72
|
+
@config ||= Opbeat::Configuration.new do |c|
|
73
|
+
c.app_id = 'X'
|
74
|
+
c.organization_id = 'Y'
|
75
|
+
c.secret_token = 'Z'
|
76
|
+
c.disable_worker = true
|
77
|
+
c.disable_performance = true
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
around do |example|
|
82
|
+
Opbeat.start! config
|
83
|
+
example.call
|
84
|
+
Opbeat.stop!
|
85
|
+
end
|
86
|
+
|
87
|
+
class TestApp < ::Sinatra::Base
|
88
|
+
disable :show_exceptions
|
89
|
+
use Opbeat::Middleware
|
90
|
+
|
91
|
+
get '/' do
|
92
|
+
erb "I am an inline template!"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def app
|
97
|
+
TestApp
|
98
|
+
end
|
99
|
+
|
100
|
+
it "wraps routes in transactions" do
|
101
|
+
get '/'
|
102
|
+
expect(Opbeat::Client.inst.pending_transactions.last).to be_nil
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
66
107
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opbeat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikkel Malmberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|