module Gitguard::Rails::CommandsTasks

Constants

TARGET_COMMANDS

Public Instance Methods

require_command!(command) click to toggle source
Calls superclass method
# File lib/gitguard/rails/commands_tasks.rb, line 7
def require_command!(command)
  if target?(command.to_s)
    Gitguard.run("bin/rails #{command} #{argv.join(' ')}"){ super }
  else
    super
  end
end
target?(command) click to toggle source
# File lib/gitguard/rails/commands_tasks.rb, line 15
def target?(command)
  return false if argv.empty?
  Gitguard.enabled? && TARGET_COMMANDS.include?(command) &&
    (command == 'generate' ? !argv.include?('gitguard:install') : true)
end