From 1cb50949035d850a85ad0c9d0b6bd424af83a01a Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Thu, 22 Aug 2013 14:38:59 +0000 Subject: [PATCH] Comply with current umask when generating new app: When creating a new application using the default rails generator (`rails new my_app`), it will apply some permissions bypassing the current process umask. The `bin' directory and any files inside it will always be set a mode of 0755. This change removes the current umask bits from the mode applied by the generator on the `bin' directory and its content. --- railties/lib/rails/generators/rails/app/app_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 9fb8ea6955..041bfcb733 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -68,7 +68,7 @@ module Rails directory "bin" do |content| "#{shebang}\n" + content end - chmod "bin", 0755, verbose: false + chmod "bin", 0755 & ~File.umask, verbose: false end def config