Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-12 13:02:15 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-14 14:48:16 +0300
commit487b0a026f9efe2d8214c19a7b95b391708ba3f4 (patch)
treede1454b660d4478af5dafdfcfd027c787c6ae0c3 /lib
parent2be76355caa579d444c8e3c0d25563eb9778bfb2 (diff)
Improvements, readability for artifacts browser
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/build/artifacts/metadata.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/gitlab/ci/build/artifacts/metadata.rb b/lib/gitlab/ci/build/artifacts/metadata.rb
index d9c051be9f3..47efc51a76e 100644
--- a/lib/gitlab/ci/build/artifacts/metadata.rb
+++ b/lib/gitlab/ci/build/artifacts/metadata.rb
@@ -56,7 +56,7 @@ module Gitlab
next if path =~ invalid_pattern
paths.push(path)
- metadata.push(JSON.parse(meta.chomp, symbolize_names: true))
+ metadata.push(JSON.parse(meta, symbolize_names: true))
rescue JSON::ParserError, Encoding::CompatibilityError
next
end
@@ -66,7 +66,7 @@ module Gitlab
end
def read_version
- gzip do|gz|
+ gzip do |gz|
version_string = read_string(gz)
unless version_string
@@ -95,9 +95,11 @@ module Gitlab
def gzip
open do |file|
gzip = Zlib::GzipReader.new(file)
- result = yield gzip
- gzip.close
- result
+ begin
+ yield gzip
+ ensure
+ gzip.close
+ end
end
end