errplane 0.5.17 → 0.5.18
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/errplane/backtrace.rb +3 -1
- data/lib/errplane/version.rb +1 -1
- data/spec/unit/backtrace_spec.rb +21 -0
- metadata +27 -43
- data/.gitignore +0 -8
- data/.rspec +0 -2
- data/.travis.yml +0 -19
- data/Gemfile +0 -3
- data/Rakefile +0 -35
- data/config.ru +0 -7
- data/errplane.gemspec +0 -35
- data/gemfiles/Gemfile.rails-2.3.x +0 -8
- data/gemfiles/Gemfile.rails-3.0.x +0 -7
- data/gemfiles/Gemfile.rails-3.1.x +0 -7
- data/gemfiles/Gemfile.rails-3.2.x +0 -7
- data/generators/errplane/errplane_generator.rb +0 -43
- data/generators/errplane/templates/initializer.rb +0 -6
- data/rails/init.rb +0 -1
- data/spec/suite.sh +0 -39
data/lib/errplane/backtrace.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'active_support/core_ext/array/wrap'
|
2
|
+
|
1
3
|
module Errplane
|
2
4
|
class Backtrace
|
3
5
|
class Line
|
@@ -23,7 +25,7 @@ module Errplane
|
|
23
25
|
attr_reader :lines
|
24
26
|
|
25
27
|
def initialize(backtrace)
|
26
|
-
@lines = backtrace.each.collect do |line|
|
28
|
+
@lines = Array.wrap(backtrace).each.collect do |line|
|
27
29
|
Errplane.configuration.backtrace_filters.each do |filter|
|
28
30
|
line = filter.call(line)
|
29
31
|
end
|
data/lib/errplane/version.rb
CHANGED
data/spec/unit/backtrace_spec.rb
CHANGED
@@ -30,6 +30,27 @@ describe Errplane::Backtrace do
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
context "nil backtrace" do
|
34
|
+
before do
|
35
|
+
# Exception.new.backtrace == nil
|
36
|
+
@raw_backtrace = nil
|
37
|
+
|
38
|
+
@backtrace = Errplane::Backtrace.new(@raw_backtrace)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should accept an exception into the initializer" do
|
42
|
+
@backtrace.lines.should be_empty
|
43
|
+
@backtrace.lines.count.should == 0
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "#to_a" do
|
47
|
+
it "should return an array of lines" do
|
48
|
+
@backtrace.to_a.is_a?(Array).should be_true
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
33
54
|
describe "backtrace filters" do
|
34
55
|
before do
|
35
56
|
Errplane.configure do |config|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: errplane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &70140616228660 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70140616228660
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &70140616227180 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.3.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70140616227180
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: actionpack
|
38
|
-
requirement: &
|
38
|
+
requirement: &70140616225480 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.3.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70140616225480
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &70140616224360 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.0.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70140616224360
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: fakeweb
|
60
|
-
requirement: &
|
60
|
+
requirement: &70140616223880 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70140616223880
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: guard
|
71
|
-
requirement: &
|
71
|
+
requirement: &70140616223380 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70140616223380
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: guard-rspec
|
82
|
-
requirement: &
|
82
|
+
requirement: &70140616222840 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70140616222840
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rake
|
93
|
-
requirement: &
|
93
|
+
requirement: &70140616222320 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70140616222320
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: rdoc
|
104
|
-
requirement: &
|
104
|
+
requirement: &70140616221780 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70140616221780
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: rspec
|
115
|
-
requirement: &
|
115
|
+
requirement: &70140616221300 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70140616221300
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: tzinfo
|
126
|
-
requirement: &
|
126
|
+
requirement: &70140616220820 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,7 +131,7 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70140616220820
|
135
135
|
description: This gem provides implements instrumentation with Errplane for Rails
|
136
136
|
3.x applications.
|
137
137
|
email:
|
@@ -140,21 +140,6 @@ executables: []
|
|
140
140
|
extensions: []
|
141
141
|
extra_rdoc_files: []
|
142
142
|
files:
|
143
|
-
- .gitignore
|
144
|
-
- .rspec
|
145
|
-
- .travis.yml
|
146
|
-
- Gemfile
|
147
|
-
- README.md
|
148
|
-
- Rakefile
|
149
|
-
- config.ru
|
150
|
-
- errplane.gemspec
|
151
|
-
- gemfiles/Gemfile.rails-2.3.x
|
152
|
-
- gemfiles/Gemfile.rails-3.0.x
|
153
|
-
- gemfiles/Gemfile.rails-3.1.x
|
154
|
-
- gemfiles/Gemfile.rails-3.2.x
|
155
|
-
- generators/errplane/errplane_generator.rb
|
156
|
-
- generators/errplane/templates/initializer.rb
|
157
|
-
- lib/errplane.rb
|
158
143
|
- lib/errplane/backtrace.rb
|
159
144
|
- lib/errplane/black_box.rb
|
160
145
|
- lib/errplane/capistrano.rb
|
@@ -162,26 +147,26 @@ files:
|
|
162
147
|
- lib/errplane/logger.rb
|
163
148
|
- lib/errplane/max_queue.rb
|
164
149
|
- lib/errplane/rack.rb
|
165
|
-
- lib/errplane/rails.rb
|
166
150
|
- lib/errplane/rails/air_traffic_controller.rb
|
167
151
|
- lib/errplane/rails/benchmarking.rb
|
168
152
|
- lib/errplane/rails/instrumentation.rb
|
169
153
|
- lib/errplane/rails/middleware/hijack_render_exception.rb
|
170
154
|
- lib/errplane/rails/middleware/hijack_rescue_action_everywhere.rb
|
155
|
+
- lib/errplane/rails.rb
|
171
156
|
- lib/errplane/railtie.rb
|
172
157
|
- lib/errplane/resque.rb
|
173
158
|
- lib/errplane/sinatra.rb
|
174
159
|
- lib/errplane/transmitter.rb
|
175
160
|
- lib/errplane/version.rb
|
176
161
|
- lib/errplane/worker.rb
|
162
|
+
- lib/errplane.rb
|
177
163
|
- lib/rails/generators/errplane/errplane_generator.rb
|
178
164
|
- lib/rails/generators/errplane/templates/initializer.rb
|
179
|
-
-
|
165
|
+
- README.md
|
180
166
|
- spec/controllers/widgets_controller_spec.rb
|
181
167
|
- spec/integration/exceptions_spec.rb
|
182
168
|
- spec/integration/integration_helper.rb
|
183
169
|
- spec/spec_helper.rb
|
184
|
-
- spec/suite.sh
|
185
170
|
- spec/support/rails2/app/controllers/application_controller.rb
|
186
171
|
- spec/support/rails2/app/controllers/widgets_controller.rb
|
187
172
|
- spec/support/rails2/app/helpers/application_helper.rb
|
@@ -231,7 +216,6 @@ test_files:
|
|
231
216
|
- spec/integration/exceptions_spec.rb
|
232
217
|
- spec/integration/integration_helper.rb
|
233
218
|
- spec/spec_helper.rb
|
234
|
-
- spec/suite.sh
|
235
219
|
- spec/support/rails2/app/controllers/application_controller.rb
|
236
220
|
- spec/support/rails2/app/controllers/widgets_controller.rb
|
237
221
|
- spec/support/rails2/app/helpers/application_helper.rb
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 1.9.3
|
4
|
-
- 1.9.2
|
5
|
-
- jruby-18mode
|
6
|
-
- jruby-19mode
|
7
|
-
- 1.8.7
|
8
|
-
- ree
|
9
|
-
gemfile:
|
10
|
-
- gemfiles/Gemfile.rails-3.2.x
|
11
|
-
- gemfiles/Gemfile.rails-3.1.x
|
12
|
-
- gemfiles/Gemfile.rails-3.0.x
|
13
|
-
- gemfiles/Gemfile.rails-2.3.x
|
14
|
-
notifications:
|
15
|
-
email:
|
16
|
-
- mechanics@errplane.com
|
17
|
-
on_success: change
|
18
|
-
on_failure: always
|
19
|
-
script: rake spec
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
if ENV["BUNDLE_GEMFILE"] == File.expand_path("Gemfile")
|
4
|
-
ENV["BUNDLE_GEMFILE"] = "gemfiles/Gemfile.rails-3.2.x"
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'bundler'
|
8
|
-
Bundler::GemHelper.install_tasks
|
9
|
-
|
10
|
-
begin
|
11
|
-
targeted_files = ARGV.drop(1)
|
12
|
-
file_pattern = targeted_files.empty? ? 'spec/**/*_spec.rb' : targeted_files
|
13
|
-
|
14
|
-
require 'rspec/core'
|
15
|
-
require 'rspec/core/rake_task'
|
16
|
-
|
17
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
18
|
-
t.pattern = FileList[file_pattern]
|
19
|
-
end
|
20
|
-
|
21
|
-
RSpec.configure do |config|
|
22
|
-
config.color_enabled = true
|
23
|
-
config.tty = true
|
24
|
-
config.formatter = :documentation
|
25
|
-
end
|
26
|
-
rescue LoadError
|
27
|
-
require 'spec/rake/spectask'
|
28
|
-
|
29
|
-
puts file_pattern
|
30
|
-
|
31
|
-
Spec::Rake::SpecTask.new(:spec) do |t|
|
32
|
-
t.pattern = FileList[file_pattern]
|
33
|
-
t.spec_opts += ["--color"]
|
34
|
-
end
|
35
|
-
end
|
data/config.ru
DELETED
data/errplane.gemspec
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "errplane/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "errplane"
|
7
|
-
s.version = Errplane::VERSION
|
8
|
-
s.authors = ["Todd Persen"]
|
9
|
-
s.email = ["todd@errplane.com"]
|
10
|
-
s.homepage = "http://errplane.com"
|
11
|
-
s.summary = %q{Rails-based instrumentation library for Errplane.}
|
12
|
-
s.description = %q{This gem provides implements instrumentation with Errplane for Rails 3.x applications.}
|
13
|
-
|
14
|
-
s.rubyforge_project = "errplane"
|
15
|
-
|
16
|
-
s.files = `git ls-files`.split("\n")
|
17
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
-
s.require_paths = ["lib"]
|
20
|
-
|
21
|
-
s.licenses = ['MIT']
|
22
|
-
|
23
|
-
s.add_runtime_dependency 'json'
|
24
|
-
|
25
|
-
s.add_dependency 'activesupport', ['>= 2.3.4']
|
26
|
-
s.add_dependency 'actionpack', ['>= 2.3.4']
|
27
|
-
s.add_development_dependency 'bundler', ['>= 1.0.0']
|
28
|
-
s.add_development_dependency 'fakeweb', ['>= 0']
|
29
|
-
s.add_development_dependency 'guard', ['>= 0']
|
30
|
-
s.add_development_dependency 'guard-rspec', ['>= 0']
|
31
|
-
s.add_development_dependency 'rake', ['>= 0']
|
32
|
-
s.add_development_dependency 'rdoc', ['>= 0']
|
33
|
-
s.add_development_dependency 'rspec', ['>= 0']
|
34
|
-
s.add_development_dependency 'tzinfo', ['>= 0']
|
35
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
class ErrplaneGenerator < Rails::Generator::Base
|
2
|
-
def add_options!(option)
|
3
|
-
option.on("-k", "--api-key=API_KEY", String, "API key for your Errplane organization") {|v| options[:api_key] = v}
|
4
|
-
option.on("-a", "--application-id=APP_ID", String, "Your Errplane application id (optional)") {|v| options[:application_id] = v}
|
5
|
-
end
|
6
|
-
|
7
|
-
def manifest
|
8
|
-
if options[:api_key].blank?
|
9
|
-
puts "You must provide an API key using -k or --api-key."
|
10
|
-
exit
|
11
|
-
end
|
12
|
-
|
13
|
-
begin
|
14
|
-
puts "Contacting Errplane API"
|
15
|
-
application_name = "ApplicationName"
|
16
|
-
api_key = options[:api_key]
|
17
|
-
http = Net::HTTP.new("app.errplane.com", "80")
|
18
|
-
url = "/api/v1/applications?api_key=#{api_key}&name=#{application_name}"
|
19
|
-
response = http.post(url, nil)
|
20
|
-
@application = JSON.parse(response.body)
|
21
|
-
|
22
|
-
unless response.is_a?(Net::HTTPSuccess)
|
23
|
-
raise "The Errplane API returned an error: #{response.inspect}"
|
24
|
-
end
|
25
|
-
rescue => e
|
26
|
-
puts "We ran into a problem creating your application via the API!"
|
27
|
-
puts "If this issue persists, contact us at support@errplane.com with the following details:"
|
28
|
-
puts "#{e.class}: #{e.message}"
|
29
|
-
end
|
30
|
-
|
31
|
-
record do |m|
|
32
|
-
m.template "initializer.rb", "config/initializers/errplane.rb",
|
33
|
-
:assigns => {
|
34
|
-
:application_id => options[:application_id] || secure_random.hex(4),
|
35
|
-
:api_key => options[:api_key]
|
36
|
-
}
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def secure_random
|
41
|
-
defined?(SecureRandom) ? SecureRandom : ActiveSupport::SecureRandom
|
42
|
-
end
|
43
|
-
end
|
data/rails/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require "errplane/rails"
|
data/spec/suite.sh
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
|
4
|
-
source "$HOME/.rvm/scripts/rvm"
|
5
|
-
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
|
6
|
-
source "/usr/local/rvm/scripts/rvm"
|
7
|
-
else
|
8
|
-
printf "ERROR: An RVM installation was not found.\n"
|
9
|
-
fi
|
10
|
-
|
11
|
-
function build_version() {
|
12
|
-
echo "Bundling for Rails $1..."
|
13
|
-
BUNDLE_GEMFILE=gemfiles/Gemfile.rails-$1 bundle install --quiet
|
14
|
-
BUNDLE_GEMFILE=gemfiles/Gemfile.rails-$1 bundle exec rake -t spec
|
15
|
-
}
|
16
|
-
|
17
|
-
function build_versions() {
|
18
|
-
build_version "3.2.x"
|
19
|
-
build_version "3.1.x"
|
20
|
-
build_version "3.0.x"
|
21
|
-
build_version "2.3.x"
|
22
|
-
}
|
23
|
-
|
24
|
-
function build_with_ruby() {
|
25
|
-
rvm use ruby-$1@errplane_gem --create
|
26
|
-
build_versions
|
27
|
-
}
|
28
|
-
|
29
|
-
function build() {
|
30
|
-
build_with_ruby "1.9.3-p194"
|
31
|
-
build_with_ruby "1.9.2-p290"
|
32
|
-
build_with_ruby "1.8.7-p357"
|
33
|
-
}
|
34
|
-
|
35
|
-
function clean() {
|
36
|
-
rvm gemset empty errplane_gem --force
|
37
|
-
}
|
38
|
-
|
39
|
-
build
|