shelly 0.4.13 → 0.4.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c215723a3d368ed383af7f81a602aba05b518686
4
- data.tar.gz: babb10677df55d5e611317d74a6126afcb6cb63e
3
+ metadata.gz: 59753e3f10e5571d9494a1a84d80513db2fc6ec9
4
+ data.tar.gz: 4f1839417e9f9f8856d202ef36c080fc8a3819c3
5
5
  SHA512:
6
- metadata.gz: 4ddd0924ff53084715bca2e0d6bd86d978fe6a754ce101f3dc6e175abf7301169ab40a18e141eff8e5b8192550161687e9b4c92363ba2ba745ed01ed6061d76a
7
- data.tar.gz: d2ea74d688c3a9d90f341a2488a758cee8155879d4997779f0cf68b6eb54f1da624c0cb730046a2c1d53316dd99ed2af85f5bd6858ed9826b1f35a3cc48bf693
6
+ metadata.gz: a143ea1a6ae2d901046b5a2fccadb93d55cb61bd23057ff215ebae481e8d930cb95117b32470ecc97e9dea74c786f679363c0efa4bcccaf5eeb5f90efdea3a89
7
+ data.tar.gz: 60594ff58f3263574def896e4e9946d4e0c79a83c13a5e8f282f2f84318c46b138dcd60465be9df9b0023b2bb86db207bc2cb497adf63d4a280bd012c85e27df
data/CHANGELOG.md CHANGED
@@ -1,20 +1,28 @@
1
- # 0.4.13 / 2013-11-11
1
+ ## 0.4.14 / 2013-11-19
2
+
3
+ * [bugfix] Show proper error message when login failed
4
+ * [bugfix] `shelly backups create` without specified database kind should
5
+ backup all possible databases, read from Cloudfile
6
+ * [bugfix] Deleting SSH key works even after changing user email at the end
7
+ of it
8
+
9
+ ## 0.4.13 / 2013-11-11
2
10
 
3
11
  * [improvement] Don't upload SSH key on register,
4
12
  it will be uploaded at login which is required anyway after register
5
13
 
6
14
  * internal changes
7
15
 
8
- # 0.4.12 / 2013-11-05
16
+ ## 0.4.12 / 2013-11-05
9
17
 
10
18
  * [bugfix] Print user-friendly message if user tries to operate on files
11
19
  on cloud which is not deployed.
12
20
 
13
- # 0.4.11 / 2013-10-30
21
+ ## 0.4.11 / 2013-10-30
14
22
 
15
23
  * internal changes
16
24
 
17
- # 0.4.10 / 2013-10-30
25
+ ## 0.4.10 / 2013-10-30
18
26
 
19
27
  * [bugfix] Certificates CLI were not Ruby 1.8 compatible
20
28
  * [bugfix] Travis was failing due to Ruby 1.8 gems incompatibility: guard, mime-types v2.x
data/lib/shelly/app.rb CHANGED
@@ -9,12 +9,11 @@ module Shelly
9
9
  SERVER_SIZES = %w(small large)
10
10
 
11
11
  attr_accessor :code_name, :databases, :ruby_version, :environment,
12
- :git_url, :domains, :web_server_ip, :size, :thin, :content,
12
+ :git_url, :domains, :web_server_ip, :size, :thin,
13
13
  :organization_name, :zone_name
14
14
 
15
- def initialize(code_name = nil, content = nil)
15
+ def initialize(code_name = nil)
16
16
  self.code_name = code_name
17
- self.content = content
18
17
  end
19
18
 
20
19
  def self.from_attributes(attributes)
@@ -327,6 +326,10 @@ module Shelly
327
326
  system "ssh #{ssh_options(conn)} -N -L #{local_port}:localhost:#{conn['service']['port']} #{conn['host']}"
328
327
  end
329
328
 
329
+ def content
330
+ @content ||= Cloudfile.new.content[code_name]
331
+ end
332
+
330
333
  # Public: Return databases for given Cloud in Cloudfile
