sdbcli 0.2.5 → 0.2.6
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.
- data/bin/sdbcli +10 -10
- metadata +3 -3
data/bin/sdbcli
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
$LOAD_PATH << File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib')
|
3
3
|
|
4
|
-
Version = '0.2.
|
4
|
+
Version = '0.2.6'
|
5
5
|
HISTORY_FILE = File.join((ENV['HOME'] || ENV['USERPROFILE'] || '.'), '.sdbcli_history')
|
6
6
|
|
7
7
|
require 'rubygems'
|
@@ -16,18 +16,10 @@ access_key_id = ENV['AWS_ACCESS_KEY_ID']
|
|
16
16
|
secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
|
17
17
|
sdb_endpoint = ENV['SDB_ENDPOINT'] || ENV['REGION_NAME'] || 'sdb.amazonaws.com'
|
18
18
|
|
19
|
-
if /\A[^.]+\Z/ =~ sdb_endpoint
|
20
|
-
if sdb_endpoint == 'us-east-1'
|
21
|
-
sdb_endpoint = 'sdb.amazonaws.com'
|
22
|
-
else
|
23
|
-
sdb_endpoint = "sdb.#{sdb_endpoint}.amazonaws.com"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
19
|
ARGV.options do |opt|
|
28
20
|
opt.on('-k', '--access-key=ACCESS_KEY') {|v| access_key_id = v }
|
29
21
|
opt.on('-s', '--secret-key=SECRET_KEY') {|v| secret_access_key = v }
|
30
|
-
opt.on('-e', '--endpoint=
|
22
|
+
opt.on('-e', '--endpoint=ENDPOINT_OR_REGION') {|v| sdb_endpoint = v }
|
31
23
|
opt.parse!
|
32
24
|
|
33
25
|
unless access_key_id and secret_access_key and sdb_endpoint
|
@@ -36,6 +28,14 @@ ARGV.options do |opt|
|
|
36
28
|
end
|
37
29
|
end
|
38
30
|
|
31
|
+
if /\A[^.]+\Z/ =~ sdb_endpoint
|
32
|
+
if sdb_endpoint == 'us-east-1'
|
33
|
+
sdb_endpoint = 'sdb.amazonaws.com'
|
34
|
+
else
|
35
|
+
sdb_endpoint = "sdb.#{sdb_endpoint}.amazonaws.com"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
39
|
$runner = SimpleDB::Runner.new(access_key_id, secret_access_key, sdb_endpoint)
|
40
40
|
|
41
41
|
def output_error(msg)
|
metadata
CHANGED