eye-bugsnag 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 306a77e26f11cf516a8d06eca74301a339ed6184
4
+ data.tar.gz: 5b6a6bc8579c478977d96693d15f3be7e3184f7e
5
+ SHA512:
6
+ metadata.gz: 3e565dcb328f4f8dd5541ce54b9a0fee1c73a8c0d41e81e9af8b82669193d32fbc81634a289b382b9107a783927f2921deb21cca736d6c898cf0c84a7d08d231
7
+ data.tar.gz: 685b4fc81b609101da2e05e48b89664f929c6e95069954d543da735ff40bd9668705820ce4d32d2789722877fce1029519a54673050e9a468de3cbebea5f24b3
@@ -0,0 +1,6 @@
1
+ .idea
2
+ Gemfile.lock
3
+ tmp
4
+ pkg
5
+ *.bundle
6
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Oleg Vivtash
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,51 @@
1
+ # Eye::Bugsnag
2
+
3
+ Sends info about process crashes to BugSnag.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'eye'
11
+ gem 'eye-bugsnag'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install eye-bugsnag
21
+
22
+ ## Usage
23
+
24
+ BugSnag notifier takes the following parameters:
25
+
26
+ - `api_key` _(required)_
27
+ - `release_stage` _(optional, defaults to `development`)_
28
+ - `notify_release_stages` _(optional, defaults to `%w(development staging production)`)_
29
+ - `app_type` _(optional, defaults to `eye`)_
30
+ - `project_root` _(optional)_
31
+
32
+ Declare inside eye config like this:
33
+
34
+ ```ruby
35
+ require 'eye/notify/bugsnag'
36
+
37
+ Eye.config do
38
+ bugsnag api_key: '123yourbugsnagapikeygoeshere321', release_stage: ENV['RAILS_ENV'], notify_release_stages: %w(staging production)
39
+ contact :devs, :bugsnag, 'whatever'
40
+ end
41
+ ```
42
+
43
+ Refer to the example configuration file in `examples` directory.
44
+
45
+ ## Contributing
46
+
47
+ 1. Fork it ( https://github.com/duhast/eye-bugsnag/fork )
48
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
49
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
50
+ 4. Push to the branch (`git push origin my-new-feature`)
51
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,20 @@
1
+ # BugSnag notify example
2
+ require 'eye/notify/bugsnag'
3
+
4
+ Eye.config do
5
+ bugsnag api_key: '123yourbugsnagapikeygoeshere321', release_stage: ENV['RAILS_ENV'], notify_release_stages: %w(staging production)
6
+ contact :devs, :bugsnag, 'whatever'
7
+ end
8
+
9
+ Eye.application 'test' do
10
+ notify :devs, :info
11
+ stdall '/tmp/eye-example.log'
12
+
13
+ process :some_process do
14
+ notify :devs, :debug
15
+ start_command 'sleep 120'
16
+ daemonize true
17
+ pid_file '/tmp/sleep.pid'
18
+ end
19
+
20
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'eye/notify/bugsnag/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "eye-bugsnag"
8
+ spec.version = Eye::Notify::Bugsnag::VERSION
9
+ spec.authors = ["Oleg Vivtash"]
10
+ spec.email = ["oleg@vivtash.net"]
11
+ spec.summary = %q{Eye to BugSnag notification}
12
+ spec.description = %q{Eye to BugSnag notification}
13
+ spec.homepage = "https://github.com/duhast/eye-bugsnag"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+
24
+ spec.add_runtime_dependency "bugsnag", ">= 1.2.10"
25
+ spec.add_runtime_dependency "eye", "~> 0.5"
26
+ end
@@ -0,0 +1,42 @@
1
+ require 'bugsnag'
2
+
3
+ class Eye::Notify::Bugsnag < Eye::Notify
4
+ class NotificationException < StandardError
5
+ include ::Bugsnag::MetaData
6
+ end
7
+
8
+ # Eye.config do
9
+ # bugsnag api_key: '46trdhqxuke4grw34', release_stage: 'staging'
10
+ # contact :devs, :bugsnag
11
+ # end
12
+
13
+ param :api_key, String, true
14
+ param :release_stage, String, false, 'development'
15
+ param :notify_release_stages, Array, false, %w(development staging production)
16
+ param :app_type, String, false, 'eye'
17
+ param :project_root, String, false
18
+
19
+ def execute
20
+ ::Bugsnag.configure do |cfg|
21
+ cfg.api_key = api_key
22
+ cfg.release_stage = release_stage
23
+ cfg.notify_release_stages = notify_release_stages
24
+ cfg.auto_notify = false
25
+ #config.use_ssl = true
26
+ cfg.project_root = project_root unless project_root.blank?
27
+ #config.app_version = "2.5.1"
28
+ #config.params_filters << "password" << "password_confirmation"
29
+ #config.ignore_classes << "ActiveRecord::StatementInvalid"
30
+ #config.ignore_classes << lambda {|ex| ex.message =~ /timeout/}
31
+ #config.ignore_user_agents << %r{Chrome}
32
+ #config.timeout = 10
33
+ cfg.app_type = "eye"
34
+ end
35
+ notify_ex = NotificationException.new(message_subject)
36
+ notify_ex.bugsnag_meta_data = @message_h
37
+ ::Bugsnag.notify(notify_ex)
38
+ end
39
+
40
+ end
41
+
42
+ Eye::Notify.register(Eye::Notify::Bugsnag)
@@ -0,0 +1,10 @@
1
+ module Eye
2
+ class Notify
3
+ # to satisfy gem packaking
4
+ class Eye::Notify::Custom < Eye::Notify; end
5
+
6
+ class Bugsnag < Eye::Notify::Custom
7
+ VERSION = '0.0.1'
8
+ end
9
+ end
10
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: eye-bugsnag
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Oleg Vivtash
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bugsnag
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.2.10
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 1.2.10
55
+ - !ruby/object:Gem::Dependency
56
+ name: eye
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.5'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.5'
69
+ description: Eye to BugSnag notification
70
+ email:
71
+ - oleg@vivtash.net
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - examples/bugsnag.eye
82
+ - eye-bugsnag.gemspec
83
+ - lib/eye/notify/bugsnag.rb
84
+ - lib/eye/notify/bugsnag/version.rb
85
+ homepage: https://github.com/duhast/eye-bugsnag
86
+ licenses:
87
+ - MIT
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.4.6
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: Eye to BugSnag notification
109
+ test_files: []