Skip to content

Commit

Permalink
Release 1.5.0
Browse files Browse the repository at this point in the history
修改String类型属性长度限制,256=>8192
  • Loading branch information
Yuhan ZOU committed Jul 5, 2016
1 parent 58f7557 commit 70f6c0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions sensors_analytics_sdk/lib/sensors_analytics_sdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

module SensorsAnalytics

VERSION = '1.4.0'
VERSION = '1.5.0'

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})$/

Expand Down Expand Up @@ -250,16 +250,16 @@ def _assert_properties(event_type, properties)
unless element.is_a?(String) || element.is_a?(Symbol)
raise IllegalDateError.new("The properties value of PROFILE APPEND must be an instance of Array[String].")
end
# 元素的长度不能超过255
unless element.length <= 255
# 元素的长度不能超过8192
unless element.length <= 8192
raise IllegalDateError.new("The properties value is too long.")
end
end
end

# 属性为 String 或 Symbol 时,长度不能超过255
# 属性为 String 或 Symbol 时,长度不能超过8191
if value.is_a?(String) || value.is_a?(Symbol)
unless value.length <= 255
unless value.length <= 8192
raise IllegalDateError.new("The properties value is too long.")
end
end
Expand Down Expand Up @@ -431,6 +431,9 @@ def send(event)
puts "invalid message: #{event_list.to_json}"
puts "response code: #{response_code}"
puts "response body: #{response_body}"
end

if response_code.to_i >= 300
raise DebugModeError.new("Could not write to Sensors Analytics, server responded with #{response_code} returning: '#{response_body}'")
end
end
Expand Down
4 changes: 2 additions & 2 deletions sensors_analytics_sdk/sensors_analytics_sdk.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'sensors_analytics_sdk'
s.version = '1.4.0'
s.date = '2016-05-12'
s.version = '1.5.0'
s.date = '2016-07-04'
s.summary = "SensorsAnalyticsSDK"
s.description = "This is the official Ruby SDK for Sensors Analytics."
s.authors = ["Yuhan ZOU"]
Expand Down

0 comments on commit 70f6c0e

Please sign in to comment.