Skip to content

Commit b944d13

Browse files
committed
Merge pull request #272 from kamilbielawski/develop
Remove new line before annotation wrapper closing statement
2 parents 2bea946 + c6c4c90 commit b944d13

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/annotate/annotate_models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def annotate_one_file(file_name, info_block, position, options={})
292292
end
293293

294294
wrapper_open = options[:wrapper_open] ? "# #{options[:wrapper_open]}\n" : ""
295-
wrapper_close = options[:wrapper_close] ? "\n# #{options[:wrapper_close]}" : ""
295+
wrapper_close = options[:wrapper_close] ? "# #{options[:wrapper_close]}\n" : ""
296296
wrapped_info_block = "#{wrapper_open}#{info_block}#{wrapper_close}"
297297
# if there *was* no old schema info (no substitution happened) or :force was passed,
298298
# we simply need to insert it in correct position

spec/annotate/annotate_models_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def encoding_comments_list_each
552552

553553
it 'should wrap annotation if wrapper is specified' do
554554
annotate_one_file :wrapper_open => 'START', :wrapper_close => 'END'
555-
expect(File.read(@model_file_name)).to eq("# START\n#{@schema_info}\n# END\n#{@file_content}")
555+
expect(File.read(@model_file_name)).to eq("# START\n#{@schema_info}# END\n\n#{@file_content}")
556556
end
557557

558558
describe "with existing annotation => :before" do

0 commit comments

Comments
 (0)