shelly 0.4.12 → 0.4.13

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: 3db6979b83360ab5ec5289105c40db990afeb6ec
4
- data.tar.gz: a897299673d1c2e26a1702bd7b69a4ab3de9b694
3
+ metadata.gz: c215723a3d368ed383af7f81a602aba05b518686
4
+ data.tar.gz: babb10677df55d5e611317d74a6126afcb6cb63e
5
5
  SHA512:
6
- metadata.gz: 3ea8b51d8271633030d0647bcc6da3b96801506d82de8245a9ba082047185a6e6f9f3d7c7e43885e6ad8a41419f27131a8f4ae503bee67b87bc036a8975b96d0
7
- data.tar.gz: 5a018835c3e98760a88f0cec95658b6db742f38833e738db8d815efbd6f12226b1628c3bbf0879dd3830be9d74c0bf89d9272baa7fad5b89b77e0ed19787748e
6
+ metadata.gz: 4ddd0924ff53084715bca2e0d6bd86d978fe6a754ce101f3dc6e175abf7301169ab40a18e141eff8e5b8192550161687e9b4c92363ba2ba745ed01ed6061d76a
7
+ data.tar.gz: d2ea74d688c3a9d90f341a2488a758cee8155879d4997779f0cf68b6eb54f1da624c0cb730046a2c1d53316dd99ed2af85f5bd6858ed9826b1f35a3cc48bf693
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.4.13 / 2013-11-11
2
+
3
+ * [improvement] Don't upload SSH key on register,
4
+ it will be uploaded at login which is required anyway after register
5
+
6
+ * internal changes
7
+
1
8
  # 0.4.12 / 2013-11-05
2
9
 
3
10
  * [bugfix] Print user-friendly message if user tries to operate on files
@@ -41,19 +41,12 @@ module Shelly
41
41
 
42
42
  desc "register [EMAIL]", "Register new account"
43
43
  def register(email = nil)
44
- say "Your public SSH key will be uploaded to Shelly Cloud after registration."
45
44
  say "Registering with email: #{email}" if email
46
45
  user = Shelly::User.new
47
46
  email ||= ask_for_email
48
47
  password = ask_for_password
49
48
  ask_for_acceptance_of_terms
50
49
  user.register(email, password)
51
- if user.ssh_key_exists?
52
- say "Uploading your public SSH key from #{user.ssh_key_path}"
53
- else
54
- say_error "No such file or directory - #{user.ssh_key_path}", :with_exit => false
55
- say_error "Use ssh-keygen to generate ssh key pair, after that use: `shelly login`", :with_exit => false
56
- end
57
50
  say "Successfully registered!", :green
58
51
  say "Check you mailbox for email address confirmation", :green
59
52
  rescue Client::ValidationException => e
@@ -70,8 +63,7 @@ module Shelly
70
63
  password = ask_for_password(:with_confirmation => false)
71
64
  user.login(email, password)
72
65
  say "Login successful", :green
73
- user.upload_ssh_key
74
- say "Uploading your public SSH key"
66
+ upload_ssh_key
75
67
  list
76
68
  rescue Client::ValidationException => e
77
69
  e.each_error { |error| say_error "#{error}", :with_exit => false }
@@ -461,6 +453,19 @@ Wait until cloud is in 'turned off' state and try again.}
461
453
  say " git push #{remote} master"
462
454
  say_new_line
463
455
  end
456
+
457
+ def upload_ssh_key
458
+ user = Shelly::User.new
459
+ if user.ssh_key_exists?
460
+ say "Uploading your public SSH key from #{user.ssh_key_path}"
461
+ user.upload_ssh_key
462
+ else
463
+ say_error "No such file or directory - #{user.ssh_key_path}", :with_exit => false
464
+ say_error "Use ssh-keygen to generate ssh key pair, after that use: `shelly login`", :with_exit => false
465
+ end
466
+ rescue Client::ValidationException => e
467
+ e.each_error { |error| say_error error, :with_exit => false }
468
+ end
464
469
  end
465
470
  end
466
471
  end
@@ -1,5 +1,5 @@
1
1
  class Shelly::Client
2
- def register_user(email, password, ssh_key)
3
- post("/users", :user => {:email => email, :password => password, :ssh_key => ssh_key})
2
+ def register_user(email, password)
3
+ post("/users", :user => {:email => email, :password => password})
4
4
  end
5
5
  end
data/lib/shelly/user.rb CHANGED
@@ -19,8 +19,7 @@ module Shelly
19
19
  end
20
20
 
21
21
  def register(email, password)
22
- ssh_key = File.read(ssh_key_path) if ssh_key_exists?
23
- shelly.register_user(email, password, ssh_key)
22
+ shelly.register_user(email, password)
24
23
  end
25
24
 
26
25
  def authorize!
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.4.12"
2
+ VERSION = "0.4.13"
3
3
  end
@@ -77,16 +77,7 @@ describe Shelly::CLI::Main do
77
77
  FileUtils.mkdir_p("~/.ssh")
78
78
  File.open("~/.ssh/id_rsa.pub", "w") { |f| f << "ssh-key AAbbcc" }
79
79
  user.stub(:register).with("better@example.com", "secret") { true }
