root/script/retro_tasks

Download in other formats: Raw | Text
Revisions
Dimitrij Denissenko
Dimitrij Denissenko
Apr 19 2009 * 18:10
(over 1 year ago)

Revision b1794537d634e7833190d162a0351bc60046c8fc

Improved TaskRunner, changed config storage frmo YAML to DB

Unknown File Type

A viewable MIME type was not detected. Trying to display the file content as plain text.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env ruby

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'boot'))

require 'active_record'
require 'active_support'
require 'erb'
require 'yaml'

Time.zone_default = Time.__send__(:get_zone, 'UTC')         
ActiveRecord::Base.time_zone_aware_attributes = true
ActiveRecord::Base.default_timezone = :utc

load 'retrospectiva/task_manager.rb'

manager = Retrospectiva::TaskManager.new
if ARGV.include?('tasks')
  puts "Tasks: " + manager.tasks.map(&:name).inspect
elsif ARGV.include?('pending')
  puts "Pending: " + manager.pending.map(&:name).inspect
else 
  manager.run
end