s3lite 0.0.3.pre.1 → 0.0.3.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/s3lite/s3.rb +6 -4
- data/lib/s3lite/s3_resource.rb +18 -0
- data/lib/s3lite/version.rb +1 -1
- data/lib/s3lite.rb +1 -1
- data/s3lite.gemspec +1 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c34a9dd1588973dcae3da42f1f49c71f96f6d48b69891a7971538278e3ffeaf1
|
4
|
+
data.tar.gz: 47928c14a36a804322acc780896ab12c67e8f9b65dcc5c66662c6fe39364f2bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ec8f6cdb3f1bb341ccd212f89c1406c3fe8c8d267e7221aba9f98d72282c77227abf0a1db4f73118de1990cae196cf3ab70a25db58453d7e891aedd160f1757
|
7
|
+
data.tar.gz: 374e2d033795d807a4d51ef27036ab8c307464bd2c686901d3a3c65816c9bb8d4b2c83a62d63e19f46c8a7d2fe763b38a08c76859c542e4709f75e1ed36bb14d
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
s3lite (0.0.
|
4
|
+
s3lite (0.0.3.pre.2)
|
5
5
|
aws-sdk-s3 (~> 1)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,8 +9,8 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
addressable (2.5.2)
|
11
11
|
public_suffix (>= 2.0.2, < 4.0)
|
12
|
-
aws-partitions (1.
|
13
|
-
aws-sdk-core (3.
|
12
|
+
aws-partitions (1.76.0)
|
13
|
+
aws-sdk-core (3.18.1)
|
14
14
|
aws-partitions (~> 1.0)
|
15
15
|
aws-sigv4 (~> 1.0)
|
16
16
|
jmespath (~> 1.0)
|
data/lib/s3lite/s3.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
module S3lite::S3
|
2
|
+
include S3lite::S3Resource
|
3
|
+
|
2
4
|
def s3_get(path)
|
3
|
-
S3lite::
|
5
|
+
S3lite::S3Resource.s3_resource_object(path).get
|
4
6
|
end
|
5
7
|
|
6
8
|
def s3_put(path:, body:)
|
7
|
-
S3lite::
|
9
|
+
S3lite::S3Resource.s3_resource_object(path).put(body: body)
|
8
10
|
end
|
9
11
|
|
10
12
|
def self.s3_list(prefix)
|
11
|
-
S3lite::
|
12
|
-
|
13
|
+
S3lite::S3Resource.s3_resource.bucket(S3lite.s3_bucket)
|
14
|
+
.objects(prefix: "#{S3lite.env}/#{prefix}")
|
13
15
|
end
|
14
16
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module S3lite::S3Resource
|
2
|
+
class << self
|
3
|
+
def s3_resource_object(path)
|
4
|
+
raise 'No AWS S3 Bucket Set' if S3lite.s3_bucket.nil?
|
5
|
+
s3_resource.bucket(S3lite.s3_bucket).object(path)
|
6
|
+
end
|
7
|
+
|
8
|
+
def s3_resource
|
9
|
+
raise 'No AWS Access Key Set' if S3lite.aws_key.nil?
|
10
|
+
raise 'No AWS Secret Access Key Set' if S3lite.aws_secret_key.nil?
|
11
|
+
Aws::S3::Resource.new(
|
12
|
+
region: S3lite.region || 'us-east-1',
|
13
|
+
access_key_id: S3lite.aws_key,
|
14
|
+
secret_access_key: S3lite.aws_secret_key
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/s3lite/version.rb
CHANGED
data/lib/s3lite.rb
CHANGED
data/s3lite.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.3.pre.
|
4
|
+
version: 0.0.3.pre.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Richey
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/s3lite/base.rb
|
101
101
|
- lib/s3lite/parse.rb
|
102
102
|
- lib/s3lite/s3.rb
|
103
|
+
- lib/s3lite/s3_resource.rb
|
103
104
|
- lib/s3lite/version.rb
|
104
105
|
- s3lite.gemspec
|
105
106
|
homepage: https://github.com/davidrichey/s3lite
|