80
- end
81
-
82
- it "should register user without local SSH Key and show message to create SSH Key" do
83
- FileUtils.rm_rf(@key_path)
84
- File.exists?(@key_path).should be_false
85
- $stdout.should_receive(:puts).with(red "No such file or directory - #{@key_path}")
86
- $stdout.should_receive(:puts).with(red "Use ssh-keygen to generate ssh key pair, after that use: `shelly login`")
87
- fake_stdin(["better@example.com", "secret", "secret", "yes"]) do
88
- invoke(@main, :register)
89
- end
80
+ user.stub(:upload_ssh_key)
90
81
  end
91
82
 
92
83
  it "should ask for email, password and password confirmation" do
@@ -127,28 +118,6 @@ describe Shelly::CLI::Main do
127
118
  end
128
119
  end
129
120
 
130
- context "public SSH key exists" do
131
- it "should register with the public SSH key" do
132
- FileUtils.mkdir_p("~/.ssh")
133
- File.open(@key_path, "w") { |f| f << "key" }
134
- $stdout.should_receive(:puts).with("Uploading your public SSH key from #{@key_path}")
135
- fake_stdin(["better@example.com", "secret", "secret", "yes"]) do
136
- invoke(@main, :register)
137
- end
138
- end
139
- end
140
-
141
- context "public SSH key doesn't exist" do
142
- it "should register user without the public SSH key" do
143
- user.stub(:ssh_key_registered?)
144
- FileUtils.rm_rf(@key_path)
145
- $stdout.should_not_receive(:puts).with("Uploading your public SSH key from #{@key_path}")
146
- fake_stdin(["better@example.com", "secret", "secret", "yes"]) do
147
- invoke(@main, :register)
148
- end
149
- end
150
- end
151
-
152
121
  context "on successful registration" do
153
122
  it "should display message about registration and email address confirmation" do
154
123
  $stdout.should_receive(:puts).with(green "Successfully registered!")
@@ -219,7 +188,7 @@ describe Shelly::CLI::Main do
219
188
 
220
189
  it "should upload user's public SSH key" do
221
190
  user.should_receive(:upload_ssh_key)
222
- $stdout.should_receive(:puts).with("Uploading your public SSH key")
191
+ $stdout.should_receive(:puts).with("Uploading your public SSH key from #{@key_path}")
223
192
  fake_stdin(["megan@example.com", "secret"]) do
224
193
  invoke(@main, :login)
225
194
  end
@@ -88,8 +88,8 @@ describe Shelly::Client do
88
88
  describe "#register_user" do
89
89
  it "should send post request with login and password" do
90
90
  @client.should_receive(:post).with("/users", {:user => {:email => "test@example.com",
91
- :password => "secret", :ssh_key => "ssh-key Abb"}})
92
- @client.register_user("test@example.com", "secret", "ssh-key Abb")
91
+ :password => "secret"}})
92
+ @client.register_user("test@example.com", "secret")
93
93
  end
94
94
  end
95
95
 
@@ -28,18 +28,9 @@ describe Shelly::User do
28
28
  end
29
29
 
30
30
  it "should register user at Shelly Cloud" do
31
- @client.should_receive(:register_user).with(email, password, "dsa-key AAbbcc")
31
+ @client.should_receive(:register_user).with(email, password)
32
32
  @user.register(email, password)
33
33
  end
34
-
35
- context "when ssh key is not available" do
36
- it "should register without it" do
37
- FileUtils.rm_rf("~/.ssh/id_rsa.pub")
38
- FileUtils.rm_rf("~/.ssh/id_dsa.pub")
39
- @client.should_receive(:register_user).with(email, password, nil)
40
- @user.register(email, password)
41
- end
42
- end
43
34
  end
44
35
 
45
36
  describe "#delete_credentials" 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.4.12
4
+ version: 0.4.13
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-05 00:00:00.000000000 Z
11
+ date: 2013-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: ruby_gntp
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rb-fsevent
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: fakefs
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -288,8 +316,32 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
316
  version: '0'
289
317
  requirements: []
290
318
  rubyforge_project: shelly
291
- rubygems_version: 2.1.10
319
+ rubygems_version: 2.0.3
292
320
  signing_key:
293
321
  specification_version: 4
294
322
  summary: Shelly Cloud command line tool
295
- test_files: []
323
+ test_files:
324
+ - spec/helpers.rb
325
+ - spec/input_faker.rb
326
+ - spec/shelly/app_spec.rb
327
+ - spec/shelly/backup_spec.rb
328
+ - spec/shelly/cli/backup_spec.rb
329
+ - spec/shelly/cli/cert_spec.rb
330
+ - spec/shelly/cli/config_spec.rb
331
+ - spec/shelly/cli/database_spec.rb
332
+ - spec/shelly/cli/deploy_spec.rb
333
+ - spec/shelly/cli/file_spec.rb
334
+ - spec/shelly/cli/logs_spec.rb
335
+ - spec/shelly/cli/main_spec.rb
336
+ - spec/shelly/cli/organization_spec.rb
337
+ - spec/shelly/cli/runner_spec.rb
338
+ - spec/shelly/cli/user_spec.rb
339
+ - spec/shelly/client_spec.rb
340
+ - spec/shelly/cloudfile_spec.rb
341
+ - spec/shelly/download_progress_bar_spec.rb
342
+ - spec/shelly/model_spec.rb
343
+ - spec/shelly/organization_spec.rb
344
+ - spec/shelly/structure_validator_spec.rb
345
+ - spec/shelly/user_spec.rb
346
+ - spec/spec_helper.rb
347
+ - spec/thor/options_spec.rb