Sha256: 4fdfddd751971ee1108d1faee326855eb44e7366d630da89eec52604da802d9a

Contents?: true

Size: 987 Bytes

Versions: 11

Compression:

Stored size: 987 Bytes

Contents

unless defined? $__rq_configurator__
  module RQ 
#--{{{
    LIBDIR = File::dirname(File::expand_path(__FILE__)) + File::SEPARATOR unless
      defined? LIBDIR

    require LIBDIR + 'mainhelper'

    # 
    # a Configurator adds key/value pairs to a queue's configuration.  these
    # key/value pairs are not currently used, but will be in a future release 
    # 
    class  Configurator < MainHelper
#--{{{
#--}}}
      def configure
#--{{{
        set_q
        attributes = {}
        unless @argv.empty?
          kv_pat = %r/^\s*([^\s]+)\s*=+\s*([^\s]+)\s*$/o
          @q.transaction do
            @argv.each do |arg|
              match = kv_pat.match arg
              if match 
                k, v = match[1], match[2] 
                @q[k] = v
              end
            end
            attributes = @q.attributes
          end
        end
        y attributes
#--}}}
      end
    end # class Configurator
#--}}}
  end # module RQ
$__rq_configurator__ = __FILE__ 
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rq-3.5.3 lib/rq/configurator.rb
rq-3.5.1 lib/rq/configurator.rb
rq-3.5.0 lib/rq/configurator.rb
rq-ruby1.8-3.4.7 lib/rq/configurator.rb
rq-ruby1.8-3.4.6 lib/rq/configurator.rb
rq-ruby1.8-3.4.5 lib/rq/configurator.rb
rq-ruby1.8-3.4.3 lib/rq/configurator.rb
rq-3.0.0 lib/rq-3.0.0/configurator.rb
rq-3.1.0 lib/rq-3.1.0/configurator.rb
rq-3.3.0 lib/rq/configurator.rb
rq-3.4.0 lib/rq/configurator.rb