shelly 0.0.2 → 0.0.3

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/README.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # shelly: Shelly Cloud command line tool
2
2
 
3
+ ## Installation
3
4
 
4
- ### Running tests
5
+ gem install shelly
6
+
7
+ ## Usage
8
+
9
+ Type shelly in terminal for usage info
10
+
11
+ shelly
12
+
13
+ ## Running tests
5
14
 
6
15
  rake spec
16
+
17
+ or
18
+
19
+ guard
data/lib/shelly/cli.rb CHANGED
@@ -23,7 +23,9 @@ module Shelly
23
23
  end
24
24
 
25
25
  user = User.new(email, password)
26
- say "Check you mailbox for email confirmation" if user.register
26
+ if user.register
27
+ say "Successfully registered!\nCheck you mailbox for email confirmation"
28
+ end
27
29
  rescue Client::APIError => e
28
30
  if e.message == "Validation Failed"
29
31
  e.errors.each { |error| say "#{error.first} #{error.last}" }
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -68,9 +68,9 @@ describe Shelly::CLI do
68
68
  end
69
69
 
70
70
  context "on successful registration" do
71
- it "should notify user about email verification" do
71
+ it "should display message about registration and email confirmation" do
72
72
  @client.stub(:register_user).and_return(true)
73
- $stdout.should_receive(:puts).with("Check you mailbox for email confirmation")
73
+ $stdout.should_receive(:puts).with("Successfully registered!\nCheck you mailbox for email confirmation")
74
74
  fake_stdin(["kate@example.com", "pass"]) do
75
75
  @cli.register
76
76
  end
@@ -78,7 +78,7 @@ describe Shelly::CLI do
78
78
  end
79
79
 
80
80
  context "on unsuccessful registration" do
81
- it "should notify user about errors" do
81
+ it "should display errors" do
82
82
  response = {"message" => "Validation Failed", "errors" => [["email", "has been already taken"]]}
83
83
  exception = Shelly::Client::APIError.new(response)
84
84
  @client.stub(:register_user).and_raise(exception)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelly
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Shelly Cloud team