From bd9dddb99f0f5bb56579753ae18118f4296bfedf Mon Sep 17 00:00:00 2001 From: Maxim Tretyakov Date: Thu, 29 Sep 2022 13:41:58 +0500 Subject: [PATCH 1/3] Revert "Add #url to gcs & s3 objects" This reverts commit f5ab6c6d53e1b9966b65b5ab3c1b54a4e4684346. --- CHANGELOG.md | 31 -------------------------- README.md | 7 ------ lib/cloud_storage/objects/gcs.rb | 4 ---- lib/cloud_storage/objects/s3.rb | 6 +---- lib/cloud_storage/version.rb | 2 +- spec/cloud_storage/objects/gcs_spec.rb | 8 ------- spec/cloud_storage/objects/s3_spec.rb | 8 ------- 7 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 608cac4..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added -- N/A - -### Changed -- N/A - -### Deprecated -- N/A - -### Removed -- N/A - -### Fixed -- N/A - -### Security -- N/A - -## [0.2.0] - 2022-09-27 - -### Added -- Added `#url` for gsc & s3 object wrapper that returns public url diff --git a/README.md b/README.md index e31e56c..dd79312 100644 --- a/README.md +++ b/README.md @@ -107,13 +107,6 @@ cli = CloudStorage::Client.new( => "http://wallarm-devtmp-ipfeeds-presigned-urls-research.s3:4569/Gemfile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Date=20210310T061122Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=..." ``` -### public url - -```ruby -> cli.find('test.txt').url -=> "https://storage.googleapis.com/some-bucket/test_1.txt" -``` - ### Download ```ruby diff --git a/lib/cloud_storage/objects/gcs.rb b/lib/cloud_storage/objects/gcs.rb index 9b7105a..866fe8b 100644 --- a/lib/cloud_storage/objects/gcs.rb +++ b/lib/cloud_storage/objects/gcs.rb @@ -23,10 +23,6 @@ def signed_url(**opts) @internal.signed_url version: :v4, **opts end - def url - @internal.url - end - alias name key def delete! diff --git a/lib/cloud_storage/objects/s3.rb b/lib/cloud_storage/objects/s3.rb index cd4e60d..af77471 100644 --- a/lib/cloud_storage/objects/s3.rb +++ b/lib/cloud_storage/objects/s3.rb @@ -17,8 +17,6 @@ def key @internal.key end - alias name key - def signed_url(**opts) signer = Aws::S3::Presigner.new(client: @client) @@ -30,9 +28,7 @@ def signed_url(**opts) response_content_type: opts[:content_type] end - def url - @internal.public_url - end + alias name key def delete! @resource.bucket(bucket_name).object(key).delete diff --git a/lib/cloud_storage/version.rb b/lib/cloud_storage/version.rb index 3a9f6fb..9ec897a 100644 --- a/lib/cloud_storage/version.rb +++ b/lib/cloud_storage/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CloudStorage - VERSION = '0.2.0' + VERSION = '0.1.2' end diff --git a/spec/cloud_storage/objects/gcs_spec.rb b/spec/cloud_storage/objects/gcs_spec.rb index 0fc2da0..28d7a69 100644 --- a/spec/cloud_storage/objects/gcs_spec.rb +++ b/spec/cloud_storage/objects/gcs_spec.rb @@ -26,14 +26,6 @@ end end - describe '#url' do - subject(:url) { obj.url } - - after { obj.delete! } - - it { is_expected.to eq('https://storage.googleapis.com/some-bucket/test_1.txt') } - end - describe '#delete!' do context 'when file exists' do it do diff --git a/spec/cloud_storage/objects/s3_spec.rb b/spec/cloud_storage/objects/s3_spec.rb index 4090db1..6ec1758 100644 --- a/spec/cloud_storage/objects/s3_spec.rb +++ b/spec/cloud_storage/objects/s3_spec.rb @@ -17,14 +17,6 @@ end end - describe '#url' do - subject(:url) { obj.url } - - after { obj.delete! } - - it { is_expected.to eq("#{ENV.fetch('S3_ENDPOINT')}/#{ENV.fetch('S3_BUCKET')}/test_1.txt") } - end - describe '#delete!' do context 'when file exists' do it do From 345fae4f4a58be38545205ae7dec56314490a547 Mon Sep 17 00:00:00 2001 From: Maxim Tretyakov Date: Thu, 29 Sep 2022 13:46:31 +0500 Subject: [PATCH 2/3] Bump version to 0.2.1 --- lib/cloud_storage/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cloud_storage/version.rb b/lib/cloud_storage/version.rb index 9ec897a..d09e06b 100644 --- a/lib/cloud_storage/version.rb +++ b/lib/cloud_storage/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CloudStorage - VERSION = '0.1.2' + VERSION = '0.2.1' end From f226a08610d24737f6bd51b858fe07f6606d6f7d Mon Sep 17 00:00:00 2001 From: Maxim Tretyakov Date: Thu, 29 Sep 2022 16:52:56 +0500 Subject: [PATCH 3/3] Fix circle ci --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index edf93f6..99e111e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ jobs: - GCS_BUCKET=some-bucket - image: minio/minio:edge entrypoint: sh - command: -c 'mkdir -p /data/test && /usr/bin/minio server /data --json' + command: -c 'mkdir -p /data/test && minio server /data --json' - image: fsouza/fake-gcs-server entrypoint: sh command: > @@ -40,7 +40,7 @@ references: test: matrix: parameters: - ruby_version: ["2.5", "2.6", "2.7", "3.0"] + ruby_version: ["2.5", "2.7", "3.0", "3.1"] workflows: version: 2