s3mpi 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -1
- data/lib/s3mpi/interface.rb +10 -0
- data/lib/s3mpi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67cdd6effa5fd9982c41d98ab9771893af7a21bb
|
4
|
+
data.tar.gz: 993b03afcfdc8b04b7499f820c9786eae4ca678a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
[](https://travis-ci.org/robertzk/s3mpi)
|
7
26
|
[](https://codeclimate.com/github/robertzk/s3mpi)
|
27
|
+
|
data/lib/s3mpi/interface.rb
CHANGED
@@ -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
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.
|
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-
|
11
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|