s3lite 0.0.2 → 0.0.3.pre.1

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: 456e05201c92ee32bcd9a4a5db19d8e961ffd13fe6125444589b2988b12ca400
4
- data.tar.gz: f2d79fc89f11ae694bd721aebfa6cf302f120566459d1971da446d7109114468
3
+ metadata.gz: 719d4dd381f4e9280d225aa1b36d651985f41ee86f066da310242fd99f37d479
4
+ data.tar.gz: 5dcf1a3ef4b44c21fe2ce80452bd81a4a5c68b3d2603a40e650654902928370e
5
5
  SHA512:
6
- metadata.gz: 7b0b19618d30997a817224ed4dd512972022c2ed3c9cde1eb4b27c5875f90a16faa77e30d3118d0d3877f62589626f8c8836c08f429289b10835ce08571d48bb
7
- data.tar.gz: f906d6ca4ba731398c7617efec43c3d731b9cdbd5acd27eaa3545857a7161e34bdd3adaa09a88fcf37a763f56dabe615149de7ece978818f554fc12669ff30a6
6
+ metadata.gz: 95dcf20515add182b77ad22a36e254f36da6b18f32eccb2928221662d5b659f32f5a862d989bae70a0e7129558b6f3362143eff501f9f95bbc42e943f084b764
7
+ data.tar.gz: 80bbb52bc07f592ab73bff2087f1efc793084987b97b29c6c434e85112eea3aff904d4818e979ff969186205007d171ad880a186a6537718691ef2e4bb540f0f
data/lib/s3lite/s3.rb CHANGED
@@ -1,30 +1,14 @@
1
1
  module S3lite::S3
2
2
  def s3_get(path)
3
- s3_resource_object(path).get
4
- end
5
-
6
- def s3_list(bucket)
7
- s3_resource.bucket(bucket)
3
+ S3lite::S3Helper.s3_resource_object(path).get
8
4
  end
9
5
 
10
6
  def s3_put(path:, body:)
11
- s3_resource_object(path).put(body: body)
12
- end
13
-
14
- private
15
-
16
- def s3_resource_object(path)
17
- raise 'No AWS S3 Bucket Set' if S3lite.s3_bucket.nil?
18
- s3_resource.bucket(S3lite.s3_bucket).object(path)
7
+ S3lite::S3Helper.s3_resource_object(path).put(body: body)
19
8
  end
20
9
 
21
- def s3_resource
22
- raise 'No AWS Access Key Set' if S3lite.aws_key.nil?
23
- raise 'No AWS Secret Access Key Set' if S3lite.aws_secret_key.nil?
24
- Aws::S3::Resource.new(
25
- region: S3lite.region || 'us-east-1',
26
- access_key_id: S3lite.aws_key,
27
- secret_access_key: S3lite.aws_secret_key
28
- )
10
+ def self.s3_list(prefix)
11
+ S3lite::S3Helper.s3_resource.bucket(S3lite.s3_bucket)
12
+ .objects(prefix: "#{S3lite.env}/#{prefix}")
29
13
  end
30
14
  end
@@ -1,3 +1,3 @@
1
1
  module S3lite
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3-1'.freeze
3
3
  end
data/lib/s3lite.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  require 's3lite/version'
2
2
  require 's3lite/parse'
3
+ require 's3lite/s3_helper'
3
4
  require 's3lite/s3'
4
5
  require 's3lite/base'
5
6
 
6
7
  module S3lite
7
8
  class << self
8
- attr_accessor :s3_bucket, :region, :aws_key, :aws_secret_key
9
+ attr_accessor :s3_bucket, :region, :aws_key, :aws_secret_key, :env
9
10
  end
10
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Richey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-28 00:00:00.000000000 Z
11
+ date: 2018-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,9 +117,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - ">="
120
+ - - ">"
121
121
  - !ruby/object:Gem::Version
122
- version: '0'
122
+ version: 1.3.1
123
123
  requirements: []
124
124
  rubyforge_project:
125
125
  rubygems_version: 2.7.6