trackets 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2dbf014142cf8754519141f942b30fcf611208b
4
- data.tar.gz: 4d980a1f00648ab4202f6ab395529740d0c2289b
3
+ metadata.gz: 672666de6f3aa1d0a7cd8864000996cc3b510582
4
+ data.tar.gz: e4a847516c94688548110edccc542c886175f808
5
5
  SHA512:
6
- metadata.gz: 33d10a87d3596d5478d29bb00a9265a109eb17297bc00ee799cd27143529b33fbd950591541dea43acdde4f486ad13e2fc961aa35e304bb63e12e4bf4e62fdf8
7
- data.tar.gz: 1515bbe0dcee9a762154e948249aa21ed7dba4d3f7c2547c799e2405449349357286318e51e95b0ff9b5937d08a9ee1000567cbd44c0846aa893c930f253d545
6
+ metadata.gz: 20a6b18843d0be48d895cff4cb2a18efd0935fc34f47a5b8e7753f0fd7cebaeafa9091720a3032542ba62b176f4a5ae0efb71b1af5873a314b57386e22ba3d3b
7
+ data.tar.gz: b2cde6f4ff46f8cab19bb1a8faf5e1bcfe475b89b9c6ee5d58d4854c368aa6699277794fca4c4a7c43a4748431e3ceeb7993e5c80c3ebe7b976d3d77ccc75c78
data/README.md CHANGED
@@ -15,6 +15,7 @@ And then execute:
15
15
  ## Usage
16
16
 
17
17
  $ rails g trackets:install API_KEY
18
+ $ rake trackets:test # To send testing exception
18
19
 
19
20
  ## Rails
20
21
 
@@ -24,6 +25,29 @@ To include JavaScript tracking code in your app just add this line to your `app/
24
25
  <%= trackets_include_tag %>
25
26
  ```
26
27
 
28
+ ## Rack
29
+
30
+ Simple `example.ru`
31
+
32
+ ```ruby
33
+ require 'rack'
34
+ require 'trackets'
35
+
36
+ Trackets.setup do |config|
37
+ config.api_key = "insert-valid-api-key"
38
+ end
39
+
40
+ app = Rack::Builder.app do
41
+ run lambda { |env| raise "Testing Error" }
42
+ end
43
+
44
+ use Trackets::Middleware::RackExceptionHandler
45
+ run app
46
+ ```
47
+
48
+ ## Rake tasks
49
+ $ rake trackets:notify MESSAGE="Custom message from Rake"
50
+
27
51
  ## Contributing
28
52
 
29
53
  1. Fork it ( https://github.com/[my-github-username]/trackets/fork )
@@ -1,3 +1,21 @@
1
+ # Middleware for Rack applications
2
+ #
3
+ # Example of a basic Rack app
4
+ #
5
+ # require 'rack'
6
+ # require 'trackets'
7
+ #
8
+ # Trackets.setup do |config|
9
+ # config.api_key = "insert-valid-api-key"
10
+ # end
11
+ #
12
+ # app = Rack::Builder.app do
13
+ # run lambda { |env| raise "Testing Error" }
14
+ # end
15
+ #
16
+ # use Trackets::Middleware::RackExceptionHandler
17
+ # run app
18
+
1
19
  module Trackets
2
20
  module Middleware
3
21
  class RackExceptionHandler
@@ -8,9 +26,9 @@ module Trackets
8
26
 
9
27
  def call(env)
10
28
  response = @app.call(env)
11
- rescue RuntimeError => exception
29
+ rescue Exception => exception
12
30
  Trackets.notify(exception, env)
13
- raise exception
31
+ raise
14
32
  end
15
33
 
16
34
  end
@@ -1,5 +1,4 @@
1
1
  require "trackets/view_helpers"
2
- require "trackets/middleware/rack_exception_handler"
3
2
 
4
3
  module Trackets
5
4
  class Railtie < Rails::Railtie
@@ -1,3 +1,3 @@
1
1
  module Trackets
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/trackets.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "trackets/version"
2
2
  require "trackets/railtie" if defined?(Rails)
3
+ require "trackets/middleware/rack_exception_handler"
3
4
  require "trackets/configuration"
4
5
  require "trackets/client"
5
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Votava
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-06 00:00:00.000000000 Z
11
+ date: 2014-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json