class Spud::TaskRunners::RakeTaskRunner::Task

Public Class Methods

new(task) click to toggle source
# File lib/spud/task_runners/rake_task_runner/task.rb, line 28
def initialize(task)
  @rake_task = task
end
tasks(driver) click to toggle source
# File lib/spud/task_runners/rake_task_runner/task.rb, line 16
def self.tasks(driver)
  app = Rake.application
  rakefile = app.find_rakefile_location&.first
  return [] if rakefile.nil?

  app.init('rake', [])
  app.load_rakefile

  app.tasks.map(&method(:new))
end

Public Instance Methods

args() click to toggle source
# File lib/spud/task_runners/rake_task_runner/task.rb, line 48
def args
  TaskArgs.new(@rake_task.arg_names.map { |arg_name| TaskArg.new(arg_name.to_s, 'ordered') })
end
details() click to toggle source
# File lib/spud/task_runners/rake_task_runner/task.rb, line 53
def details
  "#{@rake_task.name_with_args}"
end
invoke(ordered, named) click to toggle source
# File lib/spud/task_runners/rake_task_runner/task.rb, line 33
def invoke(ordered, named)
  T.unsafe(@rake_task).invoke(*ordered)
end
name() click to toggle source
# File lib/spud/task_runners/rake_task_runner/task.rb, line 38
def name
  @rake_task.name
end
source() click to toggle source
# File lib/spud/task_runners/rake_task_runner/task.rb, line 43
def source
  'rake'
end