I hereby claim:
- I am pvcarrera on github.
- I am pvcarrera (https://keybase.io/pvcarrera) on keybase.
- I have a public key whose fingerprint is 2814 1698 E300 ACF4 21EB 3230 6AC4 A68A 9C82 0938
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| HOOKS="pre-commit-rspec pre-commit-rubocop" | |
| for hook in $HOOKS; do | |
| if [ -f "$PWD/.git/hooks/$hook" ]; then | |
| "$PWD/.git/hooks/$hook" | |
| if [ $? != 0 ]; then | |
| exit 1 | |
| fi | |
| else |
| #!/bin/sh | |
| red='\033[0;31m' | |
| green='\033[0;32m' | |
| yellow='\033[0;33m' | |
| NC='\033[0m' | |
| # Get only the staged files | |
| FILES="$(git diff --cached --name-only --diff-filter=AMC | grep "\.rb$" | tr '\n' ' ')" |
| namespace :db do | |
| desc 'Reset and populate sample data' | |
| task populate_sample_data: [:reset, :drop_constraints, 'fixtures:load', :create_constraints] do | |
| puts 'Fixtures loaded in the database' | |
| end | |
| desc 'Remove all database constraints' | |
| task drop_constraints: [:environment, :create_constraints_script, :drop_constraints_script] do | |
| ActiveRecord::Base.connection.execute(IO.read('tmp/drop_constraints.sql')) | |
| puts 'Constraints dropped' |
| namespace :heroku do | |
| DEFAULT_APP = 'my_app' | |
| desc 'Create database backup' | |
| task :backup, :app do |task, args| | |
| args.with_defaults(app: DEFAULT_APP) | |
| Bundler.with_clean_env do | |
| `heroku pg:backups capture --app #{args[:app]}` | |
| end |
| Documentation: | |
| Enabled: false | |
| Style/LineLength: | |
| Max: 110 | |
| AllCops: | |
| Exclude: | |
| - 'db/**/*' | |
| - 'config/**/*' | |
| - 'script/**/*' | |
| - 'spec/spec_helper.rb' |
| --color | |
| --format documentation |