simple_segment 1.4.0 → 1.6.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/.github/workflows/ci.yml +2 -2
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +13 -1
- data/README.md +2 -2
- data/lib/simple_segment/batch.rb +3 -5
- data/lib/simple_segment/operations/operation.rb +3 -3
- data/lib/simple_segment/version.rb +1 -1
- data/simple_segment.gemspec +1 -1
- metadata +5 -9
- data/.hound.yml +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 567e3da4a8a550ac76f933eabcae572a8a94a8701fc023d602710aaca3456882
|
|
4
|
+
data.tar.gz: 59442630ea7d7fd5732072d1e469c7d7a55f60b904c7ac0df119d96033ec8df8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f34457b3c44c21f2facb1501c9816e4f32c473f2a97d9714ef3e369e208d1ea2126c16ab3edd5b616255f362f1ced0f91a381c202936d288ef8c13ca849edb8
|
|
7
|
+
data.tar.gz: 372e29b2895a5b0a8f3fe7e0e77bd19c0bf58fd9ac20d5697cfee4c029eae15174e4fca3daef9b4b8327e0957fce488af6066bf252097b21f76d221d9523313a
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -10,9 +10,9 @@ jobs:
|
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
strategy:
|
|
12
12
|
matrix:
|
|
13
|
-
ruby: ['3.
|
|
13
|
+
ruby: ['3.4', '3.3', '3.2']
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
16
|
- name: Set up Ruby ${{ matrix.ruby }}
|
|
17
17
|
uses: ruby/setup-ruby@v1
|
|
18
18
|
with:
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.6.0] - 2025-12-03
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Use millisecond precision for `timestamp` and `sentAt` fields https://github.com/whatthewhat/simple_segment/pull/42 by [@marcboquet](https://github.com/marcboquet)
|
|
13
|
+
|
|
14
|
+
## [1.5.0] - 2022-12-06
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Use the /v1/batch endpoint for batching events (this should be backward compatible according to Segment) https://github.com/whatthewhat/simple_segment/pull/40 by [@sgallag-insta](https://github.com/sgallag-insta)
|
|
18
|
+
|
|
9
19
|
## [1.4.0] - 2022-08-31
|
|
10
20
|
|
|
11
21
|
### Added
|
|
@@ -40,7 +50,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
40
50
|
### Changed
|
|
41
51
|
- Date properties are now automatically converted to ISO 8601 to be consistent with the official client https://github.com/whatthewhat/simple_segment/pull/19 by @juanramoncg
|
|
42
52
|
|
|
43
|
-
[Unreleased]: https://github.com/whatthewhat/simple_segment/compare/v1.
|
|
53
|
+
[Unreleased]: https://github.com/whatthewhat/simple_segment/compare/v1.6.0...HEAD
|
|
54
|
+
[1.6.0]: https://github.com/whatthewhat/simple_segment/compare/v1.5.0...v1.6.0
|
|
55
|
+
[1.5.0]: https://github.com/whatthewhat/simple_segment/compare/v1.4.0...v1.5.0
|
|
44
56
|
[1.4.0]: https://github.com/whatthewhat/simple_segment/compare/v1.3.0...v1.4.0
|
|
45
57
|
[1.3.0]: https://github.com/whatthewhat/simple_segment/compare/v1.2.0...v1.3.0
|
|
46
58
|
[1.2.0]: https://github.com/whatthewhat/simple_segment/compare/v1.1.0...v1.2.0
|
data/README.md
CHANGED
|
@@ -17,9 +17,9 @@ The gem supports all existing functionality of analytics-ruby:
|
|
|
17
17
|
- `analytics.alias(...)`
|
|
18
18
|
- `analytics.flush` (no op for backwards compatibility with the official gem)
|
|
19
19
|
|
|
20
|
-
In addition it offers the ability to manually batch events with [analytics.batch](#batching).
|
|
20
|
+
In addition, it offers the ability to manually batch events with [analytics.batch](#batching).
|
|
21
21
|
|
|
22
|
-
The plan is to be
|
|
22
|
+
The plan is to be a drop-in replacement for the official gem, so if you find inconsistencies with `analytics-ruby` feel free to file an issue.
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
data/lib/simple_segment/batch.rb
CHANGED
|
@@ -44,11 +44,9 @@ module SimpleSegment
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def commit
|
|
47
|
-
if payload[:batch].
|
|
48
|
-
raise ArgumentError, 'A batch must contain at least one action'
|
|
49
|
-
end
|
|
47
|
+
raise ArgumentError, 'A batch must contain at least one action' if payload[:batch].empty?
|
|
50
48
|
|
|
51
|
-
Request.new(client).post('/v1/
|
|
49
|
+
Request.new(client).post('/v1/batch', payload)
|
|
52
50
|
end
|
|
53
51
|
|
|
54
52
|
private
|
|
@@ -56,7 +54,7 @@ module SimpleSegment
|
|
|
56
54
|
def add(operation_class, options, action)
|
|
57
55
|
operation = operation_class.new(client, symbolize_keys(options))
|
|
58
56
|
operation_payload = operation.build_payload
|
|
59
|
-
operation_payload[:
|
|
57
|
+
operation_payload[:type] = action
|
|
60
58
|
payload[:batch] << operation_payload
|
|
61
59
|
end
|
|
62
60
|
end
|
|
@@ -36,7 +36,7 @@ module SimpleSegment
|
|
|
36
36
|
context: context,
|
|
37
37
|
integrations: options[:integrations],
|
|
38
38
|
timestamp: timestamp(options.fetch(:timestamp, current_time)),
|
|
39
|
-
sentAt: current_time.iso8601,
|
|
39
|
+
sentAt: current_time.iso8601(3),
|
|
40
40
|
messageId: options[:message_id]
|
|
41
41
|
}
|
|
42
42
|
end
|
|
@@ -48,9 +48,9 @@ module SimpleSegment
|
|
|
48
48
|
|
|
49
49
|
def timestamp(timestamp)
|
|
50
50
|
if timestamp.respond_to?(:iso8601)
|
|
51
|
-
timestamp.iso8601
|
|
51
|
+
timestamp.iso8601(3)
|
|
52
52
|
else
|
|
53
|
-
Time.iso8601(timestamp).iso8601
|
|
53
|
+
Time.iso8601(timestamp).iso8601(3)
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
end
|
data/simple_segment.gemspec
CHANGED
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.add_development_dependency 'pry'
|
|
25
25
|
spec.add_development_dependency 'rake', '>= 10.0'
|
|
26
26
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
27
|
-
spec.add_development_dependency 'rubocop', '1.
|
|
27
|
+
spec.add_development_dependency 'rubocop', '1.65.0'
|
|
28
28
|
spec.add_development_dependency 'timecop', '~> 0.9.5'
|
|
29
29
|
spec.add_development_dependency 'webmock', '~> 3.7'
|
|
30
30
|
spec.metadata = {
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_segment
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikhail Topolskiy
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
@@ -72,14 +71,14 @@ dependencies:
|
|
|
72
71
|
requirements:
|
|
73
72
|
- - '='
|
|
74
73
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 1.
|
|
74
|
+
version: 1.65.0
|
|
76
75
|
type: :development
|
|
77
76
|
prerelease: false
|
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
78
|
requirements:
|
|
80
79
|
- - '='
|
|
81
80
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 1.
|
|
81
|
+
version: 1.65.0
|
|
83
82
|
- !ruby/object:Gem::Dependency
|
|
84
83
|
name: timecop
|
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -118,7 +117,6 @@ extra_rdoc_files: []
|
|
|
118
117
|
files:
|
|
119
118
|
- ".github/workflows/ci.yml"
|
|
120
119
|
- ".gitignore"
|
|
121
|
-
- ".hound.yml"
|
|
122
120
|
- ".rspec"
|
|
123
121
|
- ".rubocop.yml"
|
|
124
122
|
- CHANGELOG.md
|
|
@@ -149,7 +147,6 @@ licenses:
|
|
|
149
147
|
- MIT
|
|
150
148
|
metadata:
|
|
151
149
|
rubygems_mfa_required: 'true'
|
|
152
|
-
post_install_message:
|
|
153
150
|
rdoc_options: []
|
|
154
151
|
require_paths:
|
|
155
152
|
- lib
|
|
@@ -164,8 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
164
161
|
- !ruby/object:Gem::Version
|
|
165
162
|
version: '0'
|
|
166
163
|
requirements: []
|
|
167
|
-
rubygems_version: 3.
|
|
168
|
-
signing_key:
|
|
164
|
+
rubygems_version: 3.6.9
|
|
169
165
|
specification_version: 4
|
|
170
166
|
summary: A simple synchronous API client for segment.io.
|
|
171
167
|
test_files: []
|
data/.hound.yml
DELETED