appsignal 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWRiZDQ1ZWFiNDBlOTYyOGUxYWNiOGE3ZTU1NTJjZGZlNDBhZjFlOA==
4
+ YmJjMGRiZGFhZmQxMGU0N2MwMzkzNDQ1YmZhMjlkYzZkMDM0YmJjMA==
5
5
  data.tar.gz: !binary |-
6
- Yjg5MzZkM2ExODNkNmE5MzViZDliN2I3ZGM3NDA1NDUzMTUyOTI3ZA==
6
+ YTJhNzg1NTBmMDA4ZDlhZDU3YTgzY2YzNzMxOGVmY2RlNjI5YmY0Yw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTA4ZGMzY2M5ZDc3OWNlZmVkNzBjYjdhOWU0OTZiOTU2OTgxMTNiNmMwNDdj
10
- MjFjZjBkOGExZTBiNmNmMTIwMTE3ZmNlOGQ5YTVjOWMzMzdjNjA4NDNhNTg5
11
- MTdhZWYwZjA3ZDY2NTczOTI2ODBmNDBmZTg4YTQxMzRlYzRjN2I=
9
+ ZWNiMDkyZjI0MGNmZDE0Njg4ZDdkMGVhZWUzYWU2OTdkNzg2NmY5MzgwODAy
10
+ NjMwOTNiMmQyZGI5NGI2NWIwNjllNWMzMTQ3OWRjNDRmMDgxYzRiMDcxMjI0
11
+ MTY4ZTY3MjNkMWUxOGU1MTFjYjNjN2YxMTg4Zjc0OWUxMmNlMzc=
12
12
  data.tar.gz: !binary |-
13
- YTI5YTQzNzBhYzk3MTI3NWJkNzJmMDJiYmVkOGJjMmM3NTZhYzVjMDNhMTRh
14
- ODQ0ZDQxNDFjNzI2NTljNGM0MWEwZmYzNmJlMzRlYTRiMGFjY2RjZjQzNzNh
15
- MzlmNGVjOGQyN2U3YzM4MjRkZmYwMjIzMDY1MWQyZTdmMjE5M2Y=
13
+ MTk2ZjVjNTIxYjlmMTIwNDVhNDEyMmZkMzE2YWY3ODE2NWM3NDFhY2VhMWVk
14
+ YzA0OTgyODVhNmU2ZWZiMWI4NDE5YWI5N2RlNDlmYWExMTkzZGNmMTY1MTk1
15
+ ZmNhOTAyMGJkYTJjOTcxMmU3ZTQ4YmU1MDhjNDA4Yjg4YTcwYzQ=
@@ -1,31 +1,18 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 1.8.7
5
- - 1.9.2
6
4
  - 1.9.3
7
- - ree
8
- - ruby-head
9
- - jruby-18mode
5
+ - 2.0.0
10
6
  - jruby-19mode
11
- - jruby-head
12
7
 
13
8
  gemfile:
14
9
  - gemfiles/3.0.gemfile
15
10
  - gemfiles/3.1.gemfile
16
11
  - gemfiles/3.2.gemfile
17
- - gemfiles/edge.gemfile
12
+ - gemfiles/4.0.gemfile
18
13
 
19
14
  matrix:
20
- exclude:
21
- - rvm: 1.8.7
22
- gemfile: gemfiles/edge.gemfile
23
15
  allow_failures:
24
- - 1.8.7
25
- - gemfile: gemfiles/edge.gemfile
16
+ - rvm: jruby-19mode
26
17
 
27
18
  script: RAILS_ENV=test bundle exec rspec spec
28
-
29
- notifications:
30
- campfire: 80beans:d43f43244263cafb088182aa79e7d96419da0372@188927
31
- email: false
@@ -1,3 +1,6 @@
1
+ # 0.6.2
2
+ * Bugfix in backtrace cleaner usage for Rails 4
3
+
1
4
  # 0.6.1
2
5
  * Bugfix in Capistrano integration
3
6
 
data/README.md CHANGED
@@ -1,12 +1,16 @@
1
- appsignal
1
+ AppSignal agent
2
2
  =================
3
3
 