331
334
  # Returns Array of databases
332
335
  def cloud_databases
@@ -68,9 +68,12 @@ module Shelly
68
68
  rescue Client::ValidationException => e
69
69
  e.each_error { |error| say_error "#{error}", :with_exit => false }
70
70
  rescue Client::UnauthorizedException => e
71
- say_error "Wrong email or password", :with_exit => false
72
- say_error "You can reset password by using link:", :with_exit => false
73
- say_error e[:url]
71
+ say_error e[:error], :with_exit => false
72
+ if e[:url]
73
+ say_error "You can reset password by using link:", :with_exit => false
74
+ say_error e[:url]
75
+ end
76
+ exit 1
74
77
  rescue Errno::ENOENT => e
75
78
  say_error e, :with_exit => false
76
79
  say_error "Use ssh-keygen to generate ssh key pair"
@@ -17,7 +17,7 @@ module Shelly
17
17
  # nil if there is no cloudfile
18
18
  def clouds
19
19
  content.keys.sort.map do |code_name|
20
- Shelly::App.new(code_name, content[code_name.to_s])
20
+ Shelly::App.new(code_name)
21
21
  end if content
22
22
  end
23
23
 
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.4.13"
2
+ VERSION = "0.4.14"
3
3
  end
@@ -218,7 +218,8 @@ describe Shelly::CLI::Main do
218
218
 
219
219
  context "on unauthorized user" do
220
220
  it "should exit with 1 and display error message" do
221
- response = {"message" => "Unauthorized", "url" => "https://admin.winniecloud.com/users/password/new"}
221
+ response = {"message" => "Unauthorized", "error" => "Wrong email or password",
222
+ "url" => "https://admin.winniecloud.com/users/password/new"}
222
223
  exception = Shelly::Client::UnauthorizedException.new(response)
223
224
  @client.stub(:authorize_with_email_and_password).and_raise(exception)
224
225
  $stdout.should_receive(:puts).with("\e[31mWrong email or password\e[0m")
@@ -231,6 +232,21 @@ describe Shelly::CLI::Main do
231
232
  }.should raise_error(SystemExit)
232
233
  end
233
234
  end
235
+
236
+ context "on unconfirmed user" do
237
+ it "should exit with 1 and display error message" do
238
+ response = {"message" => "Unauthorized",
239
+ "error" => "Unconfirmed account"}
240
+ exception = Shelly::Client::UnauthorizedException.new(response)
241
+ @client.stub(:authorize_with_email_and_password).and_raise(exception)
242
+ $stdout.should_receive(:puts).with(red "Unconfirmed account")
243
+ lambda {
244
+ fake_stdin(["megan@example.com", "secret"]) do
245
+ invoke(@main, :login)
246
+ end
247
+ }.should raise_error(SystemExit)
248
+ end
249
+ end
234
250
  end
235
251
 
236
252
  describe "#add" do
@@ -82,12 +82,8 @@ foo-production:
82
82
  thin: 2
83
83
  config
84
84
  File.open("/projects/foo/Cloudfile", "w") { |f| f << content }
85
- cloud1 = Shelly::App.should_receive(:new).with("foo-staging",
86
- {"ruby_version"=>"1.9.3",
87
- "servers"=>{"app1"=>{"size"=>"small"}}})
88
- cloud2 = Shelly::App.should_receive(:new).with("foo-production",
89
- {"environment"=>"production",
90
- "servers"=>{"app1"=>{"thin"=>2}}})
85
+ cloud1 = Shelly::App.should_receive(:new).with("foo-staging")
86
+ cloud2 = Shelly::App.should_receive(:new).with("foo-production")
91
87
 
92
88
  @cloudfile.clouds
93
89
  end
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.4.13
4
+ version: 0.4.14
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: 2013-11-11 00:00:00.000000000 Z
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec