@@ -278,37 +278,22 @@ func (b *Builder) buildDotNet(ctx context.Context, baseDir string) (sdkbuild.Pro
278278}
279279
280280func (b * Builder ) buildRuby (ctx context.Context , baseDir string ) (sdkbuild.Program , error ) {
281- // If version not provided, read the version constraint from the gemspec.
282- version := b .SdkOptions .Version
283- if version == "" {
284- gemspecBytes , err := os .ReadFile (filepath .Join (baseDir , "omes.gemspec" ))
285- if err != nil {
286- return nil , fmt .Errorf ("failed reading omes.gemspec: %w" , err )
287- }
288- for _ , line := range strings .Split (string (gemspecBytes ), "\n " ) {
289- line = strings .TrimSpace (line )
290- if strings .Contains (line , "'temporalio'" ) || strings .Contains (line , `"temporalio"` ) {
291- parts := strings .Split (line , "," )
292- if len (parts ) >= 2 {
293- version = strings .TrimSpace (parts [1 ])
294- version = strings .Trim (version , `"'` )
295- }
296- break
297- }
298- }
299- if version == "" {
300- return nil , fmt .Errorf ("version not found in omes.gemspec" )
301- }
302- }
303-
304- prog , err := sdkbuild .BuildRubyProgram (ctx , sdkbuild.BuildRubyProgramOptions {
281+ options := sdkbuild.BuildRubyProgramOptions {
305282 BaseDir : baseDir ,
306283 SourceDir : baseDir ,
307284 DirName : b .DirName ,
308- Version : version ,
285+ Version : b . SdkOptions . Version ,
309286 Stdout : b .stdout ,
310287 Stderr : b .stderr ,
311- })
288+ }
289+ if b .ProjectName == "" {
290+ options .MoreDependencies = []sdkbuild.RubyDependency {{
291+ Name : "harness" ,
292+ Path : filepath .Join (baseDir , "harness" ),
293+ }}
294+ }
295+
296+ prog , err := sdkbuild .BuildRubyProgram (ctx , options )
312297 if err != nil {
313298 return nil , fmt .Errorf ("failed preparing: %w" , err )
314299 }
0 commit comments