errplane 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,7 @@ gemfile:
10
10
  - gemfiles/Gemfile.rails-3.2.x
11
11
  - gemfiles/Gemfile.rails-3.1.x
12
12
  - gemfiles/Gemfile.rails-3.0.x
13
+ - gemfiles/Gemfile.rails-2.3.x
13
14
  notifications:
14
15
  email:
15
16
  - mechanics@errplane.com
@@ -0,0 +1,8 @@
1
+ source :rubygems
2
+
3
+ gem 'rails', '~> 2.3.14'
4
+ gem 'rspec', '~> 1.3'
5
+ gem 'rspec-rails', '~> 1.3'
6
+ gem 'test-unit', "1.2.3"
7
+
8
+ gemspec :path => '../'
@@ -0,0 +1,43 @@
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
@@ -0,0 +1,6 @@
1
+ require "errplane"
2
+
3
+ Errplane.configure do |config|
4
+ config.api_key = "<%= api_key %>"
5
+ config.application_id = "<%= application_id %>"
6
+ end
@@ -20,6 +20,28 @@ module Errplane
20
20
  config.framework = "Rails"
21
21
  config.framework_version = ::Rails.version
22
22
  end
23
+
24
+ if defined?(ActiveSupport::Notifications)
25
+ ActiveSupport::Notifications.subscribe do |name, start, finish, id, payload|
26
+ if Errplane.configuration.instrumentation_enabled?
27
+ h = { :name => name,
28
+ :start => start,
29
+ :finish => finish,
30
+ :nid => id,
31
+ :payload => payload,
32
+ :source => "active_support"}
33
+ Errplane.queue.push_or_discard(h)
34
+ end
35
+ end
36
+ end
37
+
38
+ if defined?(PhusionPassenger)
39
+ PhusionPassenger.on_event(:starting_worker_process) do |forked|
40
+ Errplane::Worker.spawn_threads() if forked
41
+ end
42
+ else
43
+ Errplane::Worker.spawn_threads()
44
+ end
23
45
  end
24
46
  end
25
47
  end
@@ -1,3 +1,3 @@
1
1
  module Errplane
2
- VERSION = "0.5.8"
2
+ VERSION = "0.5.9"
3
3
  end
@@ -0,0 +1 @@
1
+ require "errplane/rails"
@@ -2,7 +2,23 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
  ENV["RAILS_ENV"] ||= "test"
4
4
 
5
- require 'rails'
5
+ require 'rails/version'
6
+
7
+ if Rails::VERSION::MAJOR > 2
8
+ require 'rails'
9
+ else
10
+ module Rails
11
+ class << self
12
+ def vendor_rails?; return false; end
13
+ end
14
+
15
+ class Configuration
16
+ def after_initialize; end
17
+ end
18
+ @@configuration = Configuration.new
19
+ end
20
+ require 'initializer'
21
+ end
6
22
 
7
23
  require 'bundler/setup'
8
24
  Bundler.require
@@ -13,9 +29,16 @@ FakeWeb.allow_net_connect = false
13
29
  if defined? Rails
14
30
  puts "Loading Rails v#{Rails.version}..."
15
31
 
16
- require "support/rails3/app"
17
- require "rspec/rails"
18
- else
19
- puts "ERROR: Rails could not be loaded."
20
- exit
32
+ if Rails.version.to_f < 3.0
33
+ RAILS_ROOT = "#{File.dirname(__FILE__)}/support/rails2"
34
+ require "#{RAILS_ROOT}/config/environment"
35
+ require "spec/rails"
36
+ else
37
+ require "support/rails3/app"
38
+ require "rspec/rails"
39
+ end
40
+ end
41
+
42
+ if defined? Sinatra
43
+ require 'spec_helper_for_sinatra'
21
44
  end
@@ -18,6 +18,7 @@ function build_versions() {
18
18
  build_version "3.2.x"
19
19
  build_version "3.1.x"
20
20
  build_version "3.0.x"
21
+ build_version "2.3.x"
21
22
  }
22
23
 
