appygram-rails 1.0.2 → 1.0.3
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 +3 -7
- data/MIT-LICENSE +2 -2
- data/README.md +61 -0
- data/lib/appygram-rails/integration/rack_rails.rb +6 -2
- data/lib/appygram-rails/version.rb +1 -1
- metadata +7 -8
- data/History.txt +0 -2
- data/README.markdown +0 -43
data/.gitignore
CHANGED
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (
|
1
|
+
Copyright (C)2012 Solertium
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person
|
4
4
|
obtaining a copy of this software and associated documentation
|
@@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
19
19
|
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
20
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
21
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# Appygram <http://www.appygram.com> - for Rails 3
|
2
|
+
|
3
|
+
Appygram is a messaging service for web and mobile apps.
|
4
|
+
|
5
|
+
This Gem/Plugin is for Rails applications. It will send uncaught
|
6
|
+
exception reports (server error pages / "500 errors") to the
|
7
|
+
Appygram trace service, which will count them and send notifications
|
8
|
+
as appropriate.
|
9
|
+
|
10
|
+
## Rails Installation
|
11
|
+
|
12
|
+
1. Add the appygram-rails gem entry to your Gemfile
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'appygram-rails'
|
16
|
+
```
|
17
|
+
|
18
|
+
2. Run <code>bundle install</code>
|
19
|
+
|
20
|
+
3. Configure your API Key. If you will use Appygram in both development
|
21
|
+
and production, you can put it in an initializer, e.g.
|
22
|
+
<code>config/initializers/appygram.rb</code>. Otherwise, just put
|
23
|
+
it in <code>config/environments/production.rb</code>:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
Appygram.configure :api_key => 'your_api_key'
|
27
|
+
```
|
28
|
+
|
29
|
+
Use a valid API key for your app provided by Appygram.
|
30
|
+
|
31
|
+
4. A restart is required to pick up new gems and configuration.
|
32
|
+
|
33
|
+
## Additional configuration
|
34
|
+
|
35
|
+
To properly route messages about exception traces, you will probably
|
36
|
+
want to at least set the default topic to some topic name configured
|
37
|
+
in your Appygram dashboard:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
Appygram.configure :topic => 'Uncaught Exception'
|
41
|
+
```
|
42
|
+
|
43
|
+
For more configuration options, see the instructions for the core
|
44
|
+
Appygram gem: <https://github.com/anythinglabs/appygram.rb>
|
45
|
+
|
46
|
+
You can also read there about how to programmatically call Appygram
|
47
|
+
to send user-generated messages or rescued exceptions.
|
48
|
+
|
49
|
+
## Automatic devise (and similar) integration
|
50
|
+
|
51
|
+
If an exception occurs within any Rails controller that responds
|
52
|
+
to "current_user", this gem will auto-fill the "name" and "email"
|
53
|
+
properties of the trace with the associated properties of
|
54
|
+
current_user.
|
55
|
+
|
56
|
+
## Automatic context information
|
57
|
+
|
58
|
+
The current request context, including URI, parameters, and
|
59
|
+
headers, is serialized into the app_json field of the trace.
|
60
|
+
|
61
|
+
Copyright © 2012 Solertium.
|
@@ -12,12 +12,16 @@ module Rack
|
|
12
12
|
begin
|
13
13
|
body = @app.call(env)
|
14
14
|
rescue Exception => e
|
15
|
-
|
15
|
+
unless e.is_a? ActionController::RoutingError
|
16
|
+
::AppygramRails::Catcher.handle_with_controller(e,env['action_controller.instance'], Rack::Request.new(env))
|
17
|
+
end
|
16
18
|
raise
|
17
19
|
end
|
18
20
|
|
19
21
|
if env['rack.exception']
|
20
|
-
|
22
|
+
unless env['rack.exception'].is_a? ActionController::RoutingError
|
23
|
+
::AppygramRails::Catcher.handle_with_controller(env['rack.exception'],env['action_controller.instance'], Rack::Request.new(env))
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
27
|
body
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appygram-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
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
|
+
date: 2012-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: appygram
|
16
|
-
requirement: &
|
16
|
+
requirement: &70186041638940 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: 1.0.3
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70186041638940
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rack
|
30
|
-
requirement: &
|
30
|
+
requirement: &70186041638260 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70186041638260
|
39
39
|
description: appygram-rails sends uncaught Rails exceptions as traces to the hosted
|
40
40
|
messaging service at http://www.appygram.com
|
41
41
|
email:
|
@@ -46,9 +46,8 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- .gitignore
|
48
48
|
- Gemfile
|
49
|
-
- History.txt
|
50
49
|
- MIT-LICENSE
|
51
|
-
- README.
|
50
|
+
- README.md
|
52
51
|
- Rakefile
|
53
52
|
- appygram-rails.gemspec
|
54
53
|
- lib/appygram-rails.rb
|
data/History.txt
DELETED
data/README.markdown
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# Appygram <http://www.appygram.com>
|
2
|
-
|
3
|
-
Appygram is a messaging service for web and mobile apps. Among other
|
4
|
-
things, it can accept and route exception reports.
|
5
|
-
|
6
|
-
This Gem/Plugin is for Rails applications. It will route uncaught
|
7
|
-
exception reports via Appygram.
|
8
|
-
|
9
|
-
## Rails 3 Installation
|
10
|
-
|
11
|
-
1. Add gem entry to Gemfile
|
12
|
-
|
13
|
-
```ruby
|
14
|
-
gem 'appygram-rails'
|
15
|
-
```
|
16
|
-
|
17
|
-
2. Run <code>bundle install</code>
|
18
|
-
|
19
|
-
3. Configue your API Key in an initializer, e.g. config/appygram.rb
|
20
|
-
|
21
|
-
```ruby
|
22
|
-
Appygram.configure 'your_api_key'
|
23
|
-
```
|
24
|
-
|
25
|
-
using a valid API key for your app provided by Appygram
|
26
|
-
|
27
|
-
## Limiting messages
|
28
|
-
|
29
|
-
This client will limit the number of exact duplicate messages it sends
|
30
|
-
to Appygram per day. The default limit is 25 duplicates. You can adjust
|
31
|
-
this in the initializer:
|
32
|
-
|
33
|
-
```
|
34
|
-
Appygram.set_duplicate_limit 1
|
35
|
-
```
|
36
|
-
|
37
|
-
Setting a limit of 0 will disable the duplicate check entirely.
|
38
|
-
|
39
|
-
In addition to this coarse daily client-side limit, you can
|
40
|
-
configure the number of alerts forwarded to each recipient, per
|
41
|
-
hour, in the Appygram web console.
|
42
|
-
|
43
|
-
Copyright © 2012 Anything Labs.
|