module Cardio::Command::Custom
Card-extensions of Rails
command patterns
Private Instance Methods
Source
# File lib/cardio/command/custom.rb, line 59 def command_help command, conf alt = conf[:alias] ? "(or #{conf[:alias]})" : "" " #{command.to_s.ljust(12).light_cyan}#{alt.ljust(10)}#{conf[:desc]}" end
formats command string for help text
Source
# File lib/cardio/command/custom.rb, line 36 def run_help puts "Usage:" puts " #{Command.bin_name} COMMAND [OPTIONS]".green puts puts "Run commands with -h (or --help) for more info." %i[shark monkey].each do |group| run_help_for_group group end end
def run_jasmine
require "cardio/command/rake_command" RakeCommand.new("spec:javascript", envs: "test").run
end
Source
# File lib/cardio/command/custom.rb, line 47 def run_help_for_group group puts puts "For #{"#{group}s".yellow}:" map.each do |command, conf| next unless conf[:group] == group puts command_help(command, conf) end puts end
Source
# File lib/cardio/command/custom.rb, line 10 def run_new if ["-h", "--help"].intersection(args).empty? puts "Can't initialize a new deck within the directory of another, " \ "please change to a non-deck directory first.\n" puts "Type '#{gem}' for help." exit 1 else ARGV.unshift "new" require "cardio/command/application" end end
Source
# File lib/cardio/command/custom.rb, line 26 def run_rspec require "cardio/command/rspec_command" RspecCommand.new(args).run end
Source
# File lib/cardio/command/custom.rb, line 22 def run_version puts "Card #{Version.card_release}".light_cyan end