wat_catcher 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wat_catcher/sidekiq_poster.rb +2 -1
- data/lib/wat_catcher/version.rb +1 -1
- data/lib/wat_catcher/wattle_helper.rb +1 -1
- data/spec/javascripts/support/jasmine_helper.rb +11 -0
- data/spec/javascripts/wat_catcher_spec.coffee +0 -16
- data/vendor/assets/javascripts/wat_catcher.coffee +4 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7f2a21cd4573317517ed282fa6820600ff69b4c
|
4
|
+
data.tar.gz: 4b58457abf52246715226a4c0ec86bb248f2134b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1f1ac1767ee82fd8b08171e03a5d1e7c53762279fb5a29e3720e96c5382d2a84633979748db9ff8f18c4987f53288b334992385d4c924de338ab1737fafddf5
|
7
|
+
data.tar.gz: c47dcbf8981c8ed9d5b7f10065eff314687b003a8c387a35013df6d1e2ecfd40b1e3d1592533ab32525ea21c05104ae44b62307eba0a39813cd9fb42dfcffff7
|
data/lib/wat_catcher/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module WatCatcher
|
2
2
|
module Helper
|
3
3
|
def javascript_wat_catcher
|
4
|
-
javascript_include_tag "wat_catcher", "data-host" => WatCatcher.configuration.host, "data-app_env" => ::Rails.env
|
4
|
+
javascript_include_tag "wat_catcher", "data-host" => WatCatcher.configuration.host, "data-app_env" => ::Rails.env, "data-app_name" => ::Rails.application.class.parent_name
|
5
5
|
end
|
6
6
|
end
|
7
7
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#Use this file to set/override Jasmine configuration options
|
2
|
+
#You can remove it if you don't need it.
|
3
|
+
#This file is loaded *after* jasmine.yml is interpreted.
|
4
|
+
#
|
5
|
+
#Example: using a different boot file.
|
6
|
+
#Jasmine.configure do |config|
|
7
|
+
# config.boot_dir = '/absolute/path/to/boot_dir'
|
8
|
+
# config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] }
|
9
|
+
#end
|
10
|
+
#
|
11
|
+
|
@@ -3,12 +3,8 @@ describe "WatCatcher", ->
|
|
3
3
|
@errorTarget = {}
|
4
4
|
@errorTarget.onerror = -> "Howdy"
|
5
5
|
@watCatcher = new WatCatcher @errorTarget
|
6
|
-
@watCatcher.appEnvsToWorryAbout = ['production', 'staging', 'demo']
|
7
6
|
@watCatcher.appEnv = 'production'
|
8
7
|
|
9
|
-
@xmlhttp = jasmine.createSpyObj('XMLHttpRequest', ['send', 'setRequestHeader', 'open'])
|
10
|
-
spyOn(window, 'XMLHttpRequest').andReturn(@xmlhttp)
|
11
|
-
|
12
8
|
@msg = 'sadly, there was a terrible mistake'
|
13
9
|
@line = '42'
|
14
10
|
|
@@ -20,15 +16,3 @@ describe "WatCatcher", ->
|
|
20
16
|
@watCatcher.watHandler(@msg, document.URL, @line)
|
21
17
|
expect(@watCatcher.watHandler()).toEqual "Howdy"
|
22
18
|
|
23
|
-
it "sends xhr on error", ->
|
24
|
-
try
|
25
|
-
window.goobilygoo()
|
26
|
-
catch error
|
27
|
-
@watCatcher.watHandler(error.message, document.URL, error.lineNumber)
|
28
|
-
|
29
|
-
expect(@xmlhttp.send).toHaveBeenCalled()
|
30
|
-
|
31
|
-
it "doesn't send wats in irrelevant appEnv", ->
|
32
|
-
@watCatcher.appEnv = 'development'
|
33
|
-
@watCatcher.watHandler(@msg, document.URL, @line)
|
34
|
-
expect(@xmlhttp.send).not.toHaveBeenCalled()
|
@@ -10,7 +10,9 @@ class @WatCatcher
|
|
10
10
|
@host = attr.nodeValue
|
11
11
|
if attr.nodeName == 'data-app_env'
|
12
12
|
@appEnv = attr.nodeValue
|
13
|
-
if
|
13
|
+
if attr.nodeName == 'data-app_name'
|
14
|
+
@appName = attr.nodeValue
|
15
|
+
if @appEnv? && @host? && @appName?
|
14
16
|
break
|
15
17
|
|
16
18
|
@oldErrorHandler = target.onerror
|
@@ -42,6 +44,7 @@ class @WatCatcher
|
|
42
44
|
message: msg
|
43
45
|
backtrace: [url+":"+line]
|
44
46
|
app_env: @appEnv
|
47
|
+
app_name: @appName
|
45
48
|
}
|
46
49
|
}
|
47
50
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wat_catcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Constantine
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- lib/wat_catcher/version.rb
|
147
147
|
- lib/wat_catcher/wattle_helper.rb
|
148
148
|
- spec/javascripts/support/jasmine.yml
|
149
|
+
- spec/javascripts/support/jasmine_helper.rb
|
149
150
|
- spec/javascripts/wat_catcher_spec.coffee
|
150
151
|
- vendor/assets/javascripts/wat_catcher.coffee
|
151
152
|
- wat_catcher.gemspec
|
@@ -175,4 +176,5 @@ specification_version: 4
|
|
175
176
|
summary: A gem for registering Wats from your rails app
|
176
177
|
test_files:
|
177
178
|
- spec/javascripts/support/jasmine.yml
|
179
|
+
- spec/javascripts/support/jasmine_helper.rb
|
178
180
|
- spec/javascripts/wat_catcher_spec.coffee
|