Skip to content

Commit

Permalink
rubocop and gem updates
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Nov 1, 2024
1 parent af62734 commit d70de77
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 37 deletions.
22 changes: 9 additions & 13 deletions src/main/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ GEM
ast (2.4.2)
colorize (1.1.0)
diff-lcs (1.5.1)
json (2.7.2)
json (2.7.5)
language_server-protocol (3.17.0.3)
parallel (1.26.3)
parser (3.3.4.2)
parser (3.3.5.1)
ast (~> 2.4.1)
racc
psych (5.1.2)
Expand All @@ -17,38 +17,34 @@ GEM
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.2)
rexml (3.3.6)
strscan
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.2)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.65.1)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.1)
rubocop-ast (1.33.0)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
stringio (3.1.1)
strscan (3.1.0)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
zk (1.10.0)
zookeeper (~> 1.5.0)
zookeeper (1.5.5)
Expand Down
2 changes: 1 addition & 1 deletion src/main/ruby/lib/merritt_zk_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ def self.list_jobs_as_json(zk)
jobs
end
end
end
end
33 changes: 15 additions & 18 deletions src/main/ruby/lib/merritt_zk_batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,26 +195,23 @@ def delete(zk)
def self.list_batches_as_json(zk)
batches = []
zk.children(DIR).sort.each do |cp|

begin
batch = Batch.new(cp)
batch.load(zk)
batchjson = batch.data
batchjson[:id] = batch.id
batchjson[:status] = batch.status_name
batchjson[:jobCountFailed] = batch.get_failed_jobs(zk).length
batchjson[:jobCountDeleted] = batch.get_deleted_jobs(zk).length
batchjson[:jobCountCompleted] = batch.get_completed_jobs(zk).length
batchjson[:jobCountProcessing] = batch.get_processing_jobs(zk).length
batchjson[:jobCount] = batch.get_processing_jobs(zk).length +
batch.get_failed_jobs(zk).length + batch.get_deleted_jobs(zk).length + batch.get_completed_jobs(zk).length
batches.append(batchjson)
rescue StandardError => e
puts "List Batch #{cp} exception: #{e}"
end
batch = Batch.new(cp)
batch.load(zk)
batchjson = batch.data
batchjson[:id] = batch.id
batchjson[:status] = batch.status_name
batchjson[:jobCountFailed] = batch.get_failed_jobs(zk).length
batchjson[:jobCountDeleted] = batch.get_deleted_jobs(zk).length
batchjson[:jobCountCompleted] = batch.get_completed_jobs(zk).length
batchjson[:jobCountProcessing] = batch.get_processing_jobs(zk).length
batchjson[:jobCount] = batch.get_processing_jobs(zk).length +
batch.get_failed_jobs(zk).length + batch.get_deleted_jobs(zk).length +
batch.get_completed_jobs(zk).length
batches.append(batchjson)
rescue StandardError => e
puts "List Batch #{cp} exception: #{e}"
end
batches
end
end

end
2 changes: 1 addition & 1 deletion src/main/ruby/lib/merritt_zk_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def submitter
data_prop('submitter', '')
end

def submissionDate
def submission_date
data_prop('submissionDate', 'foo')
end

Expand Down
4 changes: 2 additions & 2 deletions src/main/ruby/lib/merritt_zk_locks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def self.unlock_collection(zk, mnemonic)
end

def self.store_lock_path(ark)
"#{LOCKS_STORAGE}/#{ark.gsub(/:?\//, '_')}"
"#{LOCKS_STORAGE}/#{ark.gsub(%r{:?/}, '_')}"
end

def self.lock_object_storage(zk, ark)
Expand All @@ -118,7 +118,7 @@ def self.unlock_object_storage(zk, ark)
end

def self.inv_lock_path(ark)
"#{LOCKS_INVENTORY}/#{ark.gsub(/:?\//, '_')}"
"#{LOCKS_INVENTORY}/#{ark.gsub(%r{:?/}, '_')}"
end

def self.lock_object_inventory(zk, ark)
Expand Down
1 change: 0 additions & 1 deletion src/main/ruby/lib/merritt_zk_queue_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,4 @@ def data_prop(_prop, defval)
@data.fetch(defval, '')
end
end

end
2 changes: 1 addition & 1 deletion src/main/ruby/spec/zk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def make_batch_json(s = 'bar', u = 'bid-uuid')
# Only for Ruby interface
arr = MerrittZK::Batch.list_batches_as_json(@zk)
expect(arr.length).to eq(1)

jj.set_status(@zk, MerrittZK::JobState::Deleted)

bbbb.set_status(@zk, MerrittZK::BatchState::Deleted)
Expand Down

0 comments on commit d70de77

Please sign in to comment.