|
- require_relative 'lib/kgrader'
-
- def cli
- KGrader::CLI.new Rake.application.original_dir
- end
-
- def parse_args(num, keywords = {})
- args, options = KGrader::parse_args ARGV.drop(1), num, keywords
- args.each { |arg| task arg.to_sym {} }
- args + [options]
- end
-
- task :default => :help do ; end
-
- task :help do
- puts %{usage:
- - rake list
- - rake roster <course> <rosterfile> [semester=<...>]
- - rake grade <course> <assignment> [semester=<...>] [students=<...>]
- [due=<...>] [fetch=<yes/no>] [regrade=<yes/no>]
- - rake commit <course> <assignment> [semester=<...>] [students=<...>]
- - rake clean
- - rake clobber}
- end
-
- task :list do
- cli.list
- end
-
- task :roster do
- course, rosterfile, options = parse_args 2, { :semester => :string }
- cli.roster course, options[:semester], rosterfile
- end
-
- task :grade do
- course, assignment, options = parse_args 2,
- { :semester => :string, :students => :array, :due => :datetime,
- :fetch => :bool, :regrade => :bool }
- cli.grade course, options[:semester], assignment, options
- end
-
- task :commit do
- course, assignment, options = parse_args 2,
- { :semester => :string, :students => :array }
- cli.commit course, options[:semester], assignment, options
- end
-
- task :clean do
- cli.clean
- end
-
- task :clobber do
- cli.clobber
- end
|