Sha256: 453c03683eddcfcc7755b2b6238e30299225f5c4dbb36f0286c20faeadfe0e77

Contents?: true

Size: 390 Bytes

Versions: 2

Compression:

Stored size: 390 Bytes

Contents

require_dependency "rake_dashboard/application_controller"
require 'session_off'

module RakeDashboard
  class TasksController < ApplicationController
    session :off

    def index
      @tasks = RakeDashboard.tasks
    end

    def create
      @rake_stream = capture(:stdout) { Rake::Task[params[:task]].invoke }

      render inline: "<pre><%= @rake_stream %></pre>"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rake_dashboard-0.2.0 app/controllers/rake_dashboard/tasks_controller.rb
rake_dashboard-0.1.0 app/controllers/rake_dashboard/tasks_controller.rb