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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 719d4dd381f4e9280d225aa1b36d651985f41ee86f066da310242fd99f37d479
4
- data.tar.gz: 5dcf1a3ef4b44c21fe2ce80452bd81a4a5c68b3d2603a40e650654902928370e
3
+ metadata.gz: c34a9dd1588973dcae3da42f1f49c71f96f6d48b69891a7971538278e3ffeaf1
4
+ data.tar.gz: 47928c14a36a804322acc780896ab12c67e8f9b65dcc5c66662c6fe39364f2bc
5
5
  SHA512:
6
- metadata.gz: 95dcf20515add182b77ad22a36e254f36da6b18f32eccb2928221662d5b659f32f5a862d989bae70a0e7129558b6f3362143eff501f9f95bbc42e943f084b764
7
- data.tar.gz: 80bbb52bc07f592ab73bff2087f1efc793084987b97b29c6c434e85112eea3aff904d4818e979ff969186205007d171ad880a186a6537718691ef2e4bb540f0f
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.1)
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.73.0)
13
- aws-sdk-core (3.17.1)
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::S3Helper.s3_resource_object(path).get
5
+ S3lite::S3Resource.s3_resource_object(path).get
4
6
  end
5
7
 
6
8
  def s3_put(path:, body:)
7
- S3lite::S3Helper.s3_resource_object(path).put(body: body)
9
+ S3lite::S3Resource.s3_resource_object(path).put(body: body)
8
10
  end
9
11
 
10
12
  def self.s3_list(prefix)
11
- S3lite::S3Helper.s3_resource.bucket(S3lite.s3_bucket)
12
- .objects(prefix: "#{S3lite.env}/#{prefix}")
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
@@ -1,3 +1,3 @@
1
1
  module S3lite
2
- VERSION = '0.0.3-1'.freeze
2
+ VERSION = '0.0.3-2'.freeze
3
3
  end
data/lib/s3lite.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 's3lite/version'
2
2
  require 's3lite/parse'
3
- require 's3lite/s3_helper'
3
+ require 's3lite/s3_resource'
4
4
  require 's3lite/s3'
5
5
  require 's3lite/base'
6
6
 
data/s3lite.gemspec CHANGED
@@ -1,9 +1,8 @@
1
-
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'aws-sdk-s3'
5
4
 
6
- require 's3lite'
5
+ require 's3lite/version'
7
6
 
8
7
  Gem::Specification.new do |spec|
9
8
  spec.name = 's3lite'
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.1
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