shelly 0.5.3 → 0.5.4

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: b8ceb2fd1ee786894862ba5705645a85570e3cd2
4
- data.tar.gz: 09486cb2b72d9926e1e9788f6aa47adbadc13fea
3
+ metadata.gz: fa55d8fb185ab635a3242a8728cf151b252f04ba
4
+ data.tar.gz: e2cb634ae3e3bd10913044564c6d74734876f39a
5
5
  SHA512:
6
- metadata.gz: 88c7950e4fa032ecbdadd102520fd5d824e16980dda250aa270e449671840fbefa1f72aa836621151c83a78f1eb4c97d2306dd626ab1b1b1a4b13915c2bd3c1a
7
- data.tar.gz: b34402a098cb424aea9e1f843a31f411c499656e2caaf8b8cfc52ca913514129a73682e0d175e591b2cbb20c58f0c511df3540b3eee83ad2eadec61527e86b6d
6
+ metadata.gz: dcd8b23f3f24a86d7a0b981dde92d7cdc199720de9a5aadef94006feac6b8bc6ad12f2796cf738c09d3fa6abcf3dd324a1f553e0a0f5cdf875e37e4caecbeca9
7
+ data.tar.gz: e0f9432da5457a0414550f54f12fc7c7e937cebcbd576622ce5d3099832394aa2166b378b6b3fe3fc64ce88e66b2826fffbc48899efdfc2ea0e7e7bb915877b6
@@ -1,3 +1,10 @@
1
+ ## 0.5.4 / 2015-02-19
2
+
3
+ * [improvement] Print organization / region list only one time on creating new
4
+ cloud
5
+ * [bugfix] Added information about default region while creating new cloud
6
+ * [bugfix] Use unordered list in choosing organization and region
7
+
1
8
  ## 0.5.3 / 2015-02-15
2
9
 
3
10
  * [bugfix] Don't ask user about assigning new ip address on creating new
@@ -190,7 +190,7 @@ module Shelly
190
190
  cli.options = {:cloud => app}
191
191
  cli.list
192
192
  say_new_line
193
- question = unless sni.nil?
193
+ question = if sni
194
194
  "You already have assigned endpoint(s). Are you sure you" \
195
195
  " want to create another one with SNI? (yes/no):"
196
196
  else
@@ -480,44 +480,6 @@ Wait until cloud is in 'turned off' state and try again.}
480
480
  end
481
481
  end
482
482
 
483
- def ask_for_code_name
484
- default_code_name = default_name_from_dir_name
485
- code_name = ask("Cloud code name (#{default_code_name} - default):")
486
- code_name.blank? ? default_code_name : code_name
487
- end
488
-
489
- def ask_for_databases
490
- kinds = Shelly::App::DATABASE_CHOICES
491
- databases = ask("Which databases do you want to use " \
492
- "#{kinds.join(", ")} (postgresql - default):")
493
- begin
494
- databases = databases.split(/[\s,]/).reject(&:blank?)
495
- valid = valid_databases?(databases)
496
- break if valid
497
- databases = ask("Unknown database kind. Supported are: #{kinds.join(", ")}:")
498
- end while not valid
499
-
500
- databases.empty? ? ["postgresql"] : databases
501
- end
502
-
503
- def info_adding_cloudfile_to_repository
504
- say_new_line
505
- say "Project is now configured for use with Shelly Cloud:", :green
506
- say "You can review changes using", :green
507
- say " git status"
508
- end
509
-
510
- def info_deploying_to_shellycloud(remote = 'shelly')
511
- say_new_line
512
- say "When you make sure all settings are correct, add changes to your repository:", :green
513
- say " git add ."
514
- say ' git commit -m "Application added to Shelly Cloud"'
515
- say_new_line
516
- say "Deploy to your cloud using:", :green
517
- say " git push #{remote} master"
518
- say_new_line
519
- end
520
-
521
483
  def upload_ssh_key(given_key_path = nil)
522
484
  user = Shelly::User.new
523
485
  ssh_key = given_key_path ? Shelly::SshKey.new(given_key_path) : user.ssh_key
@@ -79,6 +79,44 @@ module Shelly
79
79
  end
80
80
 
81
81
  no_tasks do
82
+ def ask_for_code_name
83
+ default_code_name = default_name_from_dir_name
84
+ code_name = ask("Cloud code name (#{default_code_name} - default):")
85
+ code_name.blank? ? default_code_name : code_name
86
+ end
87
+
88
+ def ask_for_databases
89
+ kinds = Shelly::App::DATABASE_CHOICES
90
+ databases = ask("Which databases do you want to use " \
91
+ "#{kinds.join(", ")} (postgresql - default):")
92
+ begin
93
+ databases = databases.split(/[\s,]/).reject(&:blank?)
94
+ valid = valid_databases?(databases)
95
+ break if valid
96
+ databases = ask("Unknown database kind. Supported are: #{kinds.join(", ")}:")
97
+ end while not valid
98
+
99
+ databases.empty? ? ["postgresql"] : databases
100
+ end
101
+
102
+ def info_adding_cloudfile_to_repository
103
+ say_new_line
104
+ say "Project is now configured for use with Shelly Cloud:", :green
105
+ say "You can review changes using", :green
106
+ say " git status"
107
+ end
108
+
109
+ def info_deploying_to_shellycloud(remote = 'shelly')
110
+ say_new_line
111
+ say "When you make sure all settings are correct, add changes to your repository:", :green
112
+ say " git add ."
113
+ say ' git commit -m "Application added to Shelly Cloud"'
114
+ say_new_line
115
+ say "Deploy to your cloud using:", :green
116
+ say " git push #{remote} master"
117
+ say_new_line
118
+ end
119
+
82
120
  def ask_for_organization(options)
