s3archive 1.0 → 1.1.0

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.
@@ -22,5 +22,11 @@ module S3Archive
22
22
  send("#{key}=", val)
23
23
  end
24
24
  end
25
+
26
+ def self.sample_yaml
27
+ {"bucket" => "BUCKET",
28
+ "access_key_id" => "ACCESS_KEY_ID",
29
+ "secret_access_key" => "SECRET_ACCESS_KEY_ID"}.to_yaml
30
+ end
25
31
  end
26
32
  end
@@ -13,10 +13,18 @@ module S3Archive
13
13
  :aliases => "--config",
14
14
  :default => "/etc/s3archive.yml"
15
15
 
16
- desc "upload PATH", "Compresses PATH and uploads to s3://<bucket>/<year>/<month>/<day>/<filename>.gz"
17
- def upload (orig_path, options = {})
16
+ desc "upload PATH [PATH...]", "Compresses PATH and uploads to s3://<bucket>/<year>/<month>/<day>/<filename>.gz"
17
+ def upload (*paths)
18
18
  S3Archive.config_path = self.options["c"] if self.options["c"]
19
- CompressAndUpload.run(orig_path)
19
+ help(:upload) && exit if paths.empty?
20
+ paths.each do |path|
21
+ CompressAndUpload.run(path)
22
+ end
23
+ end
24
+
25
+ desc "genconfig", "Prints a sample config file to stdout"
26
+ def genconfig
27
+ puts S3Archive::Config.sample_yaml
20
28
  end
21
29
  end
22
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3archive
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-30 00:00:00.000000000 Z
12
+ date: 2012-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor