fake_s3 0.9 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d994993efd15d616784cb985f37d921acd2c65bd814e69484db256250b4ca4b9
4
- data.tar.gz: 6fb65389b196b8b06a58e28eb7fe326aa07507386002fb007426b77067b45a35
3
+ metadata.gz: '0950524ea2784ce39ab0a268b5c4aeef52566ed66124110940de58bc9a70de3c'
4
+ data.tar.gz: f476430da49718e2ae5d4a42023fa1c5d8afd524e94d9c4a9f1edb60170f2f73
5
5
  SHA512:
6
- metadata.gz: 54bfc011cc636df685d63ece661677f8e0f05e1afab46bf314ecf2f2fb6e531ab2d8c5ced302469e2f7eb75a734b6f2544cf53f70a1342cc0125cfab451a4583
7
- data.tar.gz: ef079e7e352459563c443baf1ad4ce3c4d0b2ed656393a757c4f1690cfcd4f9070f1128cdc92763e1d480f7ed86cff4ffe5ef7b632df8ad41271133d0097ca35
6
+ metadata.gz: 3df19d7b3c18e85be7d5c48de6a2819cf0317acd4b146ae3c51e26c90141cb01405ddfcb63ec418d3a22008cab5ca4a0661158d0f60a28a9b60d43d4c97dab4a
7
+ data.tar.gz: 4e49c678b6aee54b376e6a48bda72bb3defd64b8e53bfcd4c713e11e630673d035b4d1175e89e3d695f79f5d41fb8a34905ffbf8855314e41f1e1bd18e2ca910
data/.gitignore CHANGED
@@ -48,3 +48,4 @@ build-iPhoneSimulator/
48
48
 
49
49
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
50
  .rvmrc
51
+ .tool-versions
data/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## [0.11.0] - 2022-11-03
6
+
7
+ - add delete on object and delete_objects on bucket
8
+ - support ruby 3.0
9
+ - [#3](https://github.com/transparentclassroom/fake_s3/pull/3) Dependency updates
10
+
11
+ ## [0.10.0] - 2020-10-30
12
+
13
+ ### Added
14
+
15
+ - [#2](https://github.com/transparentclassroom/fake_s3/pull/2) Adds `#presigned_url` to `FakeS3::Object`
16
+
17
+ ### Changed
18
+
19
+ - [#2](https://github.com/transparentclassroom/fake_s3/pull/2) BREAKING: Gets rid of `tc.com` portion of fake URL for `FakeS3::Object#public_url`
data/Gemfile.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fake_s3 (0.9)
4
+ fake_s3 (0.11.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- rake (10.5.0)
9
+ rake (13.0.1)
10
10
 
11
11
  PLATFORMS
12
12
  ruby
@@ -14,7 +14,7 @@ PLATFORMS
14
14
  DEPENDENCIES
15
15
  bundler (~> 1.9)
16
16
  fake_s3!
17
- rake (~> 10.0)
17
+ rake (~> 13.0)
18
18
 
19
19
  BUNDLED WITH
20
20
  1.17.2
data/README.md CHANGED
@@ -1,2 +1,13 @@
1
- # fake_s3
1
+ # fake_s3 gem
2
+
2
3
  This is a fake s3 ruby object that mirrors the s3 part of the aws_sdk gem. You can use it in tests.
4
+
5
+ ## Installing
6
+
7
+ Add to your gemfile:
8
+
9
+ `gem 'fake_s3'`
10
+
11
+ ## Releasing
12
+
13
+ `rake release`
data/fake_s3.gemspec CHANGED
@@ -17,10 +17,10 @@ Gem::Specification.new do |spec|
17
17
  # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.required_ruby_version = '~> 2.4'
20
+ spec.required_ruby_version = '>= 2.4'
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.9"
23
- spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rake", "~> 13.0"
24
24
 
25
25
  # spec.add_dependency 'colorize'
26
26
  end
@@ -19,6 +19,13 @@ module FakeS3
19
19
  @objects[key] ||= FakeS3::Object.new(self, key, nil)
20
20
  end
21
21
 
22
+ def delete_objects(args)
23
+ args[:delete][:objects].each do |objects|
24
+ @objects.delete(objects[:key])
25
+ end
26
+ end
27
+
28
+ # this is a method for tests to see the contents of a fake bucket
22
29
  def keys_to_contents
23
30
  @objects.map_to_hash do |key, obj|
24
31
  [key, obj.get.body.read]
@@ -43,8 +43,16 @@ module FakeS3
43
43
  location.bucket.move_to(self, location)
44
44
  end
45
45
 
46
+ def delete
47
+ bucket.delete_objects(delete: {objects: [{key: key}]})
48
+ end
49
+
46
50
  def public_url
47
- "https://test.tc.com.s3.amazonaws.com/#{@key}"
51
+ "https://test.com.s3.amazonaws.com/#{@key}"
52
+ end
53
+
54
+ def presigned_url(method = :get, expires_in: 1.minute)
55
+ "https://test.com.s3.amazonaws.com/#{@key}?X-Amz-Credential=123&method=#{method}&expires_in=#{expires_in.to_s}"
48
56
  end
49
57
 
50
58
  class FakeObjectOutput
@@ -1,3 +1,3 @@
1
1
  module FakeS3
2
- VERSION = "0.9"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fake_s3
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.9'
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Lightsmith
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-22 00:00:00.000000000 Z
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  description: Use this library for unit testing S3 on ruby
42
42
  email:
43
43
  - jeremy.lightsmith@gmail.com
@@ -46,6 +46,7 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
+ - CHANGELOG.md
49
50
  - Gemfile
50
51
  - Gemfile.lock
51
52
  - LICENSE
@@ -60,13 +61,13 @@ homepage: https://github.com/transparentclassroom/fake_s3
60
61
  licenses:
61
62
  - MIT
62
63
  metadata: {}
63
- post_install_message:
64
+ post_install_message:
64
65
  rdoc_options: []
65
66
  require_paths:
66
67
  - lib
67
68
  required_ruby_version: !ruby/object:Gem::Requirement
68
69
  requirements:
69
- - - "~>"
70
+ - - ">="
70
71
  - !ruby/object:Gem::Version
71
72
  version: '2.4'
72
73
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -75,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
76
  - !ruby/object:Gem::Version
76
77
  version: '0'
77
78
  requirements: []
78
- rubygems_version: 3.0.3
79
- signing_key:
79
+ rubygems_version: 3.3.7
80
+ signing_key:
80
81
  specification_version: 4
81
82
  summary: A fake library that mirrors the S3 part of aws-sdk for ruby
82
83
  test_files: []