analytics-ruby 2.2.6.pre → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source 'http://rubygems.org'
2
- gemspec
data/History.md DELETED
@@ -1,234 +0,0 @@
1
- 2.2.6.pre / 2018-06-27
2
- ==================
3
-
4
- * [Fix](https://github.com/segmentio/analytics-ruby/pull/168): Revert 'reuse
5
- TCP connections' to fix EMFILE errors
6
- * [Fix](https://github.com/segmentio/analytics-ruby/pull/166): Fix oj/rails
7
- conflict
8
- * [Fix](https://github.com/segmentio/analytics-ruby/pull/162): Add missing
9
- 'Forwardable' requirement
10
- * [Improvement](https://github.com/segmentio/analytics-ruby/pull/163): Better
11
- logging
12
-
13
- 2.2.5 / 2018-05-01
14
- ==================
15
-
16
- * [Fix](https://github.com/segmentio/analytics-ruby/pull/158): Require `version` module first.
17
-
18
- 2.2.4 / 2018-04-30
19
- ==================
20
-
21
- * Promote pre-release version to stable.
22
-
23
- 2.2.4.pre / 2018-02-04
24
- ======================
25
-
26
- * [Fix](https://github.com/segmentio/analytics-ruby/pull/147): Prevent 'batch
27
- size exceeded' errors by automatically batching
28
- items according to size
29
- * [Performance](https://github.com/segmentio/analytics-ruby/pull/149): Reuse
30
- TCP connections
31
- * [Improvement](https://github.com/segmentio/analytics-ruby/pull/145): Emit logs
32
- when in-memory queue is full
33
- * [Improvement](https://github.com/segmentio/analytics-ruby/pull/143): Emit logs
34
- when messages exceed maximum allowed size
35
- * [Improvement](https://github.com/segmentio/analytics-ruby/pull/134): Add
36
- exponential backoff to retries
37
- * [Improvement](https://github.com/segmentio/analytics-ruby/pull/132): Handle
38
- HTTP status code failure appropriately
39
-
40
- 2.2.3.pre / 2017-09-14
41
- ==================
42
-
43
- * [Fix](https://github.com/segmentio/analytics-ruby/pull/120): Override `respond_to_missing` instead of `respond_to?` to facilitate mock the library in tests.
44
-
45
-
46
- 2.2.2 / 2016-08-03
47
- ==================
48
-
49
- * adding commander as dep (for CLI)
50
-
51
- 2.2.1 / 2016-08-03
52
- ==================
53
-
54
- * add executables to spec
55
-
56
- 2.2.0 / 2016-08-03
57
- ==================
58
-
59
- * Adding an (experimental) CLI
60
-
61
- 2.1.0 / 2016-06-17
62
- ==================
63
-
64
- * Fix: Ensure error handler is called before Client#flush finishes.
65
- * Feature: Support setting a custom message ID.
66
-
67
- 2.0.13 / 2015-09-15
68
- ==================
69
-
70
- * readme: updated install docs
71
- * fix: page/screen to allow no name
72
- * git: ignore ruby version
73
- * travis-ci: remove old rubys
74
-
75
- 2.0.12 / 2015-01-10
76
- ==================
77
-
78
- * Fix batch being cleared and causing duplicates
79
-
80
- 2.0.11 / 2014-09-22
81
- ==================
82
-
83
- * fix: don't clear batch if request failed
84
-
85
- 2.0.10 / 2014-09-22
86
- ==================
87
-
88
- * Move timeout retry above output
89
-
90
- 2.0.9 / 2014-09-22
91
- ==================
92
-
93
- * Fix rescuing timeouts
94
-
95
- 2.0.8 / 2014-09-11
96
- ==================
97
- * fix: add 3 ms to timestamp
98
-
99
- 2.0.7 / 2014-08-27
100
- ==================
101
- * fix: include optional options hash in calls
102
-
103
- 2.0.6 / 2014-08-12
104
- ==================
105
- * fix: category param on #page and #screen
106
-
107
- 2.0.5 / 2014-05-26
108
- ==================
109
- * fix: datetime conversions
110
-
111
- 2.0.4 / 2014-06-11
112
- ==================
113
- * fix: isofying trait dates in #group
114
-
115
- 2.0.3 / 2014-06-04
116
- ==================
117
- * fix: undefined method `is_requesting?' for nil:NilClass when calling flush (#51)
118
-
119
- 2.0.2 / 2014-05-30
120
- ==================
121
- * fix: formatting ios dates
122
- * fix: respond_to? implementation
123
- * add: able to stub requests by setting STUB env var
124
-
125
- 2.0.1 / 2014-05-15
126
- ==================
127
- * add: namespace under Segment::Analytics
128
- * add: can create multiple instances with creator method (rather than
129
- having a singleton)
130
- * add: logging with Logger instance or Rails.logger if available
131
- * add: able to stub requests so they just log and don't hit the server
132
- * fix: worker continues running across forked processes
133
- * fix: removed usage of ActiveSupport methods since its not a dependency
134
- * fix: sending data that matches segment's new api spec
135
-
136
- (there is no v2.0.0)
137
-
138
- 1.1.0 / 2014-04-17
139
- ==================
140
- * adding .initialized? by [@lumberj](https://github.com/lumberj)
141
-
142
- 1.0.0 / 2014-03-12
143
- ==================
144
- * removing faraday dependency
145
-
146
- 0.6.0 / 2014-02-19
147
- ==================
148
- * adding .group(), .page(), and .screen() calls
149
- * relaxing faraday dependency, fixes #31
150
-
151
- 0.5.4 / 2013-12-31
152
- ==================
153
- * Add `requestId` fields to all requests for tracing.
154
-
155
- 0.5.3 / 2013-12-31
156
- ==================
157
- * Allow the consumer thread to shut down so it won't remain live in hot deploy scenarios. This fixes the jruby memory leak by [@nirvdrum](https://github.com/nirvdrum)
158
-
159
- 0.5.2 / 2013-12-02
160
- ==================
161
- * adding `sleep` backoff between connection retries
162
-
163
- 0.5.1 / 2013-11-22
164
- ==================
165
- * adding retries for connection hangups
166
-
167
- 0.5.0 / 2013-10-03
168
- ==================
169
- * Removing global Analytics constant in favor of adding it to our config. NOTE: If you are upgrading from a previous version and want to continue using the `Analytics` namespace, you'll have to add `Analytics = AnalyticsRuby` to your config. Otherwise you WILL NOT be sending analytics data. See the [setup docs for more info](https://segment.io/libraries/ruby)
170
-
171
- 0.4.0 / 2013-08-30
172
- ==================
173
- * Adding support and tests for 1.8.7
174
-
175
- 0.3.4 / 2013-08-26
176
- ==================
177
- * Pass `Time` values as iso8601 timestamp strings
178
-
179
- 0.3.3 / 2013-08-02
180
- ==================
181
- * Allow init/track/identify/alias to accept strings as keys. by [@shipstar](https://github.com/shipstar)
182
-
183
- 0.3.2 / 2013-05-28
184
- ==================
185
- * Adding faraday timeout by [@yanchenyun](https://github.com/yangchenyun)
186
-
187
- 0.3.1 / 2013-04-29
188
- ==================
189
- * Adding check for properties to be a Hash
190
-
191
- 0.3.0 / 2013-04-05
192
- ==================
193
- * Adding alias call
194
-
195
- 0.2.0 / 2013-03-21
196
- ==================
197
- * Adding flush method
198
-
199
- 0.1.4 / 2013-03-19
200
- ==================
201
- * Adding ClassMethods for more extensibility by [arronmabrey](https://github.com/arronmabrey)
202
-
203
- 0.1.3 / 2013-03-19
204
- ==================
205
- * Fixing user_id.to_s semantics, reported by [arronmabrey](https://github.com/arronmabrey)
206
- * Reduced faraday requirements by [arronmabrey](https://github.com/arronmabrey)
207
-
208
- 0.1.2 / 2013-03-11
209
- ==================
210
- * Fixing thrown exception on non-initialized tracks thanks to [sbellity](https://github.com/sbellity)
211
-
212
- 0.1.1 / 2013-02-11
213
- ==================
214
- * Updating dependencies
215
- * Adding actual support for MultiJson 1.0
216
-
217
- 0.1.0 / 2013-01-22
218
- ==================
219
- * Updated docs to point at segment.io
220
-
221
- 0.0.5 / 2013-01-21
222
- ==================
223
- * Renaming of all the files for proper bundling usage
224
-
225
- 0.0.4 / 2013-01-17
226
- ==================
227
- * Updated readme and install instruction courtesy of [@zeke](https://github.com/zeke)
228
- * Removed typhoeus and reverted to default adapter
229
- * Removing session_id in favor of a single user_id
230
-
231
- 0.0.3 / 2013-01-16
232
- ==================
233
- * Rakefile and renaming courtesy of [@kiennt](https://github.com/kiennt)
234
- * Updated tests with mocks
data/Makefile DELETED
@@ -1,17 +0,0 @@
1
-
2
- # Install any tools required to build this library, e.g. Ruby, Bundler etc.
3
- bootstrap:
4
- brew install ruby
5
- gem install bundler
6
-
7
- # Install any library dependencies.
8
- dependencies:
9
- bundle install --verbose
10
-
11
- # Run all tests and checks (including linters).
12
- check:
13
- bundle exec rake
14
-
15
- # Compile the code and produce any binaries where applicable.
16
- build:
17
- gem build ./analytics-ruby.gemspec
data/README.md DELETED
@@ -1,84 +0,0 @@
1
- analytics-ruby
2
- ==============
3
-
4
- [![Build Status](https://travis-ci.org/segmentio/analytics-ruby.png?branch=master)](https://travis-ci.org/segmentio/analytics-ruby)
5
-
6
- analytics-ruby is a ruby client for [Segment](https://segment.com)
7
-
8
- ## Install
9
-
10
- Into Gemfile from rubygems.org:
11
- ```ruby
12
- gem 'analytics-ruby'
13
- ```
14
-
15
- Into environment gems from rubygems.org:
16
- ```
17
- gem install 'analytics-ruby'
18
- ```
19
-
20
- ## Usage
21
-
22
- Create an instance of the Analytics object:
23
- ```ruby
24
- analytics = Segment::Analytics.new(write_key: 'YOUR_WRITE_KEY')
25
- ```
26
-
27
- Identify the user for the people section, see more [here](https://segment.com/docs/libraries/ruby/#identify).
28
- ```ruby
29
- analytics.identify(user_id: 42,
30
- traits: {
31
- email: 'name@example.com',
32
- first_name: 'Foo',
33
- last_name: 'Bar'
34
- })
35
- ```
36
-
37
- Alias an user, see more [here](https://segment.com/docs/libraries/ruby/#alias).
38
- ```ruby
39
- analytics.alias(user_id: 41)
40
- ```
41
-
42
- Track a user event, see more [here](https://segment.com/docs/libraries/ruby/#track).
43
- ```ruby
44
- analytics.track(user_id: 42, event: 'Created Account')
45
- ```
46
-
47
- There are a few calls available, please check the documentation section.
48
-
49
- ## Documentation
50
-
51
- Documentation is available at [segment.com/docs/sources/server/ruby](https://segment.com/docs/sources/server/ruby/)
52
-
53
- ## Testing
54
-
55
- You can use the `stub` option to Segment::Analytics.new to cause all requests to be stubbed, making it easier to test with this library.
56
-
57
- ## License
58
-
59
- ```
60
- WWWWWW||WWWWWW
61
- W W W||W W W
62
- ||
63
- ( OO )__________
64
- / | \
65
- /o o| MIT \
66
- \___/||_||__||_|| *
67
- || || || ||
68
- _||_|| _||_||
69
- (__|__|(__|__|
70
- ```
71
-
72
- (The MIT License)
73
-
74
- Copyright (c) 2013 Segment Inc. <friends@segment.com>
75
-
76
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
77
-
78
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
79
-
80
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
81
-
82
-
83
- [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/segmentio/analytics-ruby/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
84
-
data/RELEASING.md DELETED
@@ -1,9 +0,0 @@
1
- Releasing
2
- =========
3
-
4
- 1. Verify everything works with `make check build`.
5
- 2. Bump version in [`version.rb`](https://github.com/segmentio/analytics-ruby/blob/master/lib/segment/analytics/version.rb).
6
- 3. Update [`History.md`](https://github.com/segmentio/analytics-ruby/blob/master/History.md).
7
- 4. Commit and tag `git commit -am "Release {version}" && git tag -a {version} -m "Version {version}"`.
8
- 5. Upload to Github with `git push -u origin master && git push --tags`.
9
- The tagged commit will be pushed to RubyGems via Travis.
data/Rakefile DELETED
@@ -1,33 +0,0 @@
1
- require 'rspec/core/rake_task'
2
-
3
- default_tasks = []
4
-
5
- RSpec::Core::RakeTask.new(:spec) do |spec|
6
- spec.pattern = 'spec/segment/**/*_spec.rb'
7
- spec.rspec_opts = "--tag ~e2e" if ENV["RUN_E2E_TESTS"] != "true"
8
- end
9
-
10
- default_tasks << :spec
11
-
12
- # Isolated tests are run as separate rake tasks so that gem conflicts can be
13
- # tests in different processes
14
- Dir.glob('spec/isolated/**/*.rb').each do |isolated_test_path|
15
- RSpec::Core::RakeTask.new(isolated_test_path) do |spec|
16
- spec.pattern = isolated_test_path
17
- end
18
-
19
- default_tasks << isolated_test_path
20
- end
21
-
22
- # Rubocop doesn't support < 2.1
23
- if RUBY_VERSION >= "2.1"
24
- require 'rubocop/rake_task'
25
-
26
- RuboCop::RakeTask.new(:rubocop) do |task|
27
- task.patterns = ['lib/**/*.rb','spec/**/*.rb',]
28
- end
29
-
30
- default_tasks << :rubocop
31
- end
32
-
33
- task :default => default_tasks
@@ -1,37 +0,0 @@
1
- require File.expand_path('../lib/segment/analytics/version', __FILE__)
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = 'analytics-ruby'
5
- spec.version = Segment::Analytics::VERSION
6
- spec.files = Dir.glob('**/*')
7
- spec.require_paths = ['lib']
8
- spec.bindir = 'bin'
9
- spec.executables = ['analytics']
10
- spec.summary = 'Segment.io analytics library'
11
- spec.description = 'The Segment.io ruby analytics library'
12
- spec.authors = ['Segment.io']
13
- spec.email = 'friends@segment.io'
14
- spec.homepage = 'https://github.com/segmentio/analytics-ruby'
15
- spec.license = 'MIT'
16
-
17
- # Ruby 1.8 requires json
18
- spec.add_dependency 'json', ['~> 1.7'] if RUBY_VERSION < "1.9"
19
- spec.add_dependency 'commander', '~> 4.4'
20
-
21
- spec.add_development_dependency 'rake', '~> 10.3'
22
- spec.add_development_dependency 'rspec', '~> 3.0'
23
- spec.add_development_dependency 'tzinfo', '1.2.1'
24
- spec.add_development_dependency 'activesupport', '~> 4.1.11'
25
- spec.add_development_dependency 'faraday', '~> 0.13'
26
- spec.add_development_dependency 'pmap', '~> 1.1'
27
-
28
- if RUBY_VERSION >= '2.0' && RUBY_PLATFORM != 'java'
29
- spec.add_development_dependency 'oj', '~> 3.6.2'
30
- end
31
-
32
- if RUBY_VERSION >= "2.1"
33
- spec.add_development_dependency 'rubocop', '~> 0.51.0'
34
- end
35
-
36
- spec.add_development_dependency 'codecov', '~> 0.1.4'
37
- end
data/codecov.yml DELETED
@@ -1,2 +0,0 @@
1
- ignore:
2
- - "spec/**/*"
@@ -1,38 +0,0 @@
1
- require 'faraday'
2
- require 'pmap'
3
-
4
- class RunscopeClient
5
- def initialize(api_token)
6
- headers = { 'Authorization' => "Bearer #{api_token}" }
7
- @conn = Faraday.new('https://api.runscope.com', headers: headers)
8
- end
9
-
10
- def requests(bucket_key)
11
- with_retries(3) do
12
- response = @conn.get("/buckets/#{bucket_key}/messages", count: 20)
13
-
14
- raise "Runscope error. #{response.body}" unless response.status == 200
15
-
16
- message_uuids = JSON.parse(response.body)['data'].map { |message|
17
- message.fetch('uuid')
18
- }
19
-
20
- message_uuids.pmap { |uuid|
21
- response = @conn.get("/buckets/#{bucket_key}/messages/#{uuid}")
22
- raise "Runscope error. #{response.body}" unless response.status == 200
23
- JSON.parse(response.body).fetch('data').fetch('request')
24
- }
25
- end
26
- end
27
-
28
- private
29
-
30
- def with_retries(max_retries)
31
- retries ||= 0
32
- yield
33
- rescue StandardError => e
34
- retries += 1
35
- retry if retries < max_retries
36
- raise e
37
- end
38
- end