This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Passes all changed and added files on the current branch to RuboCop before pushing. Paste the below into your | |
| # .bin/hooks/pre-push file, which should be made executable. | |
| # Note that it assumes that your trunk branch is named "main." If this is not the case, make the appropriate adjustment. | |
| TRUNK_BRANCH=main | |
| CURRENT_BRANCH="$(git branch --show-current)" | |
| if [ "$CURRENT_BRANCH" != "$TRUNK_BRANCH" ]; then | |
| rubocop $(git diff --name-status "$TRUNK_BRANCH" "$CURRENT_BRANCH" | egrep '^[AM]' | cut -f 2 | egrep '(^Gemfile|.rb)$') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| module PresenceRefinements | |
| refine Object do | |
| def blank? = (respond_to?(:empty?) ? !!empty? : !self) | |
| def present? = !blank? | |
| def presence = (self if present?) | |
| end | |
| # This bit is cribbed from https://github.com/rpanachi/core_ext |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # I sometimes need to securely manage credentials for external services for work | |
| # purposes and these need to be available in environment variables. It would be | |
| # nice to think that I only need these credentials for non-production | |
| # environments, but that is not always the case. Rather than using .env files | |
| # or similar plaintext mechanisms, I use macOS's `security` tool to add | |
| # these credentials to my login keychain and store them in environment | |
| # variables. | |
| # Add a generic password to yur macOS login keychain. You will be prompted | |
| # to enter the password. |
OlderNewer