Skip to content

Commit

Permalink
rubocop fix
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Dec 18, 2023
1 parent 2533167 commit b24f55c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Ruby 3.0
uses: actions/setup-ruby@v2
uses: actions/setup-ruby@v1
with:
ruby-version: 3.0

Expand All @@ -40,7 +40,7 @@ jobs:

# Try to retrieve the gems from the cache
- name: 'Cache Gems'
uses: actions/cache@v2
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
Expand Down
26 changes: 15 additions & 11 deletions app/models/inv_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,26 @@ def object_info_add_localids(json)
end
end

def object_info_add_version(json, maxfile, ver)
v = {
version_number: ver.number,
created: ver.created,
file_count: ver.inv_files.length,
files: []
}
ver.inv_files.each do |f|
filecount += 1
v[:files].push(object_info_files(f)) unless filecount > maxfile
end
json[:versions].prepend(v)
end

def object_info_add_versions(json, maxfile)
filecount = 0
inv_versions.each do |ver|
retries = 0
begin
v = {
version_number: ver.number,
created: ver.created,
file_count: ver.inv_files.length,
files: []
}
ver.inv_files.each do |f|
filecount += 1
v[:files].push(object_info_files(f)) unless filecount > maxfile
end
json[:versions].prepend(v)
object_info_add_version(json, maxfile, ver)
# :nocov:
rescue StandardError => e
retries += 1
Expand Down

0 comments on commit b24f55c

Please sign in to comment.