errplane 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -10,7 +10,6 @@ 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
14
13
  notifications:
15
14
  email:
16
15
  - mechanics@errplane.com
data/lib/errplane.rb CHANGED
@@ -2,6 +2,7 @@ require "net/http"
2
2
  require "net/https"
3
3
  require "rubygems"
4
4
  require "socket"
5
+ require "thread"
5
6
 
6
7
  require "json" unless Hash.respond_to?(:to_json)
7
8
 
@@ -15,12 +16,26 @@ require "errplane/rack"
15
16
 
16
17
  require "errplane/railtie" if defined?(Rails::Railtie)
17
18
 
19
+ class SafeQueue < Queue
20
+ attr_accessor :max_depth
21
+
22
+ def initialize(max_depth = 10_000)
23
+ @max_depth = max_depth
24
+ super()
25
+ end
26
+
27
+ def push_safely(data)
28
+ push(data) if size < @max_depth
29
+ end
30
+ end
31
+
18
32
  module Errplane
19
33
  class << self
20
34
  include Logger
21
35
 
22
36
  attr_writer :configuration
23
37
  attr_accessor :transmitter
38
+ attr_accessor :queue
24
39
 
25
40
  def configure(silent = false)
26
41
  yield(configuration)
@@ -31,8 +46,12 @@ module Errplane
31
46
  @configuration ||= Configuration.new
32
47
  end
33
48
 
49
+ def queue
50
+ @queue ||= SafeQueue.new(configuration.queue_maximum_depth)
51
+ end
52
+
34
53
  def report(name, params = {})
