Skip to content

Commit

Permalink
Move comment below shebang in bin/console template
Browse files Browse the repository at this point in the history
In an executable script, the shebang line should be the first line (the
file needs to start with the bytes 0x23 0x21).  Putting a comment above
it will break the script.

(Regression test included per @deivid-rodriguez)
  • Loading branch information
speckins committed Sep 3, 2020
1 parent dc133dc commit 962e669
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions bundler/lib/bundler/templates/newgem/bin/console.tt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "<%= config[:namespaced_path] %>"
Expand Down
2 changes: 2 additions & 0 deletions bundler/spec/commands/newgem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ def create_temporary_dir(dir)
expect(bundled_app("#{gem_name}/bin/console")).to exist
expect(bundled_app("#{gem_name}/bin/setup")).to be_executable
expect(bundled_app("#{gem_name}/bin/console")).to be_executable
expect(bundled_app("#{gem_name}/bin/setup").read).to start_with("#!")
expect(bundled_app("#{gem_name}/bin/console").read).to start_with("#!")
end

it "starts with version 0.1.0" do
Expand Down

0 comments on commit 962e669

Please sign in to comment.