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

Customise gemfiles adds 1 too many newline chars #216

Closed
luke-hill opened this issue Sep 26, 2023 · 1 comment
Closed

Customise gemfiles adds 1 too many newline chars #216

luke-hill opened this issue Sep 26, 2023 · 1 comment

Comments

@luke-hill
Copy link

luke-hill commented Sep 26, 2023

When using customize_gemfiles as described on the repo 2 newline chars are inserted after the block comment. It should only be 1.

# frozen_string_literal: true

customize_gemfiles do
  {
    single_quotes: true,
    heading: <<~HEADING
      frozen_string_literal: true

      File has been generated by Appraisal, do NOT modify it directly!
      To modify the individual gemfiles. Modify the Appraisals file in the TLD
    HEADING
  }
end

appraise 'rails_5_2' do
  gem 'activerecord'
....
end

Produces

# frozen_string_literal: true

# File has been generated by Appraisal, do NOT modify it directly!
# To modify the individual gemfiles. Modify the Appraisals file in the TLD


source 'https://rubygems.org'

gem 'activerecord'
....
joe-sharp added a commit to joe-sharp/appraisal that referenced this issue Feb 29, 2024
joe-sharp added a commit to joe-sharp/appraisal that referenced this issue Feb 29, 2024
joe-sharp added a commit to joe-sharp/appraisal that referenced this issue Feb 29, 2024
joe-sharp added a commit to joe-sharp/appraisal that referenced this issue Feb 29, 2024
joe-sharp added a commit to joe-sharp/appraisal that referenced this issue Feb 29, 2024
@joe-sharp
Copy link
Contributor

Sorry for the many commits, I would've hoped the force-pushes would've reduced that to one 🤦🏼‍♂️

nickcharlton pushed a commit to joe-sharp/appraisal that referenced this issue Mar 26, 2024
When using `customize_gemfiles`, two new line characters end up being
inserted after the block comment, but it should only be one. This trims
out the output to remove it.

Fixes thoughtbot#216.
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

No branches or pull requests

2 participants