From 6fa5fd8515e0f2d5a6341134560021f353d84362 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 29 Jan 2019 07:49:59 -0800 Subject: Fix uninitialized constant with GitLab Pages deploy pages:deploy step was failing with the following error: ``` unitialized constant SafeZip::Extract::Zip ``` Since license_finder already pulls in rubyzip, we can make it a required gem. We also use the scope operator to make the reference to Zip::File explicit. --- Gemfile | 2 +- changelogs/unreleased/sh-fix-pages-zip-constant.yml | 5 +++++ lib/safe_zip/extract.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/sh-fix-pages-zip-constant.yml diff --git a/Gemfile b/Gemfile index e632a083acf..f30b7fb3041 100644 --- a/Gemfile +++ b/Gemfile @@ -57,7 +57,7 @@ gem 'u2f', '~> 0.2.1' # GitLab Pages gem 'validates_hostname', '~> 1.0.6' -gem 'rubyzip', '~> 1.2.2', require: false +gem 'rubyzip', '~> 1.2.2' # Browser detection gem 'browser', '~> 2.5' diff --git a/changelogs/unreleased/sh-fix-pages-zip-constant.yml b/changelogs/unreleased/sh-fix-pages-zip-constant.yml new file mode 100644 index 00000000000..fcd8aa45825 --- /dev/null +++ b/changelogs/unreleased/sh-fix-pages-zip-constant.yml @@ -0,0 +1,5 @@ +--- +title: Fix uninitialized constant with GitLab Pages +merge_request: +author: +type: fixed diff --git a/lib/safe_zip/extract.rb b/lib/safe_zip/extract.rb index 3bd4935ef34..679c021c730 100644 --- a/lib/safe_zip/extract.rb +++ b/lib/safe_zip/extract.rb @@ -29,7 +29,7 @@ module SafeZip private def extract_with_ruby_zip(params) - Zip::File.open(archive_path) do |zip_archive| + ::Zip::File.open(archive_path) do |zip_archive| # Extract all files in the following order: # 1. Directories first, # 2. Files next, -- cgit v1.2.1