Created
February 25, 2015 18:16
-
-
Save tdg5/38ebca3dce9e565f8938 to your computer and use it in GitHub Desktop.
alternative means of adding tagging to rails console comand
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
# Add to require from script/rails before rails/commands is required. | |
if /^c(?:onsole)?$/ === ARGV[0] && index = ARGV.index { |arg| /-(t|-tag)/ === arg } | |
# Intercept the arguments vector before it is passed to Rails::Console. | |
# Drop the -t or --tag arg and following argument which should be the tag | |
# itself. That's all that should need to be done because the tag will show up | |
# in the command name given how the command was invoked. | |
ARGV.slice!(index, 2) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment