sensors_analytics_sdk 1.5.0 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sensors_analytics_sdk.rb +10 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d52cdf3735cf35627055dc86a471201b48836710
4
- data.tar.gz: ee811ff0fe863af38e5a3b0b189778f08c272e2e
3
+ metadata.gz: 0d61ecc7feae4458ed05b347014b88534a986526
4
+ data.tar.gz: 38240f2a68545c09b9ad8dc2b32dff683fb2cd1a
5
5
  SHA512:
6
- metadata.gz: 84c5f54d6cd7f132262287eedd719985e5cac8666bef06d38a9a4ad8a56b760b237a11fad1493edad8c65e02d90f26e5d3ba7e4329df768d822f14eb573a07ca
7
- data.tar.gz: a53d8b62bfbc2d13272833d80dc4a823216698b12c03d59759edea4511850f4e53db54656c88c7861d2794b5987df6215d03e94d2b572de9b0f27930c42f8c35
6
+ metadata.gz: 89e49fd968067427db7b85648ccceb309dcc684f329b33d59f034253195126044c4db28872016fc958bcfbb058df75edc96579ed21b016a12cf721a84d06e7da
7
+ data.tar.gz: 8895ebdc616efa15893decc7098d3bf3f405d80c8512d23c5ba537445b25ee59f852c10b8020d7a2c4169b75b56b5d9445cb9aeb1e715c135e0d759832e51b64
@@ -5,7 +5,7 @@ require 'zlib'
5
5
 
6
6
  module SensorsAnalytics
7
7
 
8
- VERSION = '1.5.0'
8
+ VERSION = '1.5.2'
9
9
 
10
10
  KEY_PATTERN = /^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$)[a-zA-Z_$][a-zA-Z\\d_$]{0,99})$/
11
11
 
@@ -142,6 +142,7 @@ module SensorsAnalytics
142
142
  # 从事件属性中获取时间配置
143
143
  event_time = _extract_time_from_properties(properties)
144
144
  properties.delete(:$time)
145
+ properties.delete("$time")
145
146
 
146
147
  event_properties = {}
147
148
  if event_type == :track || event_type == :track_signup
@@ -241,18 +242,18 @@ module SensorsAnalytics
241
242
  _assert_key_with_regex(:PropertyKey, key)
242
243
 
243
244
  unless value.is_a?(Integer) || value.is_a?(Float) || value.is_a?(String) || value.is_a?(Symbol) || value.is_a?(Array) || value.is_a?(TrueClass) || value.is_a?(FalseClass) || value.is_a?(Time)
244
- raise IllegalDateError.new("The properties value must be an instance of Integer/Float/String/Array.")
245
+ raise IllegalDataError.new("The properties value must be an instance of Integer/Float/String/Array.")
245
246
  end
246
247
 
247
248
  # 属性为 Array 时,元素必须为 String 或 Symbol 类型
248
249
  if value.is_a?(Array)
249
250
  value.each do |element|
250
251
  unless element.is_a?(String) || element.is_a?(Symbol)
251
- raise IllegalDateError.new("The properties value of PROFILE APPEND must be an instance of Array[String].")
252
+ raise IllegalDataError.new("The properties value of PROFILE APPEND must be an instance of Array[String].")
252
253
  end
253
254
  # 元素的长度不能超过8192
254
255
  unless element.length <= 8192
255
- raise IllegalDateError.new("The properties value is too long.")
256
+ raise IllegalDataError.new("The properties value is too long.")
256
257
  end
257
258
  end
258
259
  end
@@ -260,25 +261,25 @@ module SensorsAnalytics
260
261
  # 属性为 String 或 Symbol 时,长度不能超过8191
261
262
  if value.is_a?(String) || value.is_a?(Symbol)
262
263
  unless value.length <= 8192
263
- raise IllegalDateError.new("The properties value is too long.")
264
+ raise IllegalDataError.new("The properties value is too long.")
264
265
  end
265
266
  end
266
267
 
267
268
  # profile_increment 的属性必须为数值类型
268
269
  if event_type == :profile_increment
269
270
  unless value.is_a?(Integer)
270
- raise IllegalDateError.new("The properties value of PROFILE INCREMENT must be an instance of Integer.")
271
+ raise IllegalDataError.new("The properties value of PROFILE INCREMENT must be an instance of Integer.")
271
272
  end
272
273
  end
273
274
 
274
275
  # profile_append 的属性必须为数组类型,且数组元素必须为字符串
275
276
  if event_type == :profile_append
276
277
  unless value.is_a?(Array)
277
- raise IllegalDateError.new("The properties value of PROFILE INCREMENT must be an instance of Array[String].")
278
+ raise IllegalDataError.new("The properties value of PROFILE INCREMENT must be an instance of Array[String].")
278
279
  end
279
280
  value.each do |element|
280
281
  unless element.is_a?(String) || element.is_a?(Symbol)
281
- raise IllegalDateError.new("The properties value of PROFILE INCREMENT must be an instance of Array[String].")
282
+ raise IllegalDataError.new("The properties value of PROFILE INCREMENT must be an instance of Array[String].")
282
283
  end
283
284
  end
284
285
  end
@@ -295,7 +296,7 @@ module SensorsAnalytics
295
296
 
296
297
  def request!(event_list, headers = {})
297
298
  unless event_list.is_a?(Array) && headers.is_a?(Hash)
298
- raise IllegalDateError.new("The argument of 'request!' should be a Array.")
299
+ raise IllegalDataError.new("The argument of 'request!' should be a Array.")
299
300
  end
300
301
 
301
302
  # GZip && Base64 encode
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensors_analytics_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuhan ZOU