$ docker run --rm -it -v ${PWD}:/usr/src -w /usr/src ruby:2.7 sh -c 'gem install rails:"~> 6.0.3" && rails new --database=postgresql <app_name>'
cd
into project directory
#!/bin/bash | |
# Backup multiple MySQL databases (in same host) via `mysqldump`. | |
# By ggaona | |
# | |
# Requirements: | |
# | |
# + mysqldump | |
# + MySQL password provided in '.my.cnf' file; example file: | |
# |
#!/bin/bash | |
# Execute Rubocop before committing; aborts commit if any offense is found. | |
# By ggaona | |
# Get files to be analyzed (all staged files with '.rb' or '.rake' extension; | |
# ignores 'schema.rb', migrations and deleted files) | |
STAGED_FILES=$(git diff --name-status --cached | grep -E '\.rb|\.rake' | grep -Ev 'D|schema.rb|migrate') | |
# Get total count of files to be analyzed |
#!/bin/bash | |
# Execute tests (Minitest, Brakeman) before committing; aborts push if any | |
# test fails. | |
# By ggaona | |
# Execute brakeman | |
echo "[Brakeman]" | |
bundle exec brakeman --color | |
# Docker alternative |