83
121
  organizations = Shelly::User.new.organizations
84
122
 
@@ -88,16 +126,14 @@ module Shelly
88
126
  say "Select organization for this cloud:"
89
127
  say_new_line
90
128
 
91
- loop do
92
- say "existing organizations:"
93
-
94
- organizations.each_with_index do |organization, i|
95
- print_wrapped "#{i + 1}) #{organization.name}", :ident => 2
96
- end
129
+ organizations.each do |organization|
130
+ print_wrapped "\u2219 #{organization.name}", :ident => 2
131
+ end
97
132
 
98
- say green "Or leave empty to create a new organization"
99
- say_new_line
133
+ say green "Or leave empty to create a new organization"
134
+ say_new_line
100
135
 
136
+ loop do
101
137
  selected = ask("Organization:")
102
138
  if organizations.select { |o| o.name == selected }.present?
103
139
  return selected
@@ -105,8 +141,8 @@ module Shelly
105
141
  say_new_line
106
142
  return ask_for_new_organization(options)
107
143
  else
108
- say_new_line
109
144
  say_warning "#{selected} organization does not exist"
145
+ say_new_line
110
146
  end
111
147
  end
112
148
  end
@@ -124,23 +160,25 @@ module Shelly
124
160
 
125
161
  def ask_for_region
126
162
  regions = Shelly::App::REGIONS
127
- say "Select region for this cloud:"
128
163
  say_new_line
129
164
 
130
- loop do
131
- say "available regions:"
165
+ say "Select region for this cloud:"
166
+ say_new_line
132
167
 
133
- regions.each_with_index do |region, i|
134
- print_wrapped "#{i + 1}) #{region}", :ident => 2
135
- end
136
- say_new_line
168
+ regions.each do |region|
169
+ print_wrapped "\u2219 #{region}", :ident => 2
170
+ end
171
+ say_new_line
137
172
 
138
- selected = ask("Region:").upcase
173
+ loop do
174
+ selected = ask("Region (EU - default):").upcase
139
175
  if regions.include?(selected)
140
176
  return selected
177
+ elsif selected.empty?
178
+ return "EU"
141
179
  else
142
- say_new_line
143
180
  say_warning "#{selected} region is not available"
181
+ say_new_line
144
182
  end
145
183
  end
146
184
  end
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
@@ -640,11 +640,10 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
640
640
 
641
641
  it "should ask user to choose organization" do
642
642
  $stdout.should_receive(:puts).
643
- with("Select organization for this cloud:")
644
- $stdout.should_receive(:puts).with("existing organizations:")
645
- $stdout.should_receive(:puts).with(" 1) aaa")
643
+ with("Select organization for this cloud:")
644
+ $stdout.should_receive(:puts).with(" \u2219 aaa")
646
645
  $stdout.should_receive(:puts).
647
- with(green "Or leave empty to create a new organization")
646
+ with(green "Or leave empty to create a new organization")
648
647
  $stdout.should_receive(:print).with("Organization: ")
649
648
  fake_stdin(["foo", "none", "aaa"]) do
650
649
  invoke(@main, :add)
@@ -732,10 +731,9 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
732
731
  it "should ask user to choose the region" do
733
732
  @app.should_receive(:region=).with("NA")
734
733
  $stdout.should_receive(:puts).with("Select region for this cloud:")
735
- $stdout.should_receive(:puts).with("available regions:")
736
- $stdout.should_receive(:puts).with(" 1) EU")
737
- $stdout.should_receive(:puts).with(" 2) NA")
738
- $stdout.should_receive(:print).with("Region: ")
734
+ $stdout.should_receive(:puts).with(" \u2219 EU")
735
+ $stdout.should_receive(:puts).with(" \u2219 NA")
736
+ $stdout.should_receive(:print).with("Region (EU - default): ")
739
737
  fake_stdin(["foo", "none", "NA"]) do
740
738
  invoke(@main, :add)
741
739
  end
@@ -745,11 +743,21 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
745
743
  it "should print a warning message and ask again" do
746
744
  $stdout.should_receive(:puts).
747
745
  with(yellow "ASIA region is not available")
748
- $stdout.should_receive(:puts).with("available regions:").twice
746
+ @app.should_not_receive(:region=).with("ASIA")
747
+ @app.should_receive(:region=).with("NA")
749
748
  fake_stdin(["foo", "none", "ASIA", "NA"]) do
750
749
  invoke(@main, :add)
751
750
  end
752
751
  end
752
+
753
+ context "and empty string was on the input" do
754
+ it "should assign EU region by default" do
755
+ @app.should_receive(:region=).with("EU")
756
+ fake_stdin(["foo", "none", ""]) do
757
+ invoke(@main, :add)
758
+ end
759
+ end
760
+ end
753
761
  end
754
762
 
755
763
  context "when given region does not accepts new apps" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shelly Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-15 00:00:00.000000000 Z
11
+ date: 2015-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
359
359
  version: '0'
360
360
  requirements: []
361
361
  rubyforge_project: shelly
362
- rubygems_version: 2.4.5
362
+ rubygems_version: 2.4.6
363
363
  signing_key:
364
364
  specification_version: 4
365
365
  summary: Shelly Cloud command line tool