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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b25dbf0f098f4a69d5833ac37a9e0b2c129cf63
4
- data.tar.gz: bcd17dc7a02835798595c9e9f7ff28d9b3c25a06
3
+ metadata.gz: 7fe06da9948bd4b055bbbd4a2cdfd9fb65ea47df
4
+ data.tar.gz: 03c5ef6ef57c78a97c11008a00bf2b669840448f
5
5
  SHA512:
6
- metadata.gz: 6b44916b7dc99550e1ebf9c1aa01d963b23e0f031b4b21fd1a7a78dd9cc9bc508d6b0754f1cd52a72c674ef5ba28a3b687cf00ceb571361914f0e79a285bc3aa
7
- data.tar.gz: cc05d5e53426cc30b91cd325bcb6914d34ba12f42b4965ae2149bada7ed7a0c560a425caee57d64d76a7693e6dfbe303be76b0d964a65870f2d625dfa2b96e38
6
+ metadata.gz: 3d0c1f9114d890b1cd2ffc4d901c69b0e2670eb4b49ebb7cc636bc0007cb687db67758148bef69b7c8b2793f38522ec936663bfcb01879c73576013070ea5834
7
+ data.tar.gz: 6bc4bcd743a8d3bcb439d2d3f3b185967f6f90b27b40c07f98e47f023491940a16359a3422674325fe1136545981c42d226f514b776a0b6c3930083790db0168
@@ -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
@@ -1,3 +1,7 @@
1
+ # 3.0.10
2
+
3
+ - Fix Sinatra with `config.disable_performance` (#44 [@skogsmaskin](https://github.com/skogsmaskin))
4
+
1
5
  # 3.0.9
2
6
 
3
7
  - Fix Rails 5 support
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.8'
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
- before_filter do
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.context` eg:
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 a almost complete rewrite of the Opbeat ruby client. It is not api compliant with version 2 and below.
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
 
@@ -1,4 +1,4 @@
1
1
  eval_gemfile File.expand_path('../Gemfile.base', __FILE__)
2
2
 
3
3
  gem 'rails', '~> 5.0.0'
4
- gem 'sinatra', github: 'sinatra'
4
+ gem 'sinatra', git: 'https://github.com/sinatra/sinatra.git'
@@ -1,7 +1,7 @@
1
1
  eval_gemfile File.expand_path('../Gemfile.base', __FILE__)
2
2
 
3
- gem 'rack', github: 'rack/rack', branch: 'master'
4
- gem 'arel', github: 'rails/arel', branch: 'master'
5
- gem 'rails', github: 'rails/rails', branch: 'master'
6
- gem 'sinatra', github: '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
- if route = env['sinatra.route']
13
- Opbeat.transaction(nil).endpoint = route
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] || 'Uknown template'.freeze
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)
@@ -1,3 +1,3 @@
1
1
  module Opbeat
2
- VERSION = "3.0.9"
2
+ VERSION = "3.0.10"
3
3
  end
@@ -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.9
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-08-30 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport