wat_catcher 0.5.3 → 0.5.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4aa334c6634706d075857044218ed559877c0dc6
4
- data.tar.gz: 9f7a7c8af3e7c3a34a4cc490b7e6907253f56b1c
3
+ metadata.gz: 2c9ea1606de420bf6dcbd03c3cdcaf1904bf316a
4
+ data.tar.gz: 9c8fe3d3d781be1b3fdfea34d7bed7722d01ca39
5
5
  SHA512:
6
- metadata.gz: e7fced4c2bc850dee9bb309be2f0bd82a4add929e1f6a958df1c1eda1ffd2a0c979ef79e8baa2db6c75fa40da6769dd01e13c37fc6a47f96c8ad39b346cbb08c
7
- data.tar.gz: e7e5ad54fc6e647d53dd7e608857d858693ae85ec3fcee80129ac602efbbf0475cef2e10cbc194e6e50123929671fdafc54688658ddae102da9c9566e578f5ae
6
+ metadata.gz: e22374dcbb5ab2ae6247658be773a5c356f4f1606e14f3201ff9681c271867f94cf765e4246a19a8260d3025295cf84b30af933c38e1e8b2204fa12c04c10bd0
7
+ data.tar.gz: 0a02f0485c097ce4040835ac44688c6df3055208e8205e194249fa50127fe1785794d24e351879b6a411e59e0970d270256c299da83d567e1863239c2d89a8d6
@@ -6,6 +6,8 @@ module WatCatcher
6
6
 
7
7
  included do
8
8
  around_filter :catch_wats
9
+
10
+ helper_method :wat_user
9
11
  end
10
12
 
11
13
  def wat_user
@@ -1,7 +1,9 @@
1
1
  module WatCatcher
2
- class WatsController < ApplicationController
2
+ class WatsController < ActionController::Base
3
3
  skip_before_filter :verify_authenticity_token, only: :create
4
4
 
5
+ include WatCatcher::CatcherOfWats
6
+
5
7
  def create
6
8
  Report.new(nil, request: request)
7
9
  head :ok
@@ -1,3 +1,3 @@
1
1
  module WatCatcher
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
@@ -2,8 +2,11 @@ module WatCatcher
2
2
  module Helper
3
3
  def javascript_wat_catcher
4
4
  javascript_include_tag "wat_catcher",
5
- "data-route" => wat_catcher.wats_path,
6
- "data-app_name" => ::Rails.application.class.parent_name
5
+ data: {
6
+ route: wat_catcher.wats_path,
7
+ app_name: ::Rails.application.class.parent_name,
8
+ app_user: wat_user.as_json
9
+ }
7
10
  end
8
11
  end
9
12
  end
@@ -1,3 +1,5 @@
1
+ parseJson = JSON.parse || jQuery.parseJSON
2
+
1
3
  #Send the error to the same host that served this file (I think)
2
4
  class @WatCatcher
3
5
  constructor: (target=window) ->
@@ -9,6 +11,9 @@ class @WatCatcher
9
11
  if attrs?
10
12
  @attrs[attrs[1]] = attr.nodeValue
11
13
 
14
+
15
+ @app_user = parseJson(@attrs["app-user"]) if (parseJson? && @attrs["app-user"])
16
+
12
17
  @oldErrorHandler = target.onerror
13
18
  target.onerror = @watHandler
14
19
 
@@ -38,6 +43,7 @@ class @WatCatcher
38
43
  message: msg
39
44
  backtrace: [url+":"+line]
40
45
  language: "javascript"
46
+ app_user: @app_user
41
47
  }
42
48
  }
43
49
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wat_catcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Constantine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-02 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler