2
2
3
3
![ Ruby 3.1 | 3.2 | 3.3] ( https://img.shields.io/badge/ruby-3.1%20%7C%203.2%20%7C%203.3-blue.svg?style=for-the-badge )
4
4
[ ![ MIT] ( https://img.shields.io/github/license/temporalio/sdk-ruby.svg?style=for-the-badge )] ( LICENSE )
5
- <!-- TODO: [](https://rubygems.org/gems/temporalio) -->
5
+ [ ![ Gem] ( https://img.shields.io/gem/v/temporalio?style=for-the-badge )] ( https://rubygems.org/gems/temporalio )
6
6
7
7
[ Temporal] ( https://temporal.io/ ) is a distributed, scalable, durable, and highly available orchestration engine used to
8
8
execute asynchronous, long-running business logic in a scalable and resilient way.
9
9
10
10
** Temporal Ruby SDK** is the framework for authoring workflows and activities using the Ruby programming language.
11
11
12
+ Also see:
13
+
14
+ * [ Ruby Samples] ( https://github.com/temporalio/samples-ruby )
15
+ * [ API Documentation] ( https://rubydoc.info/gems/temporalio/0.2.0 )
16
+
12
17
⚠️ UNDER ACTIVE DEVELOPMENT
13
18
14
19
This SDK is under active development and has not released a stable version yet. APIs may change in incompatible ways
@@ -49,6 +54,7 @@ Notably missing from this SDK:
49
54
- [ Platform Support] ( #platform-support )
50
55
- [ Development] ( #development )
51
56
- [ Build] ( #build )
57
+ - [ Build Platform-specific Gem] ( #build-platform-specific-gem )
52
58
- [ Testing] ( #testing )
53
59
- [ Code Formatting and Type Checking] ( #code-formatting-and-type-checking )
54
60
- [ Proto Generation] ( #proto-generation )
@@ -59,26 +65,26 @@ Notably missing from this SDK:
59
65
60
66
### Installation
61
67
62
- Install the gem to the desired version as mentioned at https://rubygems.org/gems/temporalio . Since the SDK is still in
63
- pre-release, the version should be specified explicitly. So either in a Gemfile like:
68
+ Can require in a Gemfile like:
64
69
65
70
```
66
- gem 'temporalio', '<version>'
71
+ gem 'temporalio'
67
72
```
68
73
69
74
Or via ` gem install ` like:
70
75
71
76
```
72
- gem install temporalio -v '<version>'
77
+ gem install temporalio
73
78
```
74
79
80
+ ** NOTE** : Only macOS ARM/x64 and Linux ARM/x64 are supported, and the platform-specific gem chosen is based on when the
81
+ gem/bundle install is performed. A source gem is published but cannot be used directly and will fail to build if tried.
82
+ MinGW-based Windows and Linux MUSL do not have gems. See the [ Platform Support] ( #platform-support ) section for more
83
+ information.
84
+
75
85
** NOTE** : Due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/162 ) , fibers (and ` async ` gem) are only
76
86
supported on Ruby versions 3.3 and newer.
77
87
78
- ** NOTE** : MinGW-based Windows is not currently supported natively, but is via WSL. Prebuilt gems for Linux MUSL are also
79
- not currently present. We also do not publish a gem for building from source at this time. See the
80
- [ Platform Support] ( #platform-support ) section later for more information.
81
-
82
88
### Implementing an Activity
83
89
84
90
Implementing workflows is not yet supported in the Ruby SDK, but implementing activities is.
@@ -462,9 +468,9 @@ This means Linux and macOS for ARM and x64 have published gems. Currently, a gem
462
468
Due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/172 ) with Windows and multi-threaded Rust, MinGW-based
463
469
Windows (i.e. ` x64-mingw-ucrt ` ) is not supported. But WSL is supported using the normal Linux gem.
464
470
465
- At this time a pure source gem is not published, which means that when trying to install the gem on an unsupported
466
- platform, you may get an error that it is not available. Building from source requires many files across submodules and
467
- requires Rust to be installed. See the [ Build ] ( #build ) section for how to build a gem from the repository.
471
+ At this time a pure source gem is published for documentation reasons, but it cannot be built and will fail if tried.
472
+ Building from source requires many files across submodules and requires Rust to be installed. See the [ Build ] ( #build )
473
+ section for how to build a the repository.
468
474
469
475
The SDK works on Ruby 3.1+, but due to [ an issue] ( https://github.com/temporalio/sdk-ruby/issues/162 ) , fibers (and
470
476
` async ` gem) are only supported on Ruby versions 3.3 and newer.
@@ -488,13 +494,32 @@ To build shared library for development use:
488
494
489
495
bundle exec rake compile
490
496
491
- Note, this is not ` compile:dev ` because debug-mode in Rust has
497
+ ** NOTE** : This will make the current directory usable for the current Ruby version by putting the shared library
498
+ ` lib/temporalio/internal/bridge/temporalio_bridge.<ext> ` in the proper place. But this development shared library may
499
+ not work for other Ruby versions or other OS/arch combinations. For that, see "Build Platform-specific Gem" below.
500
+
501
+ ** NOTE** : This is not ` compile:dev ` because debug-mode in Rust has
492
502
[ an issue] ( https://github.com/rust-lang/rust/issues/34283 ) that causes runtime stack size problems.
493
503
494
- To lint, build, and test release :
504
+ To lint, build, and test:
495
505
496
506
bundle exec rake
497
507
508
+ #### Build Platform-specific Gem
509
+
510
+ The standard ` bundle exec rake build ` will produce a gem in the ` pkg ` directory, but that gem will not be usable because
511
+ the shared library is not present (neither the Rust code nor the compiled form). To create a platform-specific gem that
512
+ can be used, ` rb-sys-dock ` must be run. See the
513
+ [ Cross-Compilation documentation] ( https://oxidize-rb.github.io/rb-sys/tutorial/publishing/cross-compilation.html ) in the
514
+ ` rb-sys ` repository. For example, running:
515
+
516
+ bundle exec rb-sys-dock --platform x86_64-linux --ruby-versions 3.2,3.3 --build
517
+
518
+ Will create a ` pkg/temporalio-<version>-x86_64-linux.gem ` file that can be used in x64 Linux environments on both Ruby
519
+ 3.2 and Ruby 3.3 because it contains the shared libraries. For this specific example, the shared libraries are inside
520
+ the gem at ` lib/temporalio/internal/bridge/3.2/temporalio_bridge.so ` and
521
+ ` lib/temporalio/internal/bridge/3.3/temporalio_bridge.so ` .
522
+
498
523
### Testing
499
524
500
525
This project uses ` minitest ` . To test:
0 commit comments