35
- Errplane::Relay.queue.push({
54
+ Errplane.queue.push_safely({
36
55
  :name => name,
37
56
  :source => "custom",
38
57
  :timestamp => current_timestamp
@@ -42,6 +42,9 @@ module Errplane
42
42
 
43
43
  payload[:request_data] = request_data if @controller || @action || !@params.blank?
44
44
  payload[:hash] = hash if hash
45
+ if Errplane.configuration.aggregated_exception_classes.include?(@exception.class.to_s)
46
+ payload[:hash] = Digest::SHA1.hexdigest(@exception.class.to_s)
47
+ end
45
48
 
46
49
  payload.to_json
47
50
  end
@@ -17,7 +17,7 @@ module Errplane
17
17
  attr_accessor :ignored_environments
18
18
  attr_accessor :ignored_user_agents
19
19
  attr_accessor :backtrace_filters
20
-
20
+ attr_accessor :aggregated_exception_classes
21
21
  attr_accessor :environment_variables
22
22
 
23
23
  attr_accessor :instrumentation_enabled
@@ -26,7 +26,6 @@ module Errplane
26
26
 
27
27
  attr_accessor :queue_worker_threads
28
28
  attr_accessor :queue_worker_polling_interval
29
- attr_accessor :queue_sweeper_polling_interval
30
29
  attr_accessor :queue_maximum_depth
31
30
  attr_accessor :queue_maximum_post
32
31
 
@@ -59,12 +58,12 @@ module Errplane
59
58
  @ignored_environments = DEFAULTS[:ignored_environments].dup
60
59
  @ignored_user_agents = DEFAULTS[:ignored_user_agents].dup
61
60
  @backtrace_filters = DEFAULTS[:backtrace_filters].dup
61
+ @aggregated_exception_classes = []
62
62
  @debug = false
63
63
  @rescue_global_exceptions = false
64
64
  @instrumentation_enabled = true
65
65
  @queue_worker_threads = 3
66
66
  @queue_worker_polling_interval = 5
67
- @queue_sweeper_polling_interval = 0.25
68
67
  @queue_maximum_depth = 10_000
69
68
  @queue_maximum_post = 500
70
69
  end
@@ -4,18 +4,6 @@ require "uri"
4
4
  require "base64"
5
5
 
6
6
  module Errplane
7
- class Relay
8
- @@queue = Queue.new
9
-
10
- def self.queue
11
- return @@queue
12
- end
13
-
14
- def self.initialize
15
- @@queue = Queue.new
16
- end
17
- end
18
-
19
7
  class Instrumentation
20
8
  class << self
21
9
  include Errplane::Logger
@@ -49,17 +37,6 @@ module Errplane
49
37
  end
50
38
  end
51
39
 
52
- def spawn_sweeper_thread()
53
- log :debug, "Spawning background sweeper thread."
54
- Thread.new do
55
- while true
56
- sleep Errplane.configuration.queue_sweeper_polling_interval
57
- while Errplane::Relay.queue.size > Errplane.configuration.queue_maximum_depth
58
- Errplane::Relay.queue.pop
59
- end
60
- end
61
- end
62
- end
63
40
  def spawn_worker_threads()
64
41
  Errplane.configuration.queue_worker_threads.times do
65
42
  log :debug, "Spawning background worker thread."
@@ -69,9 +46,9 @@ module Errplane
69
46
  sleep Errplane.configuration.queue_worker_polling_interval
70
47
 
71
48
  data = [].tap do |line|
72
- while !Errplane::Relay.queue.empty?
49
+ while !Errplane.queue.empty?
73
50
  log :debug, "Found data in the queue."
74
- n = Errplane::Relay.queue.pop
51
+ n = Errplane.queue.pop
75
52
 
76
53
  begin
77
54
  case n[:source]
@@ -0,0 +1,28 @@
1
+ module Errplane
2
+ module Rails
3
+ module Instrumentation
4
+ def self.included(base)
5
+ base.extend(ClassMethods)
6
+ end
7
+
8
+ module ClassMethods
9
+ def instrument(methods = [])
10
+ methods = [methods] unless methods.is_a?(Array)
11
+ methods.each do |method|
12
+ ::Rails.logger.debug "OVERRIDING METHOD: #{method}"
13
+
14
+ class_eval <<-EVAL_METHOD
15
+ def #{method}_with_instrumentation
16
+ Errplane.report(\"instrumentation/#{self.class}##{method}\")
17
+ #{method}_without_instrumentation
18
+ end
19
+ EVAL_METHOD
20
+
21
+ alias_method "#{method}_without_instrumentation", method
22
+ alias_method method, "#{method}_with_instrumentation"
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -100,30 +100,28 @@ module Errplane
100
100
  ::ActionDispatch::ShowExceptions.send(:include, Errplane::Rails::Middleware::HijackRenderException)
101
101
  end
102
102
 
103
- if defined?(ActiveSupport::Notifications) && Errplane.configuration.instrumentation_enabled?
103
+ if defined?(ActiveSupport::Notifications)
104
104
  ActiveSupport::Notifications.subscribe do |name, start, finish, id, payload|
105
- h = { :name => name,
106
- :start => start,
107
- :finish => finish,
108
- :nid => id,
109
- :payload => payload,
110
- :source => "active_support"}
111
- Errplane::Relay.queue.push h
105
+ if Errplane.configuration.instrumentation_enabled?
106
+ h = { :name => name,
107
+ :start => start,
108
+ :finish => finish,
109
+ :nid => id,
110
+ :payload => payload,
111
+ :source => "active_support"}
112
+ Errplane.queue.push_safely(h)
113
+ end
112
114
  end
113
115
  end
114
116
 
115
117
  if defined?(PhusionPassenger)
116
118
  PhusionPassenger.on_event(:starting_worker_process) do |forked|
117
119
  if forked
118
- Errplane::Relay.initialize
119
120
  Errplane::Instrumentation.spawn_worker_threads()
120
- Errplane::Instrumentation.spawn_sweeper_thread()
121
121
  end
122
122
  end
123
123
  else
124
- Errplane::Relay.initialize
125
124
  Errplane::Instrumentation.spawn_worker_threads()
126
- Errplane::Instrumentation.spawn_sweeper_thread()
127
125
  end
128
126
  end
129
127
  end
@@ -24,7 +24,7 @@ module Errplane
24
24
  :url => url,
25
25
  :source => "exception" }
26
26
 
27
- Errplane::Relay.queue.push exception
27
+ Errplane.queue.push_safely(exception)
28
28
  end
29
29
 
30
30
  def deliver(data, url)
@@ -1,3 +1,3 @@
1
1
  module Errplane
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
@@ -4,6 +4,7 @@ describe "exception handling" do
4
4
  before do
5
5
  Errplane.configure do |config|
6
6
  config.ignored_environments = %w{development}
7
+ config.instrumentation_enabled = false
7
8
  end
8
9
 
9
10
  FakeWeb.last_request = nil
@@ -11,21 +12,22 @@ describe "exception handling" do
11
12
  @request_path = "/api/v1/applications/#{Errplane.configuration.application_id}/exceptions/test?api_key=f123-e456-d789c012"
12
13
  @request_url = "http://api.errplane.com#{@request_path}"
13
14
  FakeWeb.register_uri(:post, @request_url, :body => "", :status => ["200", "OK"])
15
+
16
+ Errplane.queue.clear
14
17
  end
15
18
 
16
19
  describe "in an action that raises an exception" do
17
- it "should make an HTTP call to the API" do
20
+ it "should add an exception to the queue" do
21
+ Errplane.queue.size.should be_zero
18
22
  get "/widgets/new"
19
- FakeWeb.last_request.should_not be_nil
20
- FakeWeb.last_request.path.should == @request_path
21
- FakeWeb.last_request.method.should == "POST"
23
+ Errplane.queue.size.should == 1
22
24
  end
23
25
  end
24
26
 
25
27
  describe "in an action that does not raise an exception" do
26
- it "should not make an HTTP call to the API" do
28
+ it "should not add anything to the queue" do
27
29
  get "/widgets"
28
- FakeWeb.last_request.should be_nil
30
+ Errplane.queue.size.should be_zero
29
31
  end
30
32
  end
31
33
 
@@ -35,7 +37,7 @@ describe "exception handling" do
35
37
  config.ignored_user_agents = %w{Googlebot}
36
38
  end
37
39
  get "/widgets/new", {}, { "HTTP_USER_AGENT" => "Googlebot/2.1" }
38
- FakeWeb.last_request.should be_nil
40
+ Errplane.queue.size.should be_zero
39
41
  end
40
42
  end
41
43
  end
data/spec/suite.sh CHANGED
@@ -14,26 +14,25 @@ function build_version() {
14
14
  BUNDLE_GEMFILE=gemfiles/Gemfile.rails-$1 bundle exec rake -t spec
15
15
  }
16
16
 
17
- function versions() {
17
+ 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"
22
21
  }
23
22
 
24
- function use_ruby() {
23
+ function build_with_ruby() {
25
24
  rvm use ruby-$1@errplane_gem --create
26
- versions
25
+ build_versions
27
26
  }
28
27
 
29
- function run() {
30
- use_ruby "1.9.3-p194"
31
- use_ruby "1.9.2-p290"
32
- use_ruby "1.8.7-p357"
28
+ function build() {
29
+ build_with_ruby "1.9.3-p194"
30
+ build_with_ruby "1.9.2-p290"
31
+ build_with_ruby "1.8.7-p357"
33
32
  }
34
33
 
35
34
  function clean() {
36
35
  rvm gemset empty errplane_gem --force
37
36
  }
38
37
 
39
- run
38
+ build
@@ -2,6 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  describe Errplane do
4
4
  before do
5
+ Errplane.configure { |config| config.ignored_environments = [] }
6
+
5
7
  FakeWeb.last_request = nil
6
8
  FakeWeb.clean_registry
7
9
 
@@ -34,17 +36,18 @@ describe Errplane do
34
36
 
35
37
  describe 'rescue' do
36
38
  it "should transmit an exception when passed" do
37
- Errplane.configure { |config| config.ignored_environments = [] }
39
+ Errplane.queue.clear
38
40
 
39
- FakeWeb.register_uri(:post, @request_url, :body => "", :status => ["200", "OK"])
41
+ Errplane.configure do |config|
42
+ config.ignored_environments = []
43
+ config.instrumentation_enabled = false
44
+ end
40
45
 
41
46
  Errplane.rescue do
42
47
  raise ArgumentError.new('wrong')
43
48
  end
44
49
 
45
- FakeWeb.last_request.should_not be_nil
46
- FakeWeb.last_request.method.should == "POST"
47
- FakeWeb.last_request.path.should == @request_path
50
+ Errplane.queue.size.should == 1
48
51
  end
49
52
 
50
53
  it "should also raise the exception when in an ignored environment" do
@@ -59,20 +62,15 @@ describe Errplane do
59
62
  end
60
63
 
61
64
  describe "rescue_and_reraise" do
62
- before do
63
- Errplane.configure { |config| config.ignored_environments = [] }
64
- end
65
-
66
65
  it "should transmit an exception when passed" do
67
- FakeWeb.register_uri(:post, @request_url, :body => "", :status => ["200", "OK"])
66
+ Errplane.configure { |config| config.ignored_environments = [] }
67
+ Errplane.queue.clear
68
68
 
69
69
  expect {
70
70
  Errplane.rescue_and_reraise { raise ArgumentError.new('wrong') }
71
71
  }.to raise_error(ArgumentError)
72
72
 
73
- FakeWeb.last_request.should_not be_nil
74
- FakeWeb.last_request.method.should == "POST"
75
- FakeWeb.last_request.path.should == @request_path
73
+ Errplane.queue.size.should == 1
76
74
  end
77
75
  end
78
76
  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.5
4
+ version: 0.5.6
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-12 00:00:00.000000000 Z
12
+ date: 2012-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70156446180960 !ruby/object:Gem::Requirement
16
+ requirement: &70113630104640 !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: *70156446180960
24
+ version_requirements: *70113630104640
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &70156446180420 !ruby/object:Gem::Requirement
27
+ requirement: &70113630104100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.3.14
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70156446180420
35
+ version_requirements: *70113630104100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: actionpack
38
- requirement: &70156446179840 !ruby/object:Gem::Requirement
38
+ requirement: &70113630103560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.3.14
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70156446179840
46
+ version_requirements: *70113630103560
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &70156446174660 !ruby/object:Gem::Requirement
49
+ requirement: &70113630103020 !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: *70156446174660
57
+ version_requirements: *70113630103020
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: fakeweb
60
- requirement: &70156446174100 !ruby/object:Gem::Requirement
60
+ requirement: &70113630095780 !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: *70156446174100
68
+ version_requirements: *70113630095780
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard
71
- requirement: &70156446173560 !ruby/object:Gem::Requirement
71
+ requirement: &70113630095220 !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: *70156446173560
79
+ version_requirements: *70113630095220
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: guard-rspec
82
- requirement: &70156446173020 !ruby/object:Gem::Requirement
82
+ requirement: &70113630094680 !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: *70156446173020
90
+ version_requirements: *70113630094680
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rake
93
- requirement: &70156446172540 !ruby/object:Gem::Requirement
93
+ requirement: &70113630094140 !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: *70156446172540
101
+ version_requirements: *70113630094140
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rdoc
104
- requirement: &70156446171940 !ruby/object:Gem::Requirement
104
+ requirement: &70113630093660 !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: *70156446171940
112
+ version_requirements: *70113630093660
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rspec
115
- requirement: &70156446171220 !ruby/object:Gem::Requirement
115
+ requirement: &70113630093040 !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: *70156446171220
123
+ version_requirements: *70113630093040
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: tzinfo
126
- requirement: &70156446170460 !ruby/object:Gem::Requirement
126
+ requirement: &70113630092320 !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: *70156446170460
134
+ version_requirements: *70113630092320
135
135
  description: This gem provides exception reporting with Errplane for Rails 3.x applications.
136
136
  email:
137
137
  - todd@errplane.com
@@ -147,12 +147,9 @@ files:
147
147
  - Rakefile
148
148
  - config.ru
149
149
  - errplane.gemspec
150
- - gemfiles/Gemfile.rails-2.3.x
151
150
  - gemfiles/Gemfile.rails-3.0.x
152
151
  - gemfiles/Gemfile.rails-3.1.x
153
152
  - gemfiles/Gemfile.rails-3.2.x
154
- - generators/errplane/errplane_generator.rb
155
- - generators/errplane/templates/initializer.rb
156
153
  - lib/errplane.rb
157
154
  - lib/errplane/backtrace.rb
158
155
  - lib/errplane/black_box.rb
@@ -163,6 +160,7 @@ files:
163
160
  - lib/errplane/rack.rb
164
161
  - lib/errplane/rails.rb
165
162
  - lib/errplane/rails/air_traffic_controller.rb
163
+ - lib/errplane/rails/instrumentation.rb
166
164
  - lib/errplane/rails/middleware/hijack_render_exception.rb
167
165
  - lib/errplane/rails/middleware/hijack_rescue_action_everywhere.rb
168
166
  - lib/errplane/railtie.rb
@@ -172,23 +170,11 @@ files:
172
170
  - lib/errplane/version.rb
173
171
  - lib/rails/generators/errplane/errplane_generator.rb
174
172
  - lib/rails/generators/errplane/templates/initializer.rb
175
- - rails/init.rb
176
173
  - spec/controllers/widgets_controller_spec.rb
177
174
  - spec/integration/exceptions_spec.rb
178
175
  - spec/integration/integration_helper.rb
179
176
  - spec/spec_helper.rb
180
177
  - spec/suite.sh
181
- - spec/support/rails2/app/controllers/application_controller.rb
182
- - spec/support/rails2/app/controllers/widgets_controller.rb
183
- - spec/support/rails2/app/helpers/application_helper.rb
184
- - spec/support/rails2/app/helpers/widgets_helper.rb
185
- - spec/support/rails2/config/environment.rb
186
- - spec/support/rails2/config/environments/test.rb
187
- - spec/support/rails2/config/initializers/cookie_verification_secret.rb
188
- - spec/support/rails2/config/initializers/errplane.rb
189
- - spec/support/rails2/config/initializers/new_rails_defaults.rb
190
- - spec/support/rails2/config/initializers/session_store.rb
191
- - spec/support/rails2/config/routes.rb
192
178
  - spec/support/rails3/app.rb
193
179
  - spec/unit/backtrace_spec.rb
194
180
  - spec/unit/black_box_spec.rb
@@ -225,17 +211,6 @@ test_files:
225
211
  - spec/integration/integration_helper.rb
226
212
  - spec/spec_helper.rb
227
213
  - spec/suite.sh
228
- - spec/support/rails2/app/controllers/application_controller.rb
229
- - spec/support/rails2/app/controllers/widgets_controller.rb
230
- - spec/support/rails2/app/helpers/application_helper.rb
231
- - spec/support/rails2/app/helpers/widgets_helper.rb
232
- - spec/support/rails2/config/environment.rb
233
- - spec/support/rails2/config/environments/test.rb
234
- - spec/support/rails2/config/initializers/cookie_verification_secret.rb
235
- - spec/support/rails2/config/initializers/errplane.rb
236
- - spec/support/rails2/config/initializers/new_rails_defaults.rb
237
- - spec/support/rails2/config/initializers/session_store.rb
238
- - spec/support/rails2/config/routes.rb
239
214
  - spec/support/rails3/app.rb
240
215
  - spec/unit/backtrace_spec.rb
241
216
  - spec/unit/black_box_spec.rb
@@ -1,8 +0,0 @@
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 => '../'
@@ -1,24 +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
- record do |m|
13
- m.template "initializer.rb", "config/initializers/errplane.rb",
14
- :assigns => {
15
- :application_id => options[:application_id] || secure_random.hex(4),
16
- :api_key => options[:api_key]
17
- }
18
- end
19
- end
20
-
21
- def secure_random
22
- defined?(SecureRandom) ? SecureRandom : ActiveSupport::SecureRandom
23
- end
24
- end
@@ -1,6 +0,0 @@
1
- require "errplane"
2
-
3
- Errplane.configure do |config|
4
- config.api_key = "<%= api_key %>"
5
- config.application_id = "<%= application_id %>"
6
- end
data/rails/init.rb DELETED
@@ -1 +0,0 @@
1
- require "errplane/rails"
@@ -1,4 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- helper :all
3
- protect_from_forgery
4
- end
@@ -1,4 +0,0 @@
1
- class WidgetsController < ApplicationController
2
- def index; render :nothing => true; end
3
- def new; return 1/0; end
4
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- module WidgetsHelper
2
- end
@@ -1,4 +0,0 @@
1
- Rails::Initializer.run do |config|
2
- config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
3
- config.time_zone = 'UTC'
4
- end
File without changes
@@ -1 +0,0 @@
1
- ActionController::Base.cookie_verifier_secret = '171a91942320ec70c77a53d50cf62835b06a9e9e3ee8e9f045d4fe195965b9d5b30ceed7570ac6d77c20ca561229625be0cf987e8342b14f499033a271480970';
@@ -1,6 +0,0 @@
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]
@@ -1,8 +0,0 @@
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
@@ -1,4 +0,0 @@
1
- ActionController::Base.session = {
2
- :key => '_rails-2.3_session',
3
- :secret => '76cc9f32d38e9b6227bd663076edcf28cc915dc3021da204763a73dbd0d2741f6f7074af21400d4f8f9ef6c4db72487c467edf4a1dfec732835c5674a9846dd7'
4
- }
@@ -1,3 +0,0 @@
1
- ActionController::Routing::Routes.draw do |map|
2
- map.resources :widgets
3
- end