diff --git a/.github/workflows/tutorial.yml b/.github/workflows/tutorial.yml index 2a2a0d1..01e835c 100644 --- a/.github/workflows/tutorial.yml +++ b/.github/workflows/tutorial.yml @@ -46,10 +46,6 @@ jobs: run: | ./lesson-1 - - name: Package 2_packaging_scenarios gemfile sample - run: | - tebako press -r tutorial/2_packaging_scenarios/gemfile.sample -e ticker.rb -o ticker.tebako. - # Cannot run this sample since GH Actions does not allow such websocket connection to the outside world - name: Package 2_packaging_scenarios gemspec and gemfile sample @@ -60,6 +56,10 @@ jobs: run: | ./table.tebako + - name: Package 2_packaging_scenarios gemfile sample + run: | + tebako press -r tutorial/2_packaging_scenarios/gemfile.sample -e ticker.rb -o ticker.tebako. + - name: Package 2_packaging_scenarios gemspec sample run: | tebako press -r tutorial/2_packaging_scenarios/gemspec.sample -e tebako-table-cli -o table.tebako diff --git a/tutorial/2_packaging_scenarios/Lesson-2.adoc b/tutorial/2_packaging_scenarios/Lesson-2.adoc index 5c3fba9..14c0df2 100644 --- a/tutorial/2_packaging_scenarios/Lesson-2.adoc +++ b/tutorial/2_packaging_scenarios/Lesson-2.adoc @@ -192,8 +192,13 @@ But now Tebako recognizes that it packages a gem and applies a different deploym ... stripping the output ---- -Tebako installs the gem into its Ruby environment and assumes the entry point is the wrapper created by the `gem` command in the `binary` directory. -Note that the entry point script must be explicitly specified as one of the gem executables. +Tebako uses the link:https://guides.rubygems.org/command-reference/#gem-install[`gem install` command] to place the application into its embedded filesystem. +The configuration created during this process is defined by the gem specification (`gemspec`). +For Tebako to process the `gemspec` correctly, it must define the link:https://guides.rubygems.org/specification-reference/#bindir[`bindir`] +and the link:https://guides.rubygems.org/specification-reference/#executables[`executables`] within the `bindir`. According to the gemspec documentation: +_“... you don’t specify the full path (as in bin/rake); all application-style files are expected to be found in bindir ...”_ +Tebako adheres to this convention by expecting the entry point to be listed as an executable and located in the `bindir` specified in the `gemspec. +Tebako sets the `bindir` option of the `gem install` command to a path within its memory filesystem, such as `\__tebako_memfs__\bin`. This path is effectively the default `bindir` for `gem install` (typically, the folder where the Ruby executable resides). Notably, the gem specification does not indicate that the `bindir` option for `gem install` can be modified or restricted by the gem itself. == Packaging a Gem Without Bundling @@ -238,6 +243,10 @@ tebako press -r gem.sample -e tebako-table-cli -o table.tebako The same limitations apply as in the previous option. This scenario may fail for gems with native extensions due to Tebako's limited control during configuration. It is supported primarily for backward compatibility. +== Acknowledgements + +The samples provided above were inspired by the contributions of https://github.com/bradgessler[bradgessler]. + == Live Example You can find the complete code for this lesson in the `tutorial/2_dependencies` directory of the `tebako-samples` repository.