s3rbsync 0.7.0 → 0.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dd4776953600f8c4d6bd227c213fc646dcb91ee
4
- data.tar.gz: 067041d781ef4d1aad512ad6d3d713876a1d3116
3
+ metadata.gz: b2adba160f1211f17a0109aaa7e9c047d84b4402
4
+ data.tar.gz: 17b1e17333d5222cceddeaf7c0ae8aa76f771ca6
5
5
  SHA512:
6
- metadata.gz: d1f388e3d84625e92b6f3c40a704f78206cfcb1879cfa23c818178131eeba4967df85d111ee92f18a963c02d324078b9f442b867930f0b9dcda451053ff15db9
7
- data.tar.gz: 5180f73c77c9c4e56097ecd4d9e07f92828377c9cf5d7cdf699ff0c59f6a942d4e1ce5418cbfd9f8f9dfe40f819bde1c14df42842592ebe9dcc01059f5496f74
6
+ metadata.gz: 117caac6fefb242e9ddbe71ec7961fb7ba9cc5698fd313c806dd8a12db3b06e9bdbb298c51b2fa2a8b9eeae61fd3396e3aa2f7cb8b7a2b7f7a0fae4538d0a04e
7
+ data.tar.gz: 177a1d7b33a766c9b929482867e5bf81979ed87c5ae131d933bb69088cac0bd4f94f842cca7ae2f95e4d9be7b1501eac4665748f7a4f879ecf641ab0902b0387
data/lib/s3rbsync.rb CHANGED
@@ -2,6 +2,7 @@ require "s3rbsync/version"
2
2
  require "s3rbsync/command"
3
3
  require "s3rbsync/configure"
4
4
  require "s3rbsync/synchronizer"
5
+ require "s3rbsync/region"
5
6
 
6
7
  module S3rbsync
7
8
  def self.cli_start
@@ -7,10 +7,15 @@ module S3rbsync
7
7
  desc 'init', "Set up S3rbsync. (ganerate configure)"
8
8
  def init
9
9
  if yes? "Do you wish to continue [yes(y) / no(n)] ?", :cyan
10
- access_key = ask("aws_access_key:")
11
- secret_key = ask("aws_secret_access_key:")
12
- region = ask("regin:")
13
- bucket_name = ask("bucket_name:")
10
+ say "-------- Input AWS kyes --------", :bold
11
+ access_key = ask("AWS ACCESS KEY:", :bold)
12
+ secret_key = ask("AWS SECRET ACCESS KEY:", :bold)
13
+ say "-------- Select region --------", :bold
14
+ print_table(print_region)
15
+ begin
16
+ region = ask("\nRegin:", :bold)
17
+ end until Region.names.include?(region)
18
+ bucket_name = ask("Bucket name:", :bold)
14
19
  create_file "~/.aws.yml" do
15
20
  <<-"YAML"
16
21
  :aws_access_key: #{access_key}
@@ -62,5 +67,15 @@ module S3rbsync
62
67
  say "\n...Done\n", :cyan
63
68
  end
64
69
 
70
+
71
+ private
72
+
73
+ def print_region
74
+ list = Region.printable_list
75
+ list.first.map!{|r| set_color(r, :cyan)}
76
+ list.last.map!{|d| set_color(d, :magenta)}
77
+ list
78
+ end
79
+
65
80
  end
66
81
  end
@@ -0,0 +1,12 @@
1
+ class Region
2
+
3
+ def self.printable_list
4
+ describes = ["Location Name:", "Virginia", "California", "Oregon", "Ireland", "Tokyo", "Singapore", "Sydney", "Sao Paulo"]
5
+ regions = self.names.unshift("Region Name:")
6
+ [regions, describes]
7
+ end
8
+
9
+ def self.names
10
+ ["us-east-1", "us-west-1", "us-west-2", "eu-west-1", "ap-northeast-1", "ap-southeast-1", "ap-southeast-2", "sa-east-1"]
11
+ end
12
+ end
@@ -1,7 +1,7 @@
1
1
  module S3rbsync
2
2
  MAJOR_VERSION = 0
3
3
  MINORE_VERSION = 7
4
- PATCH_VERSION = 0
4
+ PATCH_VERSION = 1
5
5
 
6
6
  VERSION = "#{MAJOR_VERSION}.#{MINORE_VERSION}.#{PATCH_VERSION}"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3rbsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naohiro Sakuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-02 00:00:00.000000000 Z
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -83,6 +83,7 @@ files:
83
83
  - lib/s3rbsync.rb
84
84
  - lib/s3rbsync/command.rb
85
85
  - lib/s3rbsync/configure.rb
86
+ - lib/s3rbsync/region.rb
86
87
  - lib/s3rbsync/synchronizer.rb
87
88
  - lib/s3rbsync/version.rb
88
89
  - s3rbsync.gemspec