Skip to content

Commit

Permalink
Merge pull request #4253 from Crown-Commercial-Service/update-ruby-to…
Browse files Browse the repository at this point in the history
…-v3.3.0

Update ruby to v3.3.0
  • Loading branch information
tim-s-ccs authored Mar 12, 2024
2 parents db78e95 + 6ff6fc7 commit bbf9318
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 3.2
TargetRubyVersion: 3.3
Exclude:
- 'db/schema.rb'
- 'db/seeds.rb'
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.3.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.2-alpine
FROM ruby:3.3.0-alpine

# Build information
ARG GIT_OWNER
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https:/#{repo}.git" }

ruby '3.2.2'
ruby '3.3.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.1.3'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ DEPENDENCIES
webmock (>= 3.12.1)

RUBY VERSION
ruby 3.2.2p53
ruby 3.3.0p0

BUNDLED WITH
2.4.8
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ For any other services relating to the Crown Marketplace, please view [Crown Mar
This guide assumes you have Homebrew installed

#### Check the Ruby version
> **_NOTE:_** The project currently runs on 3.2.2 (Ocotober 2023)
> **_NOTE:_** The project currently runs on 3.3.0 (March 2024)
Ensure that a ruby version manager (e.g. rvm or rbenv) is installed and set up properly, using 3.2.2 as the Ruby version before trying anything else.
Ensure that a ruby version manager (e.g. rvm or rbenv) is installed and set up properly, using 3.3.0 as the Ruby version before trying anything else.

#### Software requirements

Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/os_data_processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def self.process_csv_data(type, csv_stream)
upsert_csv_data(csv_stream) unless type == :dat
end

def self.handle_tar_contents(tar, summary, &)
def self.handle_tar_contents(tar, summary, &block)
tar.each do |entry|
next unless entry.file?

Expand All @@ -138,7 +138,7 @@ def self.handle_tar_contents(tar, summary, &)
else
:dat
end)) and file_stream.rewind
summary[:md5] = chunk_file_data(file_stream, meta_type, &)
summary[:md5] = chunk_file_data(file_stream, meta_type, &block)
end
end

Expand Down
12 changes: 6 additions & 6 deletions lib/tasks/os_file_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ def self.stream_file(filename, data_summary, &)
file_io&.try(&:close)
end

def self.untar_file(filename, summary, &)
def self.untar_file(filename, summary, &block)
summary[:updated_time] = File.mtime(filename)
Gem::Package::TarReader.new(Zlib::GzipReader.open(filename)) do |tar|
handle_tar_contents(tar, summary, &)
handle_tar_contents(tar, summary, &block)
end
end

def self.gunzip_file(filename, summary, &)
def self.gunzip_file(filename, summary, &block)
summary[:updated_time] = File.mtime(filename)
Zlib::GzipReader.open(filename) do |gz|
handle_gzip_contents(gz, summary, &)
handle_gzip_contents(gz, summary, &block)
end
end

def self.unzip_file(filename, summary, &)
def self.unzip_file(filename, summary, &block)
summary[:updated_time] = File.mtime(filename)
Zip::InputStream.open(filename) do |io|
handle_zip_contents(io, summary, &)
handle_zip_contents(io, summary, &block)
end
end
end
12 changes: 6 additions & 6 deletions lib/tasks/os_stream_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ def self.stream_url(obj, data_summary, &)
raise e
end

def self.untar_stream(url, summary, &)
def self.untar_stream(url, summary, &block)
Gem::Package::TarReader.new(Zlib::GzipReader.new(File.open(url))) do |tar|
handle_tar_contents(tar, summary, &)
handle_tar_contents(tar, summary, &block)
end
end

def self.gunzip_url(url, summary, &)
def self.gunzip_url(url, summary, &block)
Zlib::GzipReader.open(File.open(url)) do |gz|
handle_gzip_contents(gz, summary, &)
handle_gzip_contents(gz, summary, &block)
end
end

def self.unzip_url(url, summary, &)
def self.unzip_url(url, summary, &block)
Zip::InputStream.open(IO.popen(url)) do |io|
handle_zip_contents(io, summary, &)
handle_zip_contents(io, summary, &block)
end
end
end

0 comments on commit bbf9318

Please sign in to comment.