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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dda9bffe78477e76299653293cc43ac992a8995
4
- data.tar.gz: 46f4cb458a0dc2a918c29f9e63b3b8ce8dbd9013
3
+ metadata.gz: a7f2a21cd4573317517ed282fa6820600ff69b4c
4
+ data.tar.gz: 4b58457abf52246715226a4c0ec86bb248f2134b
5
5
  SHA512:
6
- metadata.gz: 54fa57bdace2165866597620c1139191fffc8bc4fea07b6bca0d48e7c6a827f0a037bfdb642d037422ab1a269d2c915073ef4fab781fc8b31746ddfed4fe2996
7
- data.tar.gz: 57b623c3e4b970dde7bf53921ac4b91071fef9f9088d3d382344af79796800c4701a73bf2bfb39f3ea40198900cba3feb594114220931936b524d06b042e328a
6
+ metadata.gz: c1f1ac1767ee82fd8b08171e03a5d1e7c53762279fb5a29e3720e96c5382d2a84633979748db9ff8f18c4987f53288b334992385d4c924de338ab1737fafddf5
7
+ data.tar.gz: c47dcbf8981c8ed9d5b7f10065eff314687b003a8c387a35013df6d1e2ecfd40b1e3d1592533ab32525ea21c05104ae44b62307eba0a39813cd9fb42dfcffff7
@@ -10,7 +10,8 @@ module WatCatcher
10
10
  backtrace: exception.backtrace.to_a,
11
11
  message: exception.message,
12
12
  error_class: exception.class.to_s,
13
- app_env: ::Rails.env.to_s
13
+ app_env: ::Rails.env.to_s,
14
+ app_name: ::Rails.application.class.parent_name
14
15
  }
15
16
  }
16
17
 
@@ -1,3 +1,3 @@
1
1
  module WatCatcher
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -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 @appEnv? && @host?
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.1
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