4
+ This gem collects error and performance data from your Rails
5
+ applications and sends it to [AppSignal](https://appsignal.com)
6
+
7
+ [![Build Status](https://travis-ci.org/appsignal/appsignal.png?branch=develop)](https://travis-ci.org/appsignal/appsignal)
8
+ [![Code Climate](https://codeclimate.com/github/appsignal/appsignal.png)](https://codeclimate.com/github/appsignal/appsignal)
4
9
 
5
10
  ## Pull requests / issues
6
11
 
7
12
  New features should be made in an issue or pullrequest. Title format is as follows:
8
13
 
9
-
10
14
  name [request_count]
11
15
 
12
16
  example
@@ -14,9 +18,10 @@ example
14
18
  tagging [2]
15
19
 
16
20
  ## Postprocessing middleware
17
- Appsignal logs Rails
21
+
22
+ Appsignal sends Rails
18
23
  [ActiveSupport::Notification](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html)-events
19
- to appsignal.com over SSL. These events contain basic metadata such as a name
24
+ to AppSignal over SSL. These events contain basic metadata such as a name
20
25
  and timestamps, and additional 'payload' log data. Appsignal uses a postprocessing
21
26
  middleware stack to clean up events before they get sent to appsignal.com. You
22
27
  can add your own middleware to this stack in `config/environment/my_env.rb`.
@@ -24,6 +29,7 @@ can add your own middleware to this stack in `config/environment/my_env.rb`.
24
29
  ### Examples
25
30
 
26
31
  #### Minimal template
32
+
27
33
  ```ruby
28
34
  class MiddlewareTemplate
29
35
  def call(event)
@@ -37,6 +43,7 @@ Appsignal.postprocessing_middleware.add MiddlewareTemplate
37
43
  ```
38
44
 
39
45
  #### Remove boring payloads
46
+
40
47
  ```ruby
41
48
  class RemoveBoringPayload
42
49
  def call(event)
data/Rakefile CHANGED
@@ -3,6 +3,7 @@ require 'appsignal/version'
3
3
  task :publish do
4
4
  NAME = 'appsignal'
5
5
  VERSION_FILE = 'lib/appsignal/version.rb'
6
+ CHANGELOG_FILE = 'CHANGELOG.md'
6
7
 
7
8
  raise '$EDITOR should be set' unless ENV['EDITOR']
8
9
 
@@ -49,6 +50,7 @@ task :publish do
49
50
  if changes.member?(VERSION_FILE)
50
51
  Appsignal.send(:remove_const, :VERSION)
51
52
  load File.expand_path(VERSION_FILE)
53
+ system("$EDITOR #{CHANGELOG_FILE}")
52
54
  build_and_push_gem
53
55
  create_and_push_tag
54
56
  else
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  source :rubygems
3
3
 
4
- gem 'rails', '~> 3.0.17'
4
+ gem 'rails', '~> 3.0'
5
5
  gem 'rspec'
6
6
  gem 'rake'
7
7
  gem 'json'
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  source :rubygems
3
3
 
4
- gem 'rails', '~> 3.1.8'
4
+ gem 'rails', '~> 3.1'
5
5
  gem 'rspec'
6
6
  gem 'rake'
7
7
  gem 'json'
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  source :rubygems
3
3
 
4
- gem 'rails', '~> 3.2.8'
4
+ gem 'rails', '~> 3.2'
5
5
  gem 'rspec'
6
6
  gem 'rake'
7
7
  gem 'json'
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  source :rubygems
3
3
 
4
- gem 'rails', :git => 'git://github.com/rails/rails.git'
4
+ gem 'rails', '~> 4.0'
5
5
  gem 'rspec'
6
6
  gem 'rake'
7
7
  gem 'json'
@@ -5,13 +5,16 @@ module Appsignal
5
5
  end
6
6
 
7
7
  class ExceptionNotification
8
- attr_reader :env, :exception, :kontroller, :request, :backtrace
8
+ attr_reader :env, :exception, :backtrace
9
9
 
10
- def initialize(env, exception, rails_cleaner=true)
10
+ def initialize(env, exception, run_rails_cleaner=true)
11
+ @env = env
11
12
  @exception = exception
12
- @backtrace = rails_cleaner && Rails.respond_to?(:backtrace_cleaner) ?
13
- Rails.backtrace_cleaner.send(:filter, exception.backtrace) :
14
- exception.backtrace
13
+ if run_rails_cleaner && Rails.respond_to?(:backtrace_cleaner)
14
+ @backtrace = Rails.backtrace_cleaner.clean(@exception.backtrace, nil)
15
+ else
16
+ @backtrace = @exception.backtrace
17
+ end
15
18
  end
16
19
 
17
20
  def name
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -25,7 +25,7 @@ describe Appsignal::AuthCheck do
25
25
 
26
26
  context "transmitting" do
27
27
  before do
28
- @transmitter = mock
28
+ @transmitter = double
29
29
  Appsignal::Transmitter.should_receive(:new).
30
30
  with('http://localhost:3000/1', 'auth', 'def').
31
31
  and_return(@transmitter)
@@ -46,7 +46,7 @@ describe Appsignal::Capistrano do
46
46
 
47
47
  context "proper setup" do
48
48
  before do
49
- @transmitter = mock()
49
+ @transmitter = double
50
50
  Appsignal::Transmitter.should_receive(:new).and_return(@transmitter)
51
51
  end
52
52
 
@@ -67,7 +67,7 @@ describe Appsignal::CLI do
67
67
  options
68
68
  )
69
69
  Appsignal::Marker.should_receive(:new).
70
- and_return(mock(:transmit => true))
70
+ and_return(double(:transmit => true))
71
71
  cli.notify_of_deploy(options)
72
72
  end
73
73
 
@@ -2,11 +2,37 @@ require 'spec_helper'
2
2
 
3
3
  describe Appsignal::ExceptionNotification do
4
4
  let(:error) { StandardError.new('moo') }
5
- let(:notification) { Appsignal::ExceptionNotification.new({}, error) }
5
+ let(:notification) { Appsignal::ExceptionNotification.new({}, error, false) }
6
6
  subject { notification }
7
- before { Rails.stub(:respond_to? => false) }
7
+ before do
8
+ Rails.stub(:root => '/home/app/current')
9
+ end
8
10
 
11
+ its(:env) { should == {} }
9
12
  its(:exception) { should == error }
10
13
  its(:name) { should == 'StandardError' }
11
14
  its(:message) { should == 'moo' }
15
+
16
+ context "backtrace" do
17
+ let(:backtrace) do
18
+ [
19
+ '/home/app/current/app/controllers/somethings_controller.rb:10',
20
+ '/user/local/ruby/path.rb:8'
21
+ ]
22
+ end
23
+ before { error.stub(:backtrace => backtrace) }
24
+
25
+ subject { notification.backtrace }
26
+
27
+ it { should == backtrace }
28
+
29
+ context "when running the backtrace cleaner" do
30
+ let(:notification) { Appsignal::ExceptionNotification.new({}, error) }
31
+
32
+ it { should == [
33
+ 'app/controllers/somethings_controller.rb:10',
34
+ '/user/local/ruby/path.rb:8'
35
+ ] }
36
+ end
37
+ end
12
38
  end
@@ -12,10 +12,10 @@ end
12
12
 
13
13
  describe Appsignal::Listener do
14
14
  describe '#call' do
15
- let(:app) { stub(:call => true) }
15
+ let(:app) { double(:call => true) }
16
16
  let(:env) { {'action_dispatch.request_id' => '1'} }
17
17
  let(:middleware) { Appsignal::Listener.new(app, {})}
18
- let(:current) { stub(:complete! => true, :add_exception => true) }
18
+ let(:current) { double(:complete! => true, :add_exception => true) }
19
19
  before { Appsignal::Transaction.stub(:current => current) }
20
20
 
21
21
  describe 'around call' do
@@ -18,7 +18,7 @@ describe Appsignal::Marker do
18
18
 
19
19
  context "transmit" do
20
20
  before do
21
- @transmitter = mock()
21
+ @transmitter = double
22
22
  Appsignal::Transmitter.should_receive(:new).
23
23
  with('http://localhost:3000/1', 'markers', 'abc').
24
24
  and_return(@transmitter)
@@ -7,8 +7,8 @@ describe Appsignal::Middleware do
7
7
  let(:entry) { entry_klass.new(object, {:foo => :bar}) }
8
8
 
9
9
  describe Appsignal::Middleware::Chain do
10
- let(:object) { mock(:object) }
11
- let(:other_object) { mock(:other_object) }
10
+ let(:object) { double(:object) }
11
+ let(:other_object) { double(:other_object) }
12
12
 
13
13
  describe "#initialize" do
14
14
  it "yields itself when passing a block" do
@@ -156,7 +156,7 @@ describe Appsignal::Middleware do
156
156
  describe Appsignal::Middleware::Entry do
157
157
 
158
158
  describe "#make_new" do
159
- let(:object) { mock }
159
+ let(:object) { double }
160
160
  subject { entry.make_new }
161
161
 
162
162
  it "initializes the passed object" do
@@ -36,7 +36,7 @@ describe Appsignal::Railtie do
36
36
 
37
37
  context "non action_controller event" do
38
38
  it "should call add_event for non action_controller event" do
39
- current = mock(:current)
39
+ current = double(:current)
40
40
  current.should_receive(:add_event)
41
41
  Appsignal::Transaction.should_receive(:current).twice.
42
42
  and_return(current)
@@ -47,7 +47,7 @@ describe Appsignal::Railtie do
47
47
 
48
48
  context "action_controller event" do
49
49
  it "should call set_process_action_event for action_controller event" do
50
- current = mock(:current)
50
+ current = double(:current)
51
51
  current.should_receive(:set_process_action_event)
52
52
  current.should_receive(:add_event)
53
53
  Appsignal::Transaction.should_receive(:current).exactly(3).times.
@@ -49,7 +49,7 @@ describe Appsignal::Transaction do
49
49
  end
50
50
 
51
51
  describe '#add_event' do
52
- let(:event) { mock(:event, :name => 'test') }
52
+ let(:event) { double(:event, :name => 'test') }
53
53
 
54
54
  it 'should add an event' do
55
55
  expect {
@@ -59,7 +59,7 @@ describe Appsignal::Transaction do
59
59
  end
60
60
 
61
61
  context "using exceptions" do
62
- let(:exception) { mock(:exception, :name => 'test') }
62
+ let(:exception) { double(:exception, :name => 'test') }
63
63
 
64
64
  describe '#add_exception' do
65
65
  it 'should add an exception' do
@@ -225,7 +225,7 @@ describe Appsignal::Transaction do
225
225
  end
226
226
 
227
227
  describe '#complete!' do
228
- let(:event) { mock(:event) }
228
+ let(:event) { double(:event) }
229
229
  before { transaction.set_process_action_event(notification_event) }
230
230
 
231
231
  it 'should remove transaction from the list' do
@@ -19,8 +19,8 @@ describe Appsignal::Transmitter do
19
19
  end
20
20
 
21
21
  describe "#transmit" do
22
- let(:response) { mock(:response, :code => '200') }
23
- let(:http_client) { mock(:request, :request => response) }
22
+ let(:response) { double(:response, :code => '200') }
23
+ let(:http_client) { double(:request, :request => response) }
24
24
  before { instance.stub(:http_client => http_client) }
25
25
 
26
26
  subject { instance.transmit(:shipit => :payload) }
@@ -30,7 +30,7 @@ describe Appsignal::Transmitter do
30
30
 
31
31
  describe "#http_post" do
32
32
  it "calls Net::HTTP.post_form with the correct params" do
33
- post = mock(:post)
33
+ post = double(:post)
34
34
  post.should_receive(:[]=).
35
35
  with('Content-Type', 'application/json; charset=UTF-8')
36
36
  post.should_receive(:[]=).
@@ -105,7 +105,7 @@ describe Appsignal do
105
105
 
106
106
  describe ".send_exception" do
107
107
  it "should raise exception" do
108
- agent = mock
108
+ agent = double
109
109
  Appsignal.should_receive(:agent).exactly(3).times.and_return(agent)
110
110
  agent.should_receive(:send_queue)
111
111
  agent.should_receive(:enqueue).with(kind_of(Appsignal::Transaction))
@@ -19,7 +19,7 @@ describe AppsignalGenerator do
19
19
  context "known key" do
20
20
  before do
21
21
  prepare_destination
22
- authcheck = mock()
22
+ authcheck = double
23
23
  Appsignal::AuthCheck.should_receive(:new).and_return(authcheck)
24
24
  authcheck.should_receive(:perform_with_result).
25
25
  and_return(['200', 'everything ok'])
@@ -34,7 +34,7 @@ describe AppsignalGenerator do
34
34
  context "invalid key" do
35
35
  before do
36
36
  prepare_destination
37
- authcheck = mock()
37
+ authcheck = double
38
38
  Appsignal::AuthCheck.should_receive(:new).and_return(authcheck)
39
39
  authcheck.should_receive(:perform_with_result).
40
40
  and_return(['401', 'unauthorized'])
@@ -49,7 +49,7 @@ describe AppsignalGenerator do
49
49
  context "failed check" do
50
50
  before do
51
51
  prepare_destination
52
- authcheck = mock()
52
+ authcheck = double
53
53
  Appsignal::AuthCheck.should_receive(:new).and_return(authcheck)
54
54
  authcheck.should_receive(:perform_with_result).
55
55
  and_return(['500', 'error!'])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-06-19 00:00:00.000000000 Z
15
+ date: 2013-08-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rails
@@ -134,7 +134,7 @@ files:
134
134
  - gemfiles/3.0.gemfile
135
135
  - gemfiles/3.1.gemfile
136
136
  - gemfiles/3.2.gemfile
137
- - gemfiles/edge.gemfile
137
+ - gemfiles/4.0.gemfile
138
138
  - lib/appsignal.rb
139
139
  - lib/appsignal/agent.rb
140
140
  - lib/appsignal/aggregator.rb