Class: BurdenWeb::TasksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- BurdenWeb::TasksController
- Defined in:
- app/controllers/burden_web/tasks_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
permalink #ignore?(name) ⇒ Boolean
13 14 15 |
# File 'app/controllers/burden_web/tasks_controller.rb', line 13 def ignore? name Burden.config.ignored_tasks.collect{ |r| (name =~ r) ? 1 : 0 }.map(&:to_i).inject(:+) != 0 end |
permalink #index ⇒ Object
[View source]
3 4 5 6 7 8 9 10 11 |
# File 'app/controllers/burden_web/tasks_controller.rb', line 3 def index @tasks = Burden::Storage.run.summary (tasks.map(&:name) - @tasks.map(&:name)).each do |nr_task| # Never runned tasks next if ignore? nr_task @tasks << Burden::Storage.run.new( name: nr_task ) end end |
permalink #run ⇒ Object
[View source]
17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/burden_web/tasks_controller.rb', line 17 def run Rails.application.load_tasks task = Rake::Task[params[:id]] task.prerequisite_tasks.each{ |t| t.execute(nil) } task.execute(nil) rescue => e # Gotta catch 'em all! ensure redirect_to params[:back] end |