algometrics 0.1.1 → 0.2.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 +4 -4
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/lib/algometrics/client.rb +12 -2
- data/lib/algometrics/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9529b22bc054daecfe2ebaae799fab86f15f2d5
|
|
4
|
+
data.tar.gz: 7161cc4170b914f076255377cef9b1cf3929b064
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30a355abc4bafd98153913e31c94d3960059c279f2f80295fc83fdc7259f7e09142ebc8b22d570d6db76c76558ef470317b35311f71a33dc2e42b9c8d25a7e62
|
|
7
|
+
data.tar.gz: 0e426098350d3b70ed77899202042c413b9a85b8aa348f22f26b29f73b157aaeb32611b4e7aad369c0ee7c5020efd7d5b40df0a9db183212358e482608a10187
|
data/bin/console
CHANGED
|
File without changes
|
data/bin/setup
CHANGED
|
File without changes
|
data/lib/algometrics/client.rb
CHANGED
|
@@ -55,7 +55,14 @@ module Algometrics
|
|
|
55
55
|
|
|
56
56
|
def track(event:, actor:, status: Algometrics::SUCCESS)
|
|
57
57
|
unless valid_actor?(actor)
|
|
58
|
-
Algometrics::Client.logger.error("
|
|
58
|
+
Algometrics::Client.logger.error("Algometrics client error: invalid actor: '#{actor}' " \
|
|
59
|
+
"actor type and id must be of the following format: /\\A[\\w\\- ]+\\z/")
|
|
60
|
+
return
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
unless valid_event_name?(event)
|
|
64
|
+
Algometrics::Client.logger.error("Algometrics client error: invalid event name: '#{event}' " \
|
|
65
|
+
"event name must be of the following format: /\\A[\\w\\- ]+\\z/")
|
|
59
66
|
return
|
|
60
67
|
end
|
|
61
68
|
|
|
@@ -91,7 +98,7 @@ module Algometrics
|
|
|
91
98
|
end
|
|
92
99
|
|
|
93
100
|
def validate_actor_string(str)
|
|
94
|
-
!(str =~ /\A\w
|
|
101
|
+
!(str =~ /\A[\w\- ]+#[\w\- ]+\z/).nil?
|
|
95
102
|
end
|
|
96
103
|
|
|
97
104
|
def validate_actor_hash(hash)
|
|
@@ -110,5 +117,8 @@ module Algometrics
|
|
|
110
117
|
end
|
|
111
118
|
end
|
|
112
119
|
|
|
120
|
+
def valid_event_name?(str)
|
|
121
|
+
!(str =~ /\A[\w\- ]+\z/).nil?
|
|
122
|
+
end
|
|
113
123
|
end
|
|
114
124
|
end
|
data/lib/algometrics/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: algometrics
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Kurkin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|