Fix incorrectly appended square brackets to a multiple select box

If an explicit name has been given and it already ends with "[]"

Before:

    select(:category, [], {}, multiple: true, name: "post[category][]")
    # => <select name="post[category][][]" ...>

After:

    select(:category, [], {}, multiple: true, name: "post[category][]")
    # => <select name="post[category][]" ...>
Preserve magic comments and content encoding of copied migrations.

During insertion of "# This migration comes from ... " comment at the beginning of
a migration, presence of magic comment was not considered.
Remove extra whitespace and fix a comment

minor comment fix for consistency
Merge pull request #9623 from Agis-/patch-2

Remove extra whitespace and fix a comment
Merge pull request #9616 from exviva/multiple_select_name_double_square_brackets

Fix incorrectly appended square brackets to a multiple select box

Before:

    select(:category, [], {}, {:multiple => true, :name => "post[category][]"})
    # => <select name="post[category][][]" ...>

After:

    select(:category, [], {}, {:multiple => true, :name => "post[category][]"})
    # => <select name="post[category][]" ...>
Merge pull request #9621 from sakuro/migration-magic-comment-fix

Preserve magic comments and content encoding of copied migrations.
ensure response.stream is closed
Merge pull request #9627 from rubys/master

ensure response.stream is closed