Sha256: 68ca3f5e43036cad4f43fe1cd4e30c7a47ec2e3fe130f5d575c343f346fa78bf

Contents?: true

Size: 314 Bytes

Versions: 3

Compression:

Stored size: 314 Bytes

Contents

require File.dirname(__FILE__) + '/../lib/sweatshop'
class HelloWorker < Sweatshop::Worker
  TEST_FILE = File.dirname(__FILE__) + '/test.txt' unless defined?(TEST_FILE)

  def hello(name)
    puts name
    "Hi, #{name}"
  end

  after_task do |task|
    File.open(TEST_FILE, 'w'){|f| f << task[:result]}
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sweatshop-1.5.2 test/hello_worker.rb
sweatshop-1.5.1 test/hello_worker.rb
sweatshop-1.5.0 test/hello_worker.rb