s3cp 1.1.18 → 1.1.19

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,6 +1,10 @@
1
+ === 1.1.19 (2013-02-06)
2
+
3
+ * Fixed: Error in `s3lifecycle` if rule prefix is nil.
4
+
1
5
  === 1.1.18 (2013-02-05)
2
6
 
3
- * Fixed: Add new `s3lifecycle` command to manage object transtion rules.
7
+ * Added: Add new `s3lifecycle` command to manage object transtion rules.
4
8
 
5
9
  A few examples:
6
10
 
@@ -84,11 +84,11 @@ end
84
84
 
85
85
  def rule_to_str(r)
86
86
  if r.expiration_time
87
- [ r.prefix, r.id, r.status, time_or_date_str("Expire", r.expiration_time)]
87
+ [ r.prefix || "[root]", r.id, r.status, time_or_date_str("Expire", r.expiration_time)]
88
88
  elsif r.glacier_transition_time
89
- [ r.prefix, r.id, r.status, time_or_date_str("Glacier", r.glacier_transition_time)]
89
+ [ r.prefix || "[root]", r.id, r.status, time_or_date_str("Glacier", r.glacier_transition_time)]
90
90
  else
91
- [ r.prefix, r.id, r.status, "???"]
91
+ [ r.prefix || "[root]", r.id, r.status, "???"]
92
92
  end
93
93
  end
94
94
 
@@ -157,12 +157,17 @@ paths.each do |path|
157
157
  fail "Rule or prefix not found" unless success
158
158
 
159
159
  else
160
- puts "Lifecycle rules:"
161
160
  rules = @s3.buckets[bucket].lifecycle_configuration.rules.to_a
162
161
  if rules.empty?
163
- puts "No lifecycle rules"
162
+ puts "#{bucket} - no lifecycle rules"
164
163
  else
165
- puts S3CP.tableify(rules.map { |r| rule_to_str(r) })
164
+ puts "#{bucket} - lifecycle rules:"
165
+ begin
166
+ puts S3CP.tableify(rules.map { |r| rule_to_str(r) })
167
+ rescue => e
168
+ puts rules.inspect
169
+ raise e
170
+ end
166
171
  end
167
172
  end
168
173
  end
data/lib/s3cp/version.rb CHANGED
@@ -16,5 +16,5 @@
16
16
  # the License.
17
17
 
18
18
  module S3CP
19
- VERSION = "1.1.18"
19
+ VERSION = "1.1.19"
20
20
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3cp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 53
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 18
10
- version: 1.1.18
9
+ - 19
10
+ version: 1.1.19
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Boisvert