hockeybrake 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2012 Dirk Eisenberg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -7,7 +7,7 @@ An extension for the amazing airbrake gem which routes crash reports to HockeyAp
7
7
  Add this to your Gemfile
8
8
  ```ruby
9
9
  gem 'airbrake'
10
- gem 'hockeybrake', :git => 'git://github.com/dei79/hockeybrake.git'
10
+ gem 'hockeybrake'
11
11
  ```
12
12
 
13
13
  Execute the following command for your Rails app
@@ -17,7 +17,28 @@ rails g hockeybrake
17
17
 
18
18
  ## Configuration
19
19
 
20
- Update hockeybrake.rb in config/initializers
20
+ ### General
21
+
22
+ Update hockeybrake.rb in config/initializers, at least the following settings needs to be changed
23
+
24
+ ```ruby
25
+ # the bundle id
26
+ config.app_bundle_id= "###YOUR BUNDLE IDENTIFIER FROM HOCKEYAPP###"
27
+
28
+ # The application ID in hockey app
29
+ config.app_id="###YOUR APP SECRET###"
30
+ ```
31
+
32
+ ### Resque Failures
33
+
34
+ Resque comes with out of the box support for Airbrake. This gem is compatible with this support and it is well configured by default when the resque gem becomes part of your app. This behavious can be changed through configuration if needed. Just add the following to your configuration:
35
+
36
+ ```ruby
37
+ # Support for resque exception handling is enabled by default. Wit this
38
+ # settings the resque support will be disabled. If no resque gem is installed
39
+ # it will be disabled automatically
40
+ config.no_resque_handler = true
41
+ ```
21
42
 
22
43
  ## Contributing
23
44
 
@@ -1,9 +1,18 @@
1
+ #
2
+ # This section contain the standard airbrake configuration and it should be used to manipulate everything
3
+ # what the execption handler can do for your. Airbrae API relevant things are ignored from the HockeyApp
4
+ # sender except proxy settings.
5
+ #
1
6
  Airbrake.configure do |config|
2
7
  # comment out if sending exceptions in the development environment
3
8
  # is needed as well
4
9
  # config.development_environments.delete("development")
5
10
  end
6
11
 
12
+ #
13
+ # This section conains your hockeyapp configuration and should be used to set your HockeyApp relevant
14
+ # key and secrets.
15
+ #
7
16
  HockeyBrake.configure do |config|
8
17
 
9
18
  # the bundle id
@@ -16,4 +25,9 @@ HockeyBrake.configure do |config|
16
25
  # as version, otherwise use the name of your version
17
26
  config.app_version="#{Rails.env}"
18
27
 
28
+ # Support for resque exception handling is enabled by default. Wit this
29
+ # settings the resque support will be disabled. If no resque gem is installed
30
+ # it will be disabled automatically
31
+ # config.no_resque_handler = true
32
+
19
33
  end
@@ -10,17 +10,27 @@ module HockeyBrake
10
10
  # The app version
11
11
  attr_accessor :app_version
12
12
 
13
+ # Allow to disable resque support
14
+ attr_accessor :no_resque_handler
15
+
13
16
  # The service url
14
17
  def hockey_url
15
18
  "https://rink.hockeyapp.net/api/2/apps/#{app_id}/crashes/upload"
16
19
  end
17
20
 
21
+ # ctor
22
+ def initialize
23
+ # resque is enable by default
24
+ self.no_resque_handler = false
25
+ end
26
+
18
27
  # convert to hash
19
28
  def to_hash
20
29
  h = Hash.new
21
30
  h[:app_id] = self.app_id
22
31
  h[:app_version] = self.app_version
23
32
  h[:hockey_url] = self.hockey_url
33
+ h[:no_resque_handler] = self.no_resque_handler
24
34
  h
25
35
  end
26
36
  end
@@ -1,4 +1,4 @@
1
1
  module HockeyBrake
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
4
4
 
data/lib/hockeybrake.rb CHANGED
@@ -10,6 +10,24 @@ module HockeyBrake
10
10
  def configure
11
11
  # receive the configuration
12
12
  yield(configuration)
13
+
14
+ # check if we have resque support
15
+ if self.configuration.no_resque_handler == false
16
+
17
+ # Load optional modules for resque support and configure the resque handler for
18
+ # us if needed
19
+ begin
20
+ require 'resque/failure/multiple'
21
+ require 'resque/failure/airbrake'
22
+ require 'resque/failure/redis'
23
+
24
+ Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Airbrake]
25
+ Resque::Failure.backend = Resque::Failure::Multiple
26
+ rescue
27
+ # nothing to do
28
+ end
29
+
30
+ end
13
31
  end
14
32
 
15
33
  def configuration
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hockeybrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -54,6 +54,7 @@ files:
54
54
  - .gitignore
55
55
  - Gemfile
56
56
  - Gemfile.lock
57
+ - LICENSE.txt
57
58
  - README.md
58
59
  - hockeybrake.gemspec
59
60
  - lib/generators/hockeybrake/hockeybrake_generator.rb