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

Include Rails environment as task dependency #1205

Merged
merged 3 commits into from
May 15, 2024
Merged

Conversation

stevepolitodesign
Copy link
Contributor

@stevepolitodesign stevepolitodesign commented May 15, 2024

Closes #1204

The suspenders:cleanup:organize_gemfile task was not loading the Rails
environment, resulting in the following error:

undefined method `starts_with?' for an instance of String

This was only happening on existing applications not generated by the
application template

Closes #1204

It seems `active_support/core_ext/string` is not loaded when calling
`suspenders:cleanup:organize_gemfile` on applications **not** created
with Suspenders's [application template][].

We could require this file in the class, but instead, we simply use
`String#start_with?` to keep things simple.

Additionally, we ran `standard` to auto-lint the file.

[application template]: https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
Closes #1204

The `suspenders:cleanup:organize_gemfile` task was not loading the Rails
environment, resulting in the following error:

```
undefined method `starts_with?' for an instance of String
```

This was only happening on existing applications not generated by the
[application template][]

[application template]: https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
@stevepolitodesign stevepolitodesign changed the title Use String#start_with? in OrganizeGemfile Include Rails environment as task dependency May 15, 2024
@stevepolitodesign stevepolitodesign merged commit 7a4ed01 into main May 15, 2024
2 checks passed
@stevepolitodesign stevepolitodesign deleted the sh-1204 branch May 15, 2024 20:31
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.

Organize Gemfile fails on existing apps
1 participant