lib/eco/api/session/batch_job.rb in eco-helpers-0.6.2 vs lib/eco/api/session/batch_job.rb in eco-helpers-0.6.3

- old
+ new

@@ -7,12 +7,12 @@ attr_reader :name, :status def initialize(name, type:, sets:, root:) raise "A name is required to refer a job. Given: #{name}" if !name - raise "Type should be one of #{TYPES}. Given: #{type}" if !BatchJob.valid_type?(type) - raise "Sets should be some of #{SETS}. Given: #{sets}" if !BatchJob.valid_sets?(sets) + raise "Type should be one of #{TYPES}. Given: #{type}" if !BatchJob.valid_type?(type) + raise "Sets should be some of #{SETS}. Given: #{sets}" if !BatchJob.valid_sets?(sets) super(root.enviro) @name = name @type = type @sets = [sets].flatten @@ -37,14 +37,14 @@ def pending? @queue.length > 0 end - def add(data) - unless !data - @queue.push(data) - @callbacks[data] = Proc.new if block_given? + def add(entry) + unless !entry + @queue.push(entry) + @callbacks[entry] = Proc.new if block_given? end end def people Eco::API::Organization::People.new(@queue) @@ -68,10 +68,10 @@ backup_update(queue) @status = batch.launch(queue, method: @type.to_s) @status.root = self end - logger.info("Simulate: this would have launched: '#{@type.to_s}'") if simulate + logger.info("Simulate: this would have launched: '#{@type.to_s}'") if simulate return @status end def core? sets.include?(:core)