s3mpi 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 750b7484b10dac34808cb7c1cb1c1f2bdfd7eeb0
4
- data.tar.gz: e63652c05a474322356d2587ad62dff51f030d25
3
+ metadata.gz: 67cdd6effa5fd9982c41d98ab9771893af7a21bb
4
+ data.tar.gz: 993b03afcfdc8b04b7499f820c9786eae4ca678a
5
5
  SHA512:
6
- metadata.gz: ce652479bba4088e04d61aa1565c8f03db7db7839b4525520a34efc36e199a4dd7d32c475e86a354c065bb46b1fba8818ee38f1441f5f30099afa759a958c1b3
7
- data.tar.gz: adf00002f3bb1e21a1ec052603fc8f44044b530e4f9e935f8bac9ece01138b22bf58d78fde509acf652e75a926df3ebb6b67f1f9affd57197d52cffbd6363728
6
+ metadata.gz: 5b61de73d975d2e90c3de2ef5f341dbeddc239caefb226d286b9776e8d48931f4f4936dc67154444f8d2c7d7e59896d1a6b266f38e7b911fd4342a169461f27b
7
+ data.tar.gz: c6876dd9999bc7108b9caa5e9fff3346ba3903e2b8130090b2f697e5227df4b921068657fa951e625b62ce717c773df9494d571063c9a7c8cb0470f0a9d1ca88
data/README.md CHANGED
@@ -1,7 +1,27 @@
1
1
  S3MPI
2
2
  =========
3
3
 
4
- Upload and download files to S3 using a very convenient API.
4
+ Upload and download Ruby objects to S3 using a very convenient API.
5
+
6
+
7
+ Usage
8
+ -----
9
+
10
+ To set up an S3 interface, one can run
11
+
12
+ ```ruby
13
+ MPI = S3MPI::Interface.new('bucket', 'path/in/bucket')
14
+ # or a constant name of your choosing
15
+ ```
16
+
17
+ Then, assuming our [credentials are set up correctly](https://aws.amazon.com/articles/8621639827664165),
18
+ we can store and read Ruby objects:
19
+
20
+ ```ruby
21
+ MPI.store({some: 'ruby', object: 5}, 'some_object')
22
+ MPI.read('some_object')
23
+ ```
5
24
 
6
25
  [![Build Status](https://travis-ci.org/robertzk/s3mpi.svg?branch=master)](https://travis-ci.org/robertzk/s3mpi)
7
26
  [![Code Climate](https://codeclimate.com/github/robertzk/s3mpi.png)](https://codeclimate.com/github/robertzk/s3mpi)
27
+
@@ -61,6 +61,16 @@ module S3MPI
61
61
  s3_object(key).exists?
62
62
  end
63
63
 
64
+ # Fetch the S3 object as an AWS::S3::S3Object.
65
+ #
66
+ # @param [String] name
67
+ # The key under which to save the object in the S3 bucket.
68
+ #
69
+ # @return [AWS::S3::S3Object]
70
+ def object(key)
71
+ AWS::S3::S3Object.new(@bucket, "#{@path}#{key}")
72
+ end
73
+
64
74
  end
65
75
  end
66
76
 
data/lib/s3mpi/version.rb CHANGED
@@ -2,7 +2,7 @@ module S3MPI
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 2
5
+ PATCH = 3
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.');
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3mpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Krzyzanowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-27 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk