Sha256: da3c7997d7f9a1eeb00c54b44c2453fdae4bebdfdf8f86e7d11b0522cd746df5

Contents?: true

Size: 444 Bytes

Versions: 20

Compression:

Stored size: 444 Bytes

Contents

class Sneakers::Utils
  def self.make_worker_id(namespace)
    "worker-#{namespace}:#{'1'}:#{rand(36**6).floor.to_s(36)}"  # jid, worker id. include date.
  end
  def self.parse_workers(workerstring)
    missing_workers = []
    workers = (workerstring || '').split(',').map do |k|
      begin
        w = Kernel.const_get(k)
      rescue
        missing_workers << k
      end
      w
    end.compact

    [workers, missing_workers]
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
kicks-3.2.0 lib/sneakers/support/utils.rb
kicks-3.1.1 lib/sneakers/support/utils.rb
kicks-3.1.0 lib/sneakers/support/utils.rb
kicks-3.0.0 lib/sneakers/support/utils.rb
kicks-3.0.0.pre lib/sneakers/support/utils.rb
sneakers-2.12.0 lib/sneakers/support/utils.rb
sneakers-2.12.0.rc1 lib/sneakers/support/utils.rb
sneakers-2.11.0 lib/sneakers/support/utils.rb
sneakers-2.7.0 lib/sneakers/support/utils.rb
sneakers-2.6.0 lib/sneakers/support/utils.rb
sneakers-2.5.0 lib/sneakers/support/utils.rb
sneakers-2.4.0 lib/sneakers/support/utils.rb
sneakers-2.3.5 lib/sneakers/support/utils.rb
sneakers-2.3.4 lib/sneakers/support/utils.rb
sneakers-2.3.2 lib/sneakers/support/utils.rb
sneakers-2.3.1 lib/sneakers/support/utils.rb
sneakers-2.3.0 lib/sneakers/support/utils.rb
sneakers-2.2.1 lib/sneakers/support/utils.rb
sneakers-2.2.0 lib/sneakers/support/utils.rb
sneakers-2.1.0 lib/sneakers/support/utils.rb