Module: Jack::Tasks

Includes:
Ffmpeg, Locking
Defined in:
lib/jack/tasks.rb,
lib/jack/tasks/s3.rb,
lib/jack/tasks/ffmpeg.rb,
lib/jack/tasks/locking.rb

Defined Under Namespace

Modules: Ffmpeg, Locking, S3

Instance Method Summary collapse

Methods included from Locking

#lock

Methods included from Ffmpeg

#convert_to_flv, #ffmpeg, #grab_screenshot_from

Instance Method Details

#loggerObject



28
29
30
# File 'lib/jack/tasks.rb', line 28

def logger
  @logger ||= Logger.new(STDERR)
end

#setup_logger(*args) ⇒ Object



24
25
26
# File 'lib/jack/tasks.rb', line 24

def setup_logger(*args)
  @logger = Logger.new(*args)
end

#setup_queue(queue_type, *args) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/jack/tasks.rb', line 7

def setup_queue(queue_type, *args)
  require "jack/queues"
  require "jack/queues/#{queue_type}"
  include Jack::Queues
  mod = Jack::Queues.const_get(queue_type.to_s.capitalize)
  Jack::Queues::Task.send :include, mod
  Jack::Queues::Task.default_connection_args = args
end

#setup_s3(options) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/jack/tasks.rb', line 16

def setup_s3(options)
  require 'jack/tasks/s3'
  @default_s3_bucket = options.delete(:bucket)
  @s3_working_path   = options.delete(:working).to_s
  AWS::S3::Base.establish_connection!(options) if options.any?
  include Jack::Tasks::S3
end