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 +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +3 -3
- data/README.md +12 -1
- data/fake_s3.gemspec +2 -2
- data/lib/fake_s3/bucket.rb +7 -0
- data/lib/fake_s3/object.rb +9 -1
- data/lib/fake_s3/version.rb +1 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0950524ea2784ce39ab0a268b5c4aeef52566ed66124110940de58bc9a70de3c'
|
4
|
+
data.tar.gz: f476430da49718e2ae5d4a42023fa1c5d8afd524e94d9c4a9f1edb60170f2f73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3df19d7b3c18e85be7d5c48de6a2819cf0317acd4b146ae3c51e26c90141cb01405ddfcb63ec418d3a22008cab5ca4a0661158d0f60a28a9b60d43d4c97dab4a
|
7
|
+
data.tar.gz: 4e49c678b6aee54b376e6a48bda72bb3defd64b8e53bfcd4c713e11e630673d035b4d1175e89e3d695f79f5d41fb8a34905ffbf8855314e41f1e1bd18e2ca910
|
data/.gitignore
CHANGED
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.
|
4
|
+
fake_s3 (0.11.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
rake (
|
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 (~>
|
17
|
+
rake (~> 13.0)
|
18
18
|
|
19
19
|
BUNDLED WITH
|
20
20
|
1.17.2
|
data/README.md
CHANGED
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 = '
|
20
|
+
spec.required_ruby_version = '>= 2.4'
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.9"
|
23
|
-
spec.add_development_dependency "rake", "~>
|
23
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
24
24
|
|
25
25
|
# spec.add_dependency 'colorize'
|
26
26
|
end
|
data/lib/fake_s3/bucket.rb
CHANGED
@@ -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]
|
data/lib/fake_s3/object.rb
CHANGED
@@ -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.
|
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
|
data/lib/fake_s3/version.rb
CHANGED
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:
|
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:
|
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: '
|
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: '
|
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.
|
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: []
|