outatime 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/lib/outatime/fetcher.rb +5 -8
- data/lib/outatime/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: 9413cb4ec7dfd1657acd3b8f031fc03b74c9ca9c
|
4
|
+
data.tar.gz: d880faa841f6e506d602c22cbb5ad76027f2f1ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d258fd21d762e66e887507f5630af69e86cd1532633b64b115e1c6d78767e94db640c5bbf13923ad8f924ba3afd4a5032d26ad637bf8eec09b01961f02420326
|
7
|
+
data.tar.gz: f8044e58e7f1ca9a4acec8551a663b48612f72837bed2d3d112557bd7cc765758673a171b329ed73d229f0988114c89943195cf014ae60a5c002ec2536be134e
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -21,12 +21,12 @@ Or install it yourself as:
|
|
21
21
|
## Usage
|
22
22
|
|
23
23
|
```
|
24
|
-
outatime -r {region} -b {bucket
|
24
|
+
outatime -r {region} -b {bucket name} -f {date} -p {s3 subdirectory} --d {local path} --o {aws profile name}
|
25
25
|
```
|
26
26
|
|
27
27
|
Example:
|
28
28
|
```
|
29
|
-
outatime -r us-east-1 -b my-bucket -f '21 Oct 2015' -p schematics/hoverboard
|
29
|
+
outatime -r us-east-1 -b my-bucket -f '21 Oct 2015' -p schematics/hoverboard -d ~/docs -o aws-profile
|
30
30
|
```
|
31
31
|
|
32
32
|
## Development
|
data/lib/outatime/fetcher.rb
CHANGED
@@ -53,8 +53,8 @@ module Outatime
|
|
53
53
|
s3_client.list_object_versions(bucket: @options[:bucket],
|
54
54
|
prefix: @options[:prefix]).each do |response|
|
55
55
|
|
56
|
-
versions
|
57
|
-
delete_markers
|
56
|
+
versions.concat(filter_future_items(response.versions))
|
57
|
+
delete_markers.concat(filter_future_items(response.delete_markers))
|
58
58
|
end
|
59
59
|
|
60
60
|
# keep only the latest versions
|
@@ -127,16 +127,13 @@ module Outatime
|
|
127
127
|
@s3_client ||= Aws::S3::Client.new(region: region)
|
128
128
|
end
|
129
129
|
|
130
|
-
# Private: Returns an Array of items modified on or before the
|
130
|
+
# Private: Returns an Array of items modified on or before the @from date/time.
|
131
131
|
#
|
132
132
|
# items - An Array of objects. Object must respond to #last_modified.
|
133
|
-
# date_time - Comparison date/time.
|
134
133
|
#
|
135
134
|
# Returns Array.
|
136
|
-
def filter_future_items(items
|
137
|
-
items.
|
138
|
-
obj.last_modified <= @from
|
139
|
-
end
|
135
|
+
def filter_future_items(items)
|
136
|
+
items.keep_if { |obj| obj.last_modified <= @from }
|
140
137
|
end
|
141
138
|
end
|
142
139
|
end
|
data/lib/outatime/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: outatime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Mazzi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws-sdk
|