Skip to content

Commit e92e53d

Browse files
committed
Release v1.0.4
1 parent 1bdd5ad commit e92e53d

13 files changed

Lines changed: 525 additions & 11 deletions

File tree

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
ruby-version: ["3.1", "3.2", "3.3"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Ruby ${{ matrix.ruby-version }}
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: ${{ matrix.ruby-version }}
24+
bundler-cache: true
25+
26+
- name: Run tests
27+
run: bundle exec rake test

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [1.0.3] - 2025-12-04
8+
## [1.0.4] - 2025-12-08
99

10-
Update documentation
10+
No user-facing changes in this release.
1111

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
# Specify your gem's dependencies in klime.gemspec
6+
gemspec

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ end
257257

258258
## Requirements
259259

260-
- Ruby 2.7 or higher
260+
- Ruby 2.6 or higher
261261
- No external dependencies (uses only standard library)
262262

263263
## License

Rakefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
require "rake/testtask"
4+
5+
Rake::TestTask.new(:test) do |t|
6+
t.libs << "test"
7+
t.libs << "lib"
8+
t.test_files = FileList["test/**/*_test.rb"]
9+
end
10+
11+
desc "Run tests"
12+
task default: :test
13+

klime.gemspec

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
Gem::Specification.new do |spec|
44
spec.name = "klime"
5-
spec.version = "1.0.3"
5+
spec.version = "1.0.4"
66
spec.authors = ["Klime"]
77
spec.email = ["[email protected]"]
88

99
spec.summary = "Klime SDK for Ruby"
1010
spec.description = "Track events, identify users, and group them with organizations using Klime analytics."
1111
spec.homepage = "https://github.com/klimeapp/klime-ruby"
1212
spec.license = "MIT"
13-
spec.required_ruby_version = ">= 2.7.0"
13+
spec.required_ruby_version = ">= 2.6.0"
1414

1515
spec.metadata["homepage_uri"] = spec.homepage
1616
spec.metadata["source_code_uri"] = spec.homepage
@@ -19,6 +19,13 @@ Gem::Specification.new do |spec|
1919
spec.files = Dir.glob("{lib}/**/*") + %w[LICENSE.md README.md]
2020
spec.require_paths = ["lib"]
2121

22+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
23+
2224
# No runtime dependencies - uses only standard library
25+
26+
# Development dependencies
27+
spec.add_development_dependency "minitest", "~> 5.0"
28+
spec.add_development_dependency "rake", "~> 13.0"
29+
spec.add_development_dependency "webmock", "~> 3.0"
2330
end
2431

lib/klime/client.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ def shutdown
174174
# Cancel scheduled flush
175175
@flush_thread&.kill
176176

177-
# Flush remaining events
178-
flush
177+
# Force flush remaining events (bypass normal flush which checks @shutdown)
178+
flush_remaining
179179
end
180180

181181
private
@@ -216,15 +216,20 @@ def do_flush
216216
@flush_thread&.kill
217217

218218
# Process batches
219+
flush_remaining
220+
221+
# Schedule next flush
222+
schedule_flush unless @shutdown
223+
end
224+
225+
# Flush all queued events without scheduling (used by shutdown)
226+
def flush_remaining
219227
loop do
220228
batch = extract_batch
221229
break if batch.empty?
222230

223231
send_batch(batch)
224232
end
225-
226-
# Schedule next flush
227-
schedule_flush unless @shutdown
228233
end
229234

230235
def extract_batch

lib/klime/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

33
module Klime
4-
VERSION = "1.0.3"
4+
VERSION = "1.0.4"
55
end
66

0 commit comments

Comments
 (0)