thoughtbot / appraisal

A Ruby library for testing your library against different versions of dependencies.
https://thoughtbot.com
MIT License
1.25k stars 107 forks source link

Customise gemfiles adds 1 too many newline chars #216

Closed luke-hill closed 3 months ago

luke-hill commented 9 months ago

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 commented 4 months ago

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