23
24
  function build_with_ruby() {
@@ -0,0 +1,4 @@
1
+ class ApplicationController < ActionController::Base
2
+ helper :all
3
+ protect_from_forgery
4
+ end
@@ -0,0 +1,4 @@
1
+ class WidgetsController < ApplicationController
2
+ def index; render :nothing => true; end
3
+ def new; return 1/0; end
4
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module WidgetsHelper
2
+ end
@@ -0,0 +1,4 @@
1
+ Rails::Initializer.run do |config|
2
+ config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
3
+ config.time_zone = 'UTC'
4
+ end
@@ -0,0 +1 @@
1
+ ActionController::Base.cookie_verifier_secret = '171a91942320ec70c77a53d50cf62835b06a9e9e3ee8e9f045d4fe195965b9d5b30ceed7570ac6d77c20ca561229625be0cf987e8342b14f499033a271480970';
@@ -0,0 +1,6 @@
1
+ Errplane.configure do |config|
2
+ config.api_key = "f123-e456-d789c012"
3
+ config.application_id = "b12r8c72"
4
+ end
5
+
6
+ MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1]
@@ -0,0 +1,8 @@
1
+ if defined?(ActiveRecord)
2
+ ActiveRecord::Base.include_root_in_json = true
3
+ ActiveRecord::Base.store_full_sti_class = true
4
+ end
5
+
6
+ ActionController::Routing.generate_best_match = false
7
+ ActiveSupport.use_standard_json_time_format = true
8
+ ActiveSupport.escape_html_entities_in_json = false
@@ -0,0 +1,4 @@
1
+ ActionController::Base.session = {
2
+ :key => '_rails-2.3_session',
3
+ :secret => '76cc9f32d38e9b6227bd663076edcf28cc915dc3021da204763a73dbd0d2741f6f7074af21400d4f8f9ef6c4db72487c467edf4a1dfec732835c5674a9846dd7'
4
+ }
@@ -0,0 +1,3 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+ map.resources :widgets
3
+ end
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.8
4
+ version: 0.5.9
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-11-17 00:00:00.000000000 Z
12
+ date: 2012-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70177908401580 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70177908401580
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: activesupport
27
- requirement: &70177908396000 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: 2.3.14
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70177908396000
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 2.3.14
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: actionpack
38
- requirement: &70177908395120 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: 2.3.14
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70177908395120
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.3.14
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: bundler
49
- requirement: &70177908394640 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: 1.0.0
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70177908394640
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.0.0
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: fakeweb
60
- requirement: &70177908394020 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70177908394020
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: guard
71
- requirement: &70177908393320 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: '0'
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *70177908393320
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: guard-rspec
82
- requirement: &70177908392600 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
@@ -87,10 +117,15 @@ dependencies:
87
117
  version: '0'
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *70177908392600
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: rake
93
- requirement: &70177908392120 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ! '>='
@@ -98,10 +133,15 @@ dependencies:
98
133
  version: '0'
99
134
  type: :development
100
135
  prerelease: false
101
- version_requirements: *70177908392120
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
102
142
  - !ruby/object:Gem::Dependency
103
143
  name: rdoc
104
- requirement: &70177908391640 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
105
145
  none: false
106
146
  requirements:
107
147
  - - ! '>='
@@ -109,10 +149,15 @@ dependencies:
109
149
  version: '0'
110
150
  type: :development
111
151
  prerelease: false
112
- version_requirements: *70177908391640
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
113
158
  - !ruby/object:Gem::Dependency
114
159
  name: rspec
115
- requirement: &70177908391160 !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
116
161
  none: false
117
162
  requirements:
118
163
  - - ! '>='
@@ -120,10 +165,15 @@ dependencies:
120
165
  version: '0'
121
166
  type: :development
122
167
  prerelease: false
123
- version_requirements: *70177908391160
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
124
174
  - !ruby/object:Gem::Dependency
125
175
  name: tzinfo
126
- requirement: &70177908390660 !ruby/object:Gem::Requirement
176
+ requirement: !ruby/object:Gem::Requirement
127
177
  none: false
