ga_events 1.2.0 → 1.3.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: acab037a84ed4bd6ff892744d24c0270023055af
4
+ data.tar.gz: 6da543d25941f0128285fe2964d94118b1c6a1e1
5
+ SHA512:
6
+ metadata.gz: b2fccbaa3ef57085a8676e4e639241da81b4cf460adf1bbc86180ba6ecf15446cacc1dcda3934890a999f7b21804980d6f00b0785b249f43b96ed2f4819c397a
7
+ data.tar.gz: 3cdda60841102469a07254d7d5be1b5b9629f71391f79df423633367cacdb02a845e9dcacd8f439b4efed4b3b8a0f2aea65b21e5278a19943632be166034ad4a
data/CHANGELOG.md CHANGED
@@ -15,3 +15,13 @@ The format suggested at http://keepachangelog.com/ is used.
15
15
 
16
16
  ### Fixed
17
17
  - Error returns white page
18
+
19
+ ## 1.2.0 - 2014-12-18
20
+
21
+ ### Added
22
+ - A Test Adapter that pushes events to a `window.events` array.
23
+
24
+ ## 1.3.0 - 2017-04-27
25
+
26
+ ### Added
27
+ - Support for turbolinks.
@@ -11,12 +11,16 @@ class GaEvents.Event
11
11
  @html_key: "ga-events"
12
12
  klass: @
13
13
 
14
- # Decompose a dom-string (ruby side) into an event object.
14
+ # Decompose a event-string (ruby side) into an event object.
15
15
  @from_string: (string) ->
16
16
  $.map string.split("$"), (part) =>
17
17
  [category, action, label, value] = part.split "|"
18
18
  new @(category, action, label, value)
19
19
 
20
+ @from_dom: ->
21
+ dom_events = $("div[data-#{@html_key}]").data @html_key
22
+ @from_string dom_events if dom_events?
23
+
20
24
  # Events should not be send to an adapter unless the DOM has finished loading.
21
25
  @flush: ->
22
26
  if @list.length > 0 and @may_flush
@@ -50,8 +54,8 @@ class GaEvents.Event
50
54
  xhr_events = xhr.getResponseHeader @header_key
51
55
  @from_string xhr_events if xhr_events?
52
56
 
53
- dom_events = $("div[data-#{@html_key}]").data @html_key
54
- @from_string dom_events if dom_events?
57
+ @from_dom()
58
+ $(document).on "turbolinks:load", => @from_dom()
55
59
 
56
60
  class GaEvents.GoogleTagManagerAdapter
57
61
  constructor: (@event = "ga_event") ->
@@ -1,3 +1,3 @@
1
1
  module GaEvents
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ga_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Florian Dütsch
@@ -10,22 +9,20 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-12-18 00:00:00.000000000 Z
12
+ date: 2017-05-11 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: '3.1'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: '3.1'
31
28
  description: Google Analytics' Event Tracking everywhere in your Rails app)
@@ -36,7 +33,7 @@ executables: []
36
33
  extensions: []
37
34
  extra_rdoc_files: []
38
35
  files:
39
- - .gitignore
36
+ - ".gitignore"
40
37
  - CHANGELOG.md
41
38
  - Gemfile
42
39
  - LICENSE
@@ -55,27 +52,26 @@ files:
55
52
  - spec/spec_helper.rb
56
53
  homepage: https://github.com/Nix-wie-weg/ga_events
57
54
  licenses: []
55
+ metadata: {}
58
56
  post_install_message:
59
57
  rdoc_options: []
60
58
  require_paths:
61
59
  - lib
62
60
  required_ruby_version: !ruby/object:Gem::Requirement
63
- none: false
64
61
  requirements:
65
- - - ! '>='
62
+ - - ">="
66
63
  - !ruby/object:Gem::Version
67
64
  version: '0'
68
65
  required_rubygems_version: !ruby/object:Gem::Requirement
69
- none: false
70
66
  requirements:
71
- - - ! '>='
67
+ - - ">="
72
68
  - !ruby/object:Gem::Version
73
69
  version: '0'
74
70
  requirements: []
75
71
  rubyforge_project:
76
- rubygems_version: 1.8.23
72
+ rubygems_version: 2.5.2
77
73
  signing_key:
78
- specification_version: 3
74
+ specification_version: 4
79
75
  summary: This gem allows you to annotate events everywhere in the code of your Rails
80
76
  app. A rack middleware is automatically inserted into the stack. It transports the
81
77
  event data to the client. Normal requests get a DIV injected, AJAX requests get
@@ -85,4 +81,3 @@ summary: This gem allows you to annotate events everywhere in the code of your R
85
81
  test_files:
86
82
  - spec/middleware_spec.rb
87
83
  - spec/spec_helper.rb
88
- has_rdoc: