errorstack 0.0.1
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.
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +50 -0
- data/Guardfile +8 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/errorstack.gemspec +25 -0
- data/lib/errorstack.rb +33 -0
- data/lib/errorstack/version.rb +3 -0
- data/spec/errorstack_spec.rb +16 -0
- metadata +124 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
errorstack (0.0.1)
|
|
5
|
+
rest-client (>= 1.6.1)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: http://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
diff-lcs (1.1.2)
|
|
11
|
+
ffi (0.6.3)
|
|
12
|
+
rake (>= 0.8.7)
|
|
13
|
+
growl (1.0.3)
|
|
14
|
+
guard (0.1.1)
|
|
15
|
+
bundler (~> 1.0.2)
|
|
16
|
+
growl (~> 1.0.3)
|
|
17
|
+
libnotify (~> 0.1.3)
|
|
18
|
+
rb-inotify (~> 0.8.1)
|
|
19
|
+
sys-uname (~> 0.8.4)
|
|
20
|
+
thor (~> 0.14.3)
|
|
21
|
+
guard-rspec (0.1.2)
|
|
22
|
+
guard (~> 0.1.0)
|
|
23
|
+
libnotify (0.1.4)
|
|
24
|
+
ffi (>= 0.6.2)
|
|
25
|
+
mime-types (1.16)
|
|
26
|
+
rake (0.8.7)
|
|
27
|
+
rb-inotify (0.8.1)
|
|
28
|
+
ffi (>= 0.5.0)
|
|
29
|
+
rest-client (1.6.1)
|
|
30
|
+
mime-types (>= 1.16)
|
|
31
|
+
rspec (2.0.0)
|
|
32
|
+
rspec-core (= 2.0.0)
|
|
33
|
+
rspec-expectations (= 2.0.0)
|
|
34
|
+
rspec-mocks (= 2.0.0)
|
|
35
|
+
rspec-core (2.0.0)
|
|
36
|
+
rspec-expectations (2.0.0)
|
|
37
|
+
diff-lcs (>= 1.1.2)
|
|
38
|
+
rspec-mocks (2.0.0)
|
|
39
|
+
rspec-core (= 2.0.0)
|
|
40
|
+
rspec-expectations (= 2.0.0)
|
|
41
|
+
sys-uname (0.8.4)
|
|
42
|
+
thor (0.14.3)
|
|
43
|
+
|
|
44
|
+
PLATFORMS
|
|
45
|
+
ruby
|
|
46
|
+
|
|
47
|
+
DEPENDENCIES
|
|
48
|
+
errorstack!
|
|
49
|
+
guard-rspec (>= 0.1.2)
|
|
50
|
+
rspec (>= 1.3.0)
|
data/Guardfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Errorstack Ruby Gem
|
|
2
|
+
This is a simple ruby gem for adding errorstack to your ruby applications. Errorstack is a service for reporting and reviewing errors in your applications. You can checkout Errorstack at [http://errorstack.com](http://errorstack.com).
|
|
3
|
+
|
|
4
|
+
# Installation
|
|
5
|
+
gem install errorstack
|
|
6
|
+
|
|
7
|
+
# Usage
|
|
8
|
+
|
|
9
|
+
require 'errorstack'
|
|
10
|
+
|
|
11
|
+
# Obtain your errorstack stack key from http://errorstack.com
|
|
12
|
+
# Add message (string) and backtrace (text) to your stack schema.
|
|
13
|
+
|
|
14
|
+
Errorstack::STACK_KEY = "YOUR STACK KEY HERE"
|
|
15
|
+
|
|
16
|
+
begin
|
|
17
|
+
# some code here that may raise an error
|
|
18
|
+
rescue Exception => e
|
|
19
|
+
# error handling code
|
|
20
|
+
Errorstack.notify(e)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Contributing
|
|
24
|
+
|
|
25
|
+
Please feel free to contribute by forking the repo. Pull requests are welcome. Please update/include any applicable tests
|
|
26
|
+
|
|
27
|
+
# Author
|
|
28
|
+
|
|
29
|
+
[Mike Farmer](http://github.com/mikefarmer)
|
data/Rakefile
ADDED
data/errorstack.gemspec
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
+
require "errorstack/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.name = "errorstack"
|
|
7
|
+
s.version = Errorstack::VERSION
|
|
8
|
+
s.platform = Gem::Platform::RUBY
|
|
9
|
+
s.authors = ["Mike Farmer"]
|
|
10
|
+
s.email = ["mike.farmer@gmail.com"]
|
|
11
|
+
s.homepage = "http://rubygems.org/gems/errorstack"
|
|
12
|
+
s.summary = %q{Easily integrate ErrorStack with your ruby application.}
|
|
13
|
+
s.description = %q{Allows you to easily integrate ErrorStack into your ruby application. (see http://errorstack.com)}
|
|
14
|
+
|
|
15
|
+
s.rubyforge_project = "errorstack"
|
|
16
|
+
|
|
17
|
+
s.files = `git ls-files`.split("\n")
|
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
19
|
+
#s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
|
+
s.require_paths = ["lib"]
|
|
21
|
+
s.add_dependency("rest-client", [">= 1.6.1"])
|
|
22
|
+
s.add_development_dependency("rspec", [">= 1.3.0"])
|
|
23
|
+
s.add_development_dependency("guard-rspec", [">= 0.1.2"])
|
|
24
|
+
|
|
25
|
+
end
|
data/lib/errorstack.rb
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'restclient'
|
|
2
|
+
module Errorstack
|
|
3
|
+
# USAGE:
|
|
4
|
+
# ErrorStack::STACK_KEY = 'your stack key here'
|
|
5
|
+
# begin
|
|
6
|
+
# some faulty code here
|
|
7
|
+
# rescue Exception => e
|
|
8
|
+
# # Other error handling here
|
|
9
|
+
# Errorstack.es_notify(e)
|
|
10
|
+
# end
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def self.notify(exception)
|
|
14
|
+
raise "You must specify a STACK_KEY" unless defined? STACK_KEY
|
|
15
|
+
|
|
16
|
+
params = {
|
|
17
|
+
:_s => STACK_KEY,
|
|
18
|
+
:_r => "json",
|
|
19
|
+
:postingIP => "0.0.0.0",
|
|
20
|
+
:createdDate => Time.now.to_s,
|
|
21
|
+
:message => exception.message,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
params[:backtrace] = exception.backtrace.join(",") rescue ""
|
|
25
|
+
|
|
26
|
+
begin
|
|
27
|
+
RestClient.post("http://www.errorstack.com/submit", params)
|
|
28
|
+
rescue
|
|
29
|
+
raise "Unable to submit an ErrorStack error."
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require File.expand_path("../../lib", __FILE__) + "/errorstack"
|
|
2
|
+
|
|
3
|
+
describe Errorstack do
|
|
4
|
+
|
|
5
|
+
before :all do
|
|
6
|
+
Errorstack::STACK_KEY = "4d71562ee8c71af971a66afbb4e3aaba"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should post and error to errorstack" do
|
|
10
|
+
e = StandardError.new("Testing 123")
|
|
11
|
+
Errorstack.notify(e)
|
|
12
|
+
1.should == 1
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: errorstack
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 29
|
|
5
|
+
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 0
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.0.1
|
|
11
|
+
platform: ruby
|
|
12
|
+
authors:
|
|
13
|
+
- Mike Farmer
|
|
14
|
+
autorequire:
|
|
15
|
+
bindir: bin
|
|
16
|
+
cert_chain: []
|
|
17
|
+
|
|
18
|
+
date: 2011-04-18 00:00:00 -06:00
|
|
19
|
+
default_executable:
|
|
20
|
+
dependencies:
|
|
21
|
+
- !ruby/object:Gem::Dependency
|
|
22
|
+
name: rest-client
|
|
23
|
+
prerelease: false
|
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
hash: 13
|
|
30
|
+
segments:
|
|
31
|
+
- 1
|
|
32
|
+
- 6
|
|
33
|
+
- 1
|
|
34
|
+
version: 1.6.1
|
|
35
|
+
type: :runtime
|
|
36
|
+
version_requirements: *id001
|
|
37
|
+
- !ruby/object:Gem::Dependency
|
|
38
|
+
name: rspec
|
|
39
|
+
prerelease: false
|
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
hash: 27
|
|
46
|
+
segments:
|
|
47
|
+
- 1
|
|
48
|
+
- 3
|
|
49
|
+
- 0
|
|
50
|
+
version: 1.3.0
|
|
51
|
+
type: :development
|
|
52
|
+
version_requirements: *id002
|
|
53
|
+
- !ruby/object:Gem::Dependency
|
|
54
|
+
name: guard-rspec
|
|
55
|
+
prerelease: false
|
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
hash: 31
|
|
62
|
+
segments:
|
|
63
|
+
- 0
|
|
64
|
+
- 1
|
|
65
|
+
- 2
|
|
66
|
+
version: 0.1.2
|
|
67
|
+
type: :development
|
|
68
|
+
version_requirements: *id003
|
|
69
|
+
description: Allows you to easily integrate ErrorStack into your ruby application. (see http://errorstack.com)
|
|
70
|
+
email:
|
|
71
|
+
- mike.farmer@gmail.com
|
|
72
|
+
executables: []
|
|
73
|
+
|
|
74
|
+
extensions: []
|
|
75
|
+
|
|
76
|
+
extra_rdoc_files: []
|
|
77
|
+
|
|
78
|
+
files:
|
|
79
|
+
- .gitignore
|
|
80
|
+
- Gemfile
|
|
81
|
+
- Gemfile.lock
|
|
82
|
+
- Guardfile
|
|
83
|
+
- README.md
|
|
84
|
+
- Rakefile
|
|
85
|
+
- errorstack.gemspec
|
|
86
|
+
- lib/errorstack.rb
|
|
87
|
+
- lib/errorstack/version.rb
|
|
88
|
+
- spec/errorstack_spec.rb
|
|
89
|
+
has_rdoc: true
|
|
90
|
+
homepage: http://rubygems.org/gems/errorstack
|
|
91
|
+
licenses: []
|
|
92
|
+
|
|
93
|
+
post_install_message:
|
|
94
|
+
rdoc_options: []
|
|
95
|
+
|
|
96
|
+
require_paths:
|
|
97
|
+
- lib
|
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
|
+
none: false
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
hash: 3
|
|
104
|
+
segments:
|
|
105
|
+
- 0
|
|
106
|
+
version: "0"
|
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
|
+
none: false
|
|
109
|
+
requirements:
|
|
110
|
+
- - ">="
|
|
111
|
+
- !ruby/object:Gem::Version
|
|
112
|
+
hash: 3
|
|
113
|
+
segments:
|
|
114
|
+
- 0
|
|
115
|
+
version: "0"
|
|
116
|
+
requirements: []
|
|
117
|
+
|
|
118
|
+
rubyforge_project: errorstack
|
|
119
|
+
rubygems_version: 1.6.2
|
|
120
|
+
signing_key:
|
|
121
|
+
specification_version: 3
|
|
122
|
+
summary: Easily integrate ErrorStack with your ruby application.
|
|
123
|
+
test_files:
|
|
124
|
+
- spec/errorstack_spec.rb
|