128
178
  requirements:
129
179
  - - ! '>='
@@ -131,7 +181,12 @@ dependencies:
131
181
  version: '0'
132
182
  type: :development
133
183
  prerelease: false
134
- version_requirements: *70177908390660
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
135
190
  description: This gem provides exception reporting with Errplane for Rails 3.x applications.
136
191
  email:
137
192
  - todd@errplane.com
@@ -147,9 +202,12 @@ files:
147
202
  - Rakefile
148
203
  - config.ru
149
204
  - errplane.gemspec
205
+ - gemfiles/Gemfile.rails-2.3.x
150
206
  - gemfiles/Gemfile.rails-3.0.x
151
207
  - gemfiles/Gemfile.rails-3.1.x
152
208
  - gemfiles/Gemfile.rails-3.2.x
209
+ - generators/errplane/errplane_generator.rb
210
+ - generators/errplane/templates/initializer.rb
153
211
  - lib/errplane.rb
154
212
  - lib/errplane/backtrace.rb
155
213
  - lib/errplane/black_box.rb
@@ -171,11 +229,23 @@ files:
171
229
  - lib/errplane/worker.rb
172
230
  - lib/rails/generators/errplane/errplane_generator.rb
173
231
  - lib/rails/generators/errplane/templates/initializer.rb
232
+ - rails/init.rb
174
233
  - spec/controllers/widgets_controller_spec.rb
175
234
  - spec/integration/exceptions_spec.rb
176
235
  - spec/integration/integration_helper.rb
177
236
  - spec/spec_helper.rb
178
237
  - spec/suite.sh
238
+ - spec/support/rails2/app/controllers/application_controller.rb
239
+ - spec/support/rails2/app/controllers/widgets_controller.rb
240
+ - spec/support/rails2/app/helpers/application_helper.rb
241
+ - spec/support/rails2/app/helpers/widgets_helper.rb
242
+ - spec/support/rails2/config/environment.rb
243
+ - spec/support/rails2/config/environments/test.rb
244
+ - spec/support/rails2/config/initializers/cookie_verification_secret.rb
245
+ - spec/support/rails2/config/initializers/errplane.rb
246
+ - spec/support/rails2/config/initializers/new_rails_defaults.rb
247
+ - spec/support/rails2/config/initializers/session_store.rb
248
+ - spec/support/rails2/config/routes.rb
179
249
  - spec/support/rails3/app.rb
180
250
  - spec/unit/backtrace_spec.rb
181
251
  - spec/unit/black_box_spec.rb
@@ -205,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
275
  version: '0'
206
276
  requirements: []
207
277
  rubyforge_project: errplane
208
- rubygems_version: 1.8.17
278
+ rubygems_version: 1.8.24
209
279
  signing_key:
210
280
  specification_version: 3
211
281
  summary: Rails exception reporting for Errplane.
@@ -215,6 +285,17 @@ test_files:
215
285
  - spec/integration/integration_helper.rb
216
286
  - spec/spec_helper.rb
217
287
  - spec/suite.sh
288
+ - spec/support/rails2/app/controllers/application_controller.rb
289
+ - spec/support/rails2/app/controllers/widgets_controller.rb
290
+ - spec/support/rails2/app/helpers/application_helper.rb
291
+ - spec/support/rails2/app/helpers/widgets_helper.rb
292
+ - spec/support/rails2/config/environment.rb
293
+ - spec/support/rails2/config/environments/test.rb
294
+ - spec/support/rails2/config/initializers/cookie_verification_secret.rb
295
+ - spec/support/rails2/config/initializers/errplane.rb
296
+ - spec/support/rails2/config/initializers/new_rails_defaults.rb
297
+ - spec/support/rails2/config/initializers/session_store.rb
298
+ - spec/support/rails2/config/routes.rb
218
299
  - spec/support/rails3/app.rb
219
300
  - spec/unit/backtrace_spec.rb
220
301
  - spec/unit/black_box_spec.rb