Sha256: 6e090e358999444ecaf3e6bcd742d705a011c96f5dd12b6f1b890f9dbb42b80f

Contents?: true

Size: 1005 Bytes

Versions: 19

Compression:

Stored size: 1005 Bytes

Contents

require_relative 'simple_worker/utils'
require_relative 'simple_worker/service'
require_relative 'simple_worker/base'
require_relative 'simple_worker/config'
require_relative 'simple_worker/used_in_worker'


module SimpleWorker
  @@logger = Logger.new(STDOUT)
  @@logger.level = Logger::INFO


  class << self
    attr_accessor :config,
                  :service

    def configure()
      yield(config)
      if config && config.token
        SimpleWorker.service ||= Service.new(config.token, :config=>config)
      else
        @@logger.warn "No token specified in configure, be sure to set it!"
      end
    end

    def config
      @config ||= Config.new
    end

    def logger
      @@logger
    end

    def api_version
      2
    end
  end

end

if defined?(Rails)
#  puts 'Rails=' + Rails.inspect
#  puts 'vers=' + Rails::VERSION::MAJOR.inspect
  if Rails::VERSION::MAJOR == 2
    require_relative 'simple_worker/rails2_init.rb'
  else
    require_relative 'simple_worker/railtie'
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
simple_worker-2.0.9 lib/simple_worker.rb
simple_worker-2.0.8 lib/simple_worker.rb
simple_worker-2.0.6 lib/simple_worker.rb
simple_worker-2.0.5 lib/simple_worker.rb
simple_worker-2.0.4 lib/simple_worker.rb
simple_worker-2.0.3 lib/simple_worker.rb
simple_worker-2.0.2 lib/simple_worker.rb
simple_worker-2.0.1 lib/simple_worker.rb
simple_worker-2.0.0.beta.17 lib/simple_worker.rb
simple_worker-2.0.0.beta.16 lib/simple_worker.rb
simple_worker-2.0.0.beta.15 lib/simple_worker.rb
simple_worker-2.0.0.beta.11 lib/simple_worker.rb
simple_worker-2.0.0.beta.10 lib/simple_worker.rb
simple_worker-2.0.0.beta.9 lib/simple_worker.rb
simple_worker-2.0.0.beta.8 lib/simple_worker.rb
simple_worker-2.0.0.beta.7 lib/simple_worker.rb
simple_worker-2.0.0.beta.6 lib/simple_worker.rb
simple_worker-2.0.0.beta.5 lib/simple_worker.rb
simple_worker-2.0.0.beta.4 lib/simple_worker.rb