This file contains 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
# Open reek documentation for the given <SmellName>. | |
# | |
# Example: | |
# `reekd` -> Opens https://github.com/troessner/reek/tree/master/docs | |
# `reekd BooleanParameter` -> Opens https://github.com/troessner/reek/blob/master/docs/Boolean-Parameter.md | |
function reekd() { | |
if [[ $# -eq 0 ]]; then | |
open "https://github.com/troessner/reek/tree/master/docs" | |
else | |
local formatted_section=$(echo "$1" | sed 's/\([A-Z][a-z]\)/-\1/g' | sed 's/^-//') |
This file contains 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
# Open Rubocop documentation. Optionally, by <Department> or by <Department>/<Name>. | |
# | |
# Example: | |
# `copd` -> Opens https://docs.rubocop.org/rubocop/index.html | |
# `copd Naming` -> Opens https://docs.rubocop.org/rubocop/cops_naming.html | |
# `copd Style/ArgumentsForwarding` -> Opens https://docs.rubocop.org/rubocop/cops_style.html#styleargumentsforwarding | |
function copd() { | |
if [[ $# -eq 0 ]]; then | |
open "https://docs.rubocop.org/rubocop/index.html" | |
else |
This file contains 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
AwesomePrint.defaults = { | |
:indent => -2, | |
:color => { | |
:string => :greenish, | |
:date => :yellowish, | |
:time => :yellowish, | |
:nilclass => :cyanish | |
} | |
} |
This file contains 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
# app/models/api_v2_responder.rb | |
# This approach was heavily inspired by | |
# http://josephhsu.com/post/32746478033/rails-responders-api-versioning. | |
# Overriding the #to_json method wasn't right though, as it removed half of the | |
# awesome functionality of respond_with. | |
# | |
# @see https://github.com/rails/rails/blob/v3.2.17/actionpack/lib/action_controller/metal/responder.rb | |
class ApiV2Responder < ActionController::Responder | |
# Override the original `#display` method to wrap the passed in resource in | |
# the correspondingly named Presenter. |