ori-rb 0.4.6 → 0.4.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03b2c0bd50b0d212d915829d9aab2bac8931cf15610fe450618911a06e6ba34c
4
- data.tar.gz: 87e21b3dc2b88cd1b58de05c9f28a956e5a2488191eac190ae9c4fe8972466a0
3
+ metadata.gz: 958209a6ea858a765a4f3f642d195cdca3e7bfc9c760d3761403d01fdac6ef33
4
+ data.tar.gz: bf4787b1c567aa2749ca6e72d572218c7e613751122e8d1440ee5102e7c92b7c
5
5
  SHA512:
6
- metadata.gz: e4735eb0c3bb0850ce368358e152b7f442c4405cb8fe15f6168a3be4e92508697583cde21da979262dd0b848dd8fffb71a47ef4a62e25d9f3021140f74a23616
7
- data.tar.gz: 22b75abdb0b5abd387f823aafcbb0e954ed5f791026d1d9c6dacfeb5a558cf9f31df9c320027d68f0887520ea3e006b5c135c9ca6fb50f763102ffac3b5c1f3a
6
+ metadata.gz: 64a8f68cfdbccd65ab1d7553f92784ca55f46ab74c9ea3b6d3eadae1e3720b75aecec468a412d47a5f8e448946bf4c270280205b2a9368bb77d62d042a7993b7
7
+ data.tar.gz: 7c95388c4077a57fe10dd8d474c985703ac551e3daf7806afa3e9de28e5c905cc668d826429b84d186686f84917c77801e2ee678776d96ee61bb94fecaca45ac
data/README.md CHANGED
@@ -432,12 +432,25 @@ Timeout!
432
432
 
433
433
  The procedure to publish a new release version is as follows:
434
434
 
435
- - Update `lib/ori/version.rb`
436
- - Run bundle install to bump the version of the gem in `Gemfile.lock`
437
- - Open a pull request, review, and merge
438
- - Review commits since the last release to identify user-facing changes that should be included in the release notes
439
- - [Create a release on GitHub](https://github.com/jahfer/ori/releases/new) with a version number that matches `lib/ori/version.rb`
440
- - Deploy the gem
435
+ 1. Bump the version and commit:
436
+
437
+ ```sh
438
+ mise run version:bump <VERSION>
439
+ ```
440
+
441
+ This updates `lib/ori/version.rb`, runs `bundle install` to update `Gemfile.lock`, commits with message `v<VERSION>`, and creates an annotated tag.
442
+
443
+ 2. Review the commit to confirm the version is correct.
444
+
445
+ 3. Push, build, and publish:
446
+
447
+ ```sh
448
+ mise run release
449
+ ```
450
+
451
+ This pushes the commit and tag to origin, builds the gem, and publishes it to RubyGems.
452
+
453
+ 4. [Create a release on GitHub](https://github.com/jahfer/ori/releases/new) with a version number that matches `lib/ori/version.rb`, including release notes for user-facing changes since the last release.
441
454
 
442
455
  ## License
443
456
 
data/lib/ori/scope.rb CHANGED
@@ -390,6 +390,21 @@ module Ori
390
390
  child_scopes.delete(scope)
391
391
  end
392
392
 
393
+ def nearest_timeout_at
394
+ candidates = [] #: Array[Numeric]
395
+ candidates.concat(waiting.values.compact) unless waiting.empty?
396
+ candidates << @deadline_at if @deadline_at
397
+
398
+ if child_scopes?
399
+ child_scopes.each do |scope|
400
+ child_nearest = scope.nearest_timeout_at
401
+ candidates << child_nearest if child_nearest
402
+ end
403
+ end
404
+
405
+ candidates.min
406
+ end
407
+
393
408
  private
394
409
 
395
410
  attr_reader :parent_scope
@@ -565,14 +580,10 @@ module Ori
565
580
  end
566
581
 
567
582
  def next_timeout(now = nil)
568
- timeouts = [] #: Array[Numeric]
569
- timeouts.concat(waiting.values.compact) unless waiting.empty?
570
- timeouts << @deadline_at if @deadline_at
571
-
572
- return 0 if timeouts.empty?
583
+ nearest = nearest_timeout_at
584
+ return 0 unless nearest
573
585
 
574
586
  now ||= current_time
575
- nearest = timeouts.min #: as !nil
576
587
  delay = nearest - now
577
588
 
578
589
  # Return 0 if the timeout is in the past, otherwise return the delay
data/lib/ori/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # typed: strict
2
2
 
3
3
  module Ori
4
- VERSION = "0.4.6"
4
+ VERSION = "0.4.7"
5
5
  end
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+
3
+ #MISE description="Push, build, and publish the gem (run version:bump first)"
4
+
5
+ set -euo pipefail
6
+
7
+ VERSION_FILE="lib/ori/version.rb"
8
+ VERSION=$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' "$VERSION_FILE")
9
+
10
+ echo "Publishing v${VERSION}..."
11
+
12
+ # Push commit and tag
13
+ git push && git push --tags
14
+ echo "Pushed to origin"
15
+
16
+ # Build and publish
17
+ mise run gem:build
18
+ mise run gem:publish
19
+
20
+ echo "Released v${VERSION} successfully!"
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env -S usage bash
2
+
3
+ #MISE description="Bump the gem version, run bundle install, and commit with a tag"
4
+ #USAGE arg "<version>" help="New version number (e.g. 0.5.0)"
5
+
6
+ set -euo pipefail
7
+
8
+ VERSION="$usage_version"
9
+ VERSION_FILE="lib/ori/version.rb"
10
+
11
+ # Validate version format
12
+ if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
13
+ echo "Error: Version must be in the format X.Y.Z (e.g. 0.5.0)"
14
+ exit 1
15
+ fi
16
+
17
+ # Check for uncommitted changes
18
+ if ! git diff --quiet || ! git diff --cached --quiet; then
19
+ echo "Error: You have uncommitted changes. Please commit or stash them first."
20
+ exit 1
21
+ fi
22
+
23
+ echo "Bumping to v${VERSION}..."
24
+
25
+ # Update version.rb
26
+ sed -i '' "s/VERSION = \".*\"/VERSION = \"${VERSION}\"/" "$VERSION_FILE"
27
+ echo "Updated ${VERSION_FILE} to ${VERSION}"
28
+
29
+ # Run bundle install to update Gemfile.lock
30
+ bundle install
31
+ echo "Updated Gemfile.lock"
32
+
33
+ # Commit and tag
34
+ git add "$VERSION_FILE" Gemfile.lock
35
+ git commit -m "v${VERSION}"
36
+ git tag -a "v${VERSION}" -m "v${VERSION}"
37
+ echo "Created commit and tag v${VERSION}"
38
+
39
+ echo ""
40
+ echo "Version bump complete. Review the commit, then run 'mise run release' to publish."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ori-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jahfer Husain
@@ -78,7 +78,9 @@ files:
78
78
  - lib/ori/timeout.rb
79
79
  - lib/ori/tracer.rb
80
80
  - lib/ori/version.rb
81
+ - mise-tasks/release
81
82
  - mise-tasks/test
83
+ - mise-tasks/version/bump
82
84
  - mise.toml
83
85
  - sorbet/config
84
86
  - sorbet/rbi/gems/.gitattributes