.gitignore with typical Rails project files
Used 78 times
V
Viktor Schmidt
Usage
Run this command in your Rails app directory in the terminal:
rails app:template LOCATION="https://railsbytes.com/script/VAjsaW"
Template Source
Review the code before running this template on your machine.
def print_green(heredoc)
puts set_color heredoc, :green
end
def do_commit
git :init
git add: "."
Bundler.with_unbundled_env { git commit: " -m 'Update .gitignore' " }
end
say "\nUpdating .gitignore..."
create_file ".gitignore", "\n" unless File.exist? ".gitignore"
append_file ".gitignore" do
<<~EOF
# Ignore editor files.
.DS_Store
.vscode/
.idea/
.trunk/
/*.iml
nbproject
/*.sublime-*
*.swp
*.swo
EOF
end
do_commit
print_green "\nUpdated .gitignore successfully!"