Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for Rails #844

Merged
merged 1 commit into from
Mar 21, 2020
Merged

Fix build for Rails #844

merged 1 commit into from
Mar 21, 2020

Conversation

thewatts
Copy link
Contributor

@thewatts thewatts commented Mar 21, 2020

Looking at the build pipeline, the build stopped failing without any changes to the code that would indicate a problem.

The only thing that I could discern was that a dependency must have gotten an update causing the failure.

After doing some digging, I saw that Sprockets had gotten a major release to 4.0.0.

The configuration in test/rails/config/application.rb, the source of the build failure, checks to see if the Sprockets version is > 3.

If so, it triggers some code that was also used in slim-rails, per this commit from a couple years ago.

The code works fine in slim-rails because RegisterEngine lives in slim-rails, but unfortunately does not exist in the core slim project, causing the NameError.

I suppose this was missed because until recently Sprockets was < 4.0 and the code written a couple years back never needed to run.

To fix this, I added the slim-rails gem to the Gemfile, and included the missing RegisterEngine module.


Note: Recreating PR to trigger Travis' build process. They were under maintenance last night. All of the individual build scenarios passed, but it failed overall due to maintenance.

The old PR is here #843

@thewatts
Copy link
Contributor Author

thewatts commented Mar 21, 2020

@stonean not sure why the build didn't show up in GH's interface.

The build passed: https://travis-ci.org/github/slim-template/slim/builds/665194012

@thewatts thewatts closed this Mar 21, 2020
@thewatts thewatts reopened this Mar 21, 2020
Looking at the build pipeline, the build stopped failing without any changes to the code that would indicate a problem.

The only thing that I could discern was that a dependency must have gotten an update causing the failure.

After doing some digging, I saw that `Sprockets` had gotten a major release to `4.0.0`.

The configuration in `test/rails/config/application.rb`, the source of the build failure, checks to see if the `Sprockets` version is > 3.

If so, it triggers  some code that was also used in [`slim-rails`](https://github.com/slim-template/slim-rails/blob/b19741ba76a09a3badd0c5145dea6b087064fb87/lib/slim-rails/register_engine.rb#L31-L39), per [this commit from a couple years ago](slim-template@14a845a).

The code works fine in `slim-rails` because `RegisterEngine` [lives in `slim-rails`](https://github.com/slim-template/slim-rails/blob/b19741ba76a09a3badd0c5145dea6b087064fb87/lib/slim-rails/register_engine.rb#L1), but unfortunately does not exist in the core `slim` project, causing the `NameError`.

I suppose this was missed because until recently `Sprockets` was < 4.0 and the code written a couple years back never needed to run.

To fix this, I added the `slim-rails` gem to the `Gemfile`, and included the missing `RegisterEngine` module.
@stonean stonean merged commit 5b64c1a into slim-template:master Mar 21, 2020
@thewatts thewatts deleted the nw-fix-build branch March 21, 2020 14:37
@thewatts
Copy link
Contributor Author

Thanks for the merge, @stonean !

@stonean
Copy link
Contributor

stonean commented Mar 21, 2020

thank you for the contribution! @thewatts !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants