bugsnag 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f2e09404287c049f685cdb43450558c6fd744a9
4
- data.tar.gz: 959babec9a72ab7da4ca2d7a161f1beaba38ffe0
3
+ metadata.gz: 2e4895caa9224c394638111e53c272725b376798
4
+ data.tar.gz: a6eed28eb2fae6ab266895c3a7a87bb188ac43a5
5
5
  SHA512:
6
- metadata.gz: e253d2e9281712ee200c590dd38d50ff8f63b060dab94f077eb5113d0a7f42ff618650999baeef4eb3684485f2eea7e6bf8e0a8b65c379cafdb158652173335d
7
- data.tar.gz: c5d5079077817aff53247a310c91b677a200149c0d07062612f6c7e8c4f921fd3d10da16e84b37c3e96efab9193c422d495b0609f0104fe86809bd7b0c71a49e
6
+ metadata.gz: 9d65d2a25cc56852f130ecfea197e3aa1455125d72830d216cb53fcb69e96e72eb0337bf77e41e88ad56c9723fc2942c4582deacc80232a202c02ef942b4f175
7
+ data.tar.gz: c976c229171fcc3b784e003b808c23f3ce5a9e8b9220e966c11f8c746448be293506c07d974dce98b364003da080836ad45b4fda8ac28d1de7462022f49bf268
data/README.md CHANGED
@@ -39,9 +39,15 @@ How to Install
39
39
  bundle install
40
40
  ```
41
41
 
42
- 3. Configure the Bugsnag module with your API key.
42
+ 3. Configure the Bugsnag module with your API key.
43
43
 
44
- In rails apps, put this code to a new file at `config/initializers/bugsnag.rb`
44
+ **Rails**: Use our generator
45
+
46
+ ```shell
47
+ rails generate bugsnag YOUR_API_KEY_HERE
48
+ ```
49
+
50
+ **Other Ruby/Rack/Sinatra apps**: Put this snippet in your initialization.
45
51
 
46
52
  ```ruby
47
53
  Bugsnag.configure do |config|
@@ -49,8 +55,8 @@ How to Install
49
55
  end
50
56
  ```
51
57
 
52
- If you don't configure the api_key, the Bugsnag module will read the `BUGSNAG_API_KEY`
53
- environment variable.
58
+ The Bugsnag module will read the `BUGSNAG_API_KEY` environment variable if you
59
+ do not configure one automatically.
54
60
 
55
61
  4. **Rack/Sinatra apps only**: Activate the Bugsnag Rack middleware
56
62
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.3
1
+ 1.6.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bugsnag"
8
- s.version = "1.6.3"
8
+ s.version = "1.6.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Smith"]
12
- s.date = "2013-10-28"
12
+ s.date = "2013-11-27"
13
13
  s.description = "Ruby notifier for bugsnag.com"
14
14
  s.email = "james@bugsnag.com"
15
15
  s.extra_rdoc_files = [
@@ -54,6 +54,7 @@ Gem::Specification.new do |s|
54
54
  "lib/bugsnag/tasks.rb",
55
55
  "lib/bugsnag/tasks/bugsnag.rake",
56
56
  "lib/bugsnag/version.rb",
57
+ "lib/generators/bugsnag/bugsnag_generator.rb",
57
58
  "rails/init.rb",
58
59
  "spec/helper_spec.rb",
59
60
  "spec/middleware_spec.rb",
@@ -9,9 +9,12 @@ require "bugsnag/helpers"
9
9
  require "bugsnag/rack"
10
10
  require "bugsnag/railtie" if defined?(Rails::Railtie)
11
11
 
12
- require "bugsnag/resque" if defined?(::Resque::Job)
13
- require "bugsnag/sidekiq" if defined?(Sidekiq)
14
- require "bugsnag/mailman" if defined?(Mailman)
12
+ [:resque, :sidekiq, :mailman].each do |integration|
13
+ begin
14
+ require "bugsnag/#{integration}"
15
+ rescue LoadError
16
+ end
17
+ end
15
18
 
16
19
  module Bugsnag
17
20
  LOG_PREFIX = "** [Bugsnag] "
@@ -1,3 +1,5 @@
1
+ require 'mailman'
2
+
1
3
  module Bugsnag
2
4
  class Mailman
3
5
  def call(mail)
@@ -19,4 +21,4 @@ end
19
21
 
20
22
  if Mailman.config.respond_to?(:middleware)
21
23
  Mailman.config.middleware.add ::Bugsnag::Mailman
22
- end
24
+ end
@@ -1,4 +1,4 @@
1
- require "resque/failure/base"
1
+ require "resque"
2
2
  require "resque/failure/multiple"
3
3
 
4
4
  module Bugsnag
@@ -35,4 +35,4 @@ end
35
35
  Resque::Failure::Bugsnag = Bugsnag::Resque
36
36
 
37
37
  # Auto-load the failure backend
38
- Bugsnag::Resque.add_failure_backend
38
+ Bugsnag::Resque.add_failure_backend
@@ -1,3 +1,5 @@
1
+ require 'sidekiq'
2
+
1
3
  module Bugsnag
2
4
  class Sidekiq
3
5
  def call(worker, msg, queue)
@@ -22,4 +24,4 @@ end
22
24
  config.server_middleware do |chain|
23
25
  chain.add ::Bugsnag::Sidekiq
24
26
  end
25
- end
27
+ end
@@ -0,0 +1,24 @@
1
+ require 'rails/generators'
2
+ class BugsnagGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ argument :api_key, required: true, :desc => "required"
6
+
7
+ gem "bugsnag"
8
+
9
+ desc "Configures the bugsnag notifier with your API key"
10
+
11
+ def create_initializer_file
12
+ unless /^[a-f0-9]{32}$/ =~ api_key
13
+ raise Thor::Error, "Invalid bugsnag notifier api key #{api_key.inspect}\nYou can find the api key on the Settings tab of https://bugsnag.com/"
14
+ end
15
+
16
+ initializer "bugsnag.rb" do
17
+ <<-EOF.strip
18
+ Bugsnag.configure do |config|
19
+ config.api_key = #{api_key.inspect}
20
+ end
21
+ EOF
22
+ end
23
+ end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-28 00:00:00.000000000 Z
11
+ date: 2013-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -131,6 +131,7 @@ files:
131
131
  - lib/bugsnag/tasks.rb
132
132
  - lib/bugsnag/tasks/bugsnag.rake
133
133
  - lib/bugsnag/version.rb
134
+ - lib/generators/bugsnag/bugsnag_generator.rb
134
135
  - rails/init.rb
135
136
  - spec/helper_spec.rb
136
137
  - spec/middleware_spec.rb
@@ -162,3 +163,4 @@ signing_key:
162
163
  specification_version: 4
163
164
  summary: Ruby notifier for bugsnag.com
164
165
  test_files: []
166
+ has_rdoc: