ga_events 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/app/assets/javascripts/ga_events.js.coffee +14 -4
- data/lib/ga_events/middleware.rb +5 -3
- data/lib/ga_events/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d58cdb3aafef92d454bb79021d01ed65773e710d
|
4
|
+
data.tar.gz: 2b46d6a7bcb1906f68a95f100521c65644cfedc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8139269a9fa960a91f3fda4dd8bebc113fba30eaf84ecff627408aa446333e40e5d56a5eb792f71a588189c82d42d9c0d33c8a5524814530c407f4c87a11e123
|
7
|
+
data.tar.gz: 664f45cd5043f86e61608fd434e530dd71e4b0fdd4b14beff7a6f9adb3a6faffabc46c20048bb9b3466b0383b5726b360d5d126ef182754564f84495e6e4ec14
|
data/CHANGELOG.md
CHANGED
@@ -33,3 +33,9 @@ The format suggested at http://keepachangelog.com/ is used.
|
|
33
33
|
changes orchestrated by turbolinks, events are no longer processed via the
|
34
34
|
injected DOM node. (Because the node would be cached and the event already
|
35
35
|
processed.) Instead the the header-strategy is being used.
|
36
|
+
|
37
|
+
## 1.4.1 - 2018-04-03
|
38
|
+
|
39
|
+
### Fixed
|
40
|
+
- Ensure category, action and label do not include any umlauts or ß chars
|
41
|
+
- Fixed an error where events are remaining after a redirect
|
@@ -32,11 +32,21 @@ class GaEvents.Event
|
|
32
32
|
@klass.list.push @
|
33
33
|
@klass.flush()
|
34
34
|
|
35
|
+
escape: (str) ->
|
36
|
+
return unless str
|
37
|
+
"#{str}".replace(/ä/g, "ae")
|
38
|
+
.replace(/ö/g, "oe")
|
39
|
+
.replace(/ü/g, "ue")
|
40
|
+
.replace(/Ä/g, "Ae")
|
41
|
+
.replace(/Ö/g, "Oe")
|
42
|
+
.replace(/Ü/g, "Ue")
|
43
|
+
.replace(/ß/g, "ss")
|
44
|
+
|
35
45
|
to_hash: ->
|
36
|
-
# Category, action and label must be of type string.
|
37
|
-
action:
|
38
|
-
category:
|
39
|
-
label:
|
46
|
+
# Category, action and label must be escaped and of type string.
|
47
|
+
action: @escape(@action)
|
48
|
+
category: @escape(@category)
|
49
|
+
label: @escape(@label)
|
40
50
|
# Value has to be a positive integer or defaults to 1
|
41
51
|
value: @to_positive_integer(@value)
|
42
52
|
|
data/lib/ga_events/middleware.rb
CHANGED
@@ -43,15 +43,17 @@ module GaEvents
|
|
43
43
|
# Fix for Rails 4
|
44
44
|
flash &&= flash['flashes'] if Rails::VERSION::MAJOR > 3
|
45
45
|
|
46
|
-
|
46
|
+
# The key has to be removed from the flash here to ensure it does not
|
47
|
+
# remain after the finished redirect. This copies the behaviour of the
|
48
|
+
# "#use" and "#sweep" methods of the rails flash middleware:
|
49
|
+
# https://github.com/rails/rails/blob/v3.2.14/actionpack/lib/action_dispatch/middleware/flash.rb#L220
|
50
|
+
GaEvents::List.init(flash && flash.delete('ga_events'))
|
47
51
|
end
|
48
52
|
|
49
53
|
def add_events_to_flash env, serialized_data
|
50
54
|
flash_hash = env[ActionDispatch::Flash::KEY]
|
51
55
|
flash_hash ||= ActionDispatch::Flash::FlashHash.new
|
52
56
|
flash_hash['ga_events'] = serialized_data
|
53
|
-
# Discard the flash after the action completes.
|
54
|
-
flash_hash.discard('ga_events')
|
55
57
|
|
56
58
|
env[ActionDispatch::Flash::KEY] = flash_hash
|
57
59
|
end
|
data/lib/ga_events/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ga_events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Dütsch
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
72
|
rubyforge_project:
|
73
|
-
rubygems_version: 2.
|
73
|
+
rubygems_version: 2.5.2
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: This gem allows you to annotate events everywhere in the code of your Rails
|