Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (23 sloc) 578 Bytes
module Kumade
class RakeTaskRunner
def initialize(task_name)
@task_name = task_name
end
def invoke
return unless task_defined?
Kumade.configuration.outputter.success("Running rake task: #{@task_name}")
Rake::Task[@task_name].invoke if task_should_be_run?
end
private
def task_defined?
load_rakefile
Rake::Task.task_defined?(@task_name)
end
def task_should_be_run?
!Kumade.configuration.pretending?
end
def load_rakefile
load("Rakefile") if File.exist?("Rakefile")
end
end
end
Something went wrong with that request. Please try again.