shelly 0.4.24 → 0.4.25
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/shelly/cli/backup.rb +2 -1
- data/lib/shelly/cli/config.rb +2 -1
- data/lib/shelly/cli/main.rb +1 -1
- data/lib/shelly/cli/organization.rb +3 -1
- data/lib/shelly/cli/user.rb +3 -1
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/cli/backup_spec.rb +11 -0
- data/spec/shelly/cli/config_spec.rb +12 -2
- data/spec/shelly/cli/main_spec.rb +1 -1
- data/spec/shelly/cli/organization_spec.rb +15 -0
- data/spec/shelly/cli/user_spec.rb +15 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 106d6edae76cb35406b5e329777d79c62ac57468
|
4
|
+
data.tar.gz: 648eee3408d79455c04569aa36bb92c4b30fa93e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72777b59e6efcb2da05aa3289eb652c62042033939dc05b650b9510dfbc92ae544be875816e7bfb146f312f4adbd7a72da5663fbf52b6fb8980fa25760384942
|
7
|
+
data.tar.gz: b4d08dd51e6bf5ed91c325aaa6c9e355ff8f326043eacfbf15c61256ac93f7885cb9dabe0ce2c075341a10ad6686daa200799cde1b201d6841b0a3bd9ab23fdb
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 0.4.25 / 2014-02-28
|
2
|
+
|
3
|
+
* [bugfix] Print user-friendly message if user tries to open console on non
|
4
|
+
application virtual server
|
5
|
+
* [improvement] Add `add` alias for `shelly config create`
|
6
|
+
* [improvement] Add `new` and `create` aliases for `shelly user add`
|
7
|
+
* [improvement] Add `new` alias for `shelly backup create`
|
8
|
+
* [improvement] Add `new` and `create` aliases for `shelly organization add`
|
9
|
+
|
1
10
|
## 0.4.24 / 2014-02-25
|
2
11
|
|
3
12
|
* [improvement] Show recent information about filesystem, database and traffic
|
data/lib/shelly/cli/backup.rb
CHANGED
@@ -9,7 +9,7 @@ module Shelly
|
|
9
9
|
namespace :backup
|
10
10
|
include Helpers
|
11
11
|
|
12
|
-
before_hook :logged_in?, :only => [:list, :get, :create, :restore, :import]
|
12
|
+
before_hook :logged_in?, :only => [:list, :get, :create, :new, :restore, :import]
|
13
13
|
|
14
14
|
class_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
|
15
15
|
|
@@ -64,6 +64,7 @@ module Shelly
|
|
64
64
|
Create backup of given database.
|
65
65
|
If database kind is not specified, Cloudfile must be present to backup all configured databases.
|
66
66
|
}
|
67
|
+
map "new" => :create
|
67
68
|
def create(kind = nil)
|
68
69
|
app = multiple_clouds(options[:cloud], "backup create [DB_KIND]")
|
69
70
|
cloudfile = Cloudfile.new
|
data/lib/shelly/cli/config.rb
CHANGED
@@ -6,7 +6,7 @@ module Shelly
|
|
6
6
|
namespace :config
|
7
7
|
include Helpers
|
8
8
|
|
9
|
-
before_hook :logged_in?, :only => [:list, :show, :create, :new, :edit,
|
9
|
+
before_hook :logged_in?, :only => [:list, :show, :create, :new, :add, :edit,
|
10
10
|
:update, :upload, :delete]
|
11
11
|
class_option :cloud, :type => :string, :aliases => "-c",
|
12
12
|
:desc => "Specify cloud"
|
@@ -46,6 +46,7 @@ module Shelly
|
|
46
46
|
say_error "You can list available config files with `shelly config list --cloud #{app}`"
|
47
47
|
end
|
48
48
|
|
49
|
+
map "add" => :create
|
49
50
|
map "new" => :create
|
50
51
|
desc "create PATH", "Create configuration file"
|
51
52
|
def create(path)
|
data/lib/shelly/cli/main.rb
CHANGED
@@ -360,7 +360,7 @@ Wait until cloud is in 'turned off' state and try again.}
|
|
360
360
|
say_error "Cloud #{app} is not running. Cannot run console."
|
361
361
|
rescue Client::NotFoundException => e
|
362
362
|
raise unless e.resource == :virtual_server
|
363
|
-
say_error "Virtual
|
363
|
+
say_error "Virtual server '#{options[:server]}' not found or not configured for running console"
|
364
364
|
end
|
365
365
|
|
366
366
|
# FIXME: move to helpers
|
@@ -6,7 +6,7 @@ module Shelly
|
|
6
6
|
namespace :organization
|
7
7
|
include Helpers
|
8
8
|
|
9
|
-
before_hook :logged_in?, :only => [:list, :add]
|
9
|
+
before_hook :logged_in?, :only => [:list, :add, :create, :new]
|
10
10
|
|
11
11
|
desc "list", "Lists organizations"
|
12
12
|
def list
|
@@ -27,6 +27,8 @@ module Shelly
|
|
27
27
|
method_option "redeem-code", :type => :string, :aliases => "-r",
|
28
28
|
:desc => "Redeem code for free credits"
|
29
29
|
desc "add", "Add a new organization"
|
30
|
+
map "create" => :add
|
31
|
+
map "new" => :add
|
30
32
|
def add
|
31
33
|
create_new_organization(options)
|
32
34
|
rescue Client::ValidationException => e
|
data/lib/shelly/cli/user.rb
CHANGED
@@ -8,7 +8,7 @@ module Shelly
|
|
8
8
|
namespace :user
|
9
9
|
include Helpers
|
10
10
|
|
11
|
-
before_hook :logged_in?, :only => [:list, :add, :delete]
|
11
|
+
before_hook :logged_in?, :only => [:list, :add, :new, :create, :delete]
|
12
12
|
|
13
13
|
method_option :organization, :type => :string, :aliases => "-o", :desc => "Specify organization"
|
14
14
|
desc "list", "List users with access to organizations"
|
@@ -38,6 +38,8 @@ module Shelly
|
|
38
38
|
|
39
39
|
method_option :organization, :type => :string, :aliases => "-o", :desc => "Specify organization"
|
40
40
|
desc "add [EMAIL]", "Add new developer to organization"
|
41
|
+
map "new" => :add
|
42
|
+
map "create" => :add
|
41
43
|
def add(email = nil)
|
42
44
|
organization = organization_present?(options[:organization], "user add [EMAIL]")
|
43
45
|
|
data/lib/shelly/version.rb
CHANGED
@@ -158,6 +158,17 @@ describe Shelly::CLI::Backup do
|
|
158
158
|
hooks(@backup, :create).should include(:logged_in?)
|
159
159
|
end
|
160
160
|
|
161
|
+
context "for aliases" do
|
162
|
+
it "should respond to 'new' alias" do
|
163
|
+
@app.should_receive(:request_backup)
|
164
|
+
invoke(@backup, :new)
|
165
|
+
end
|
166
|
+
|
167
|
+
it "should ensure user has logged in for 'new' alias" do
|
168
|
+
hooks(@backup, :new).should include(:logged_in?)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
161
172
|
# multiple_clouds is tested in main_spec.rb in describe "#start" block
|
162
173
|
it "should ensure multiple_clouds check" do
|
163
174
|
@app.stub(:request_backup)
|
@@ -90,8 +90,18 @@ describe Shelly::CLI::Config do
|
|
90
90
|
hooks(@config, :create).should include(:logged_in?)
|
91
91
|
end
|
92
92
|
|
93
|
-
|
94
|
-
|
93
|
+
context "for aliases" do
|
94
|
+
[:add, :new].each do |a|
|
95
|
+
it "should respond to '#{a}' alias" do
|
96
|
+
@config.should_receive(:system).and_return(true)
|
97
|
+
@client.should_receive(:app_create_config)
|
98
|
+
invoke(@config, a, "path")
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should ensure user has logged in for #{a}" do
|
102
|
+
hooks(@config, a).should include(:logged_in?)
|
103
|
+
end
|
104
|
+
end
|
95
105
|
end
|
96
106
|
|
97
107
|
# multiple_clouds is tested in main_spec.rb in describe "#start" block
|
@@ -1543,7 +1543,7 @@ Wait until cloud is in 'turned off' state and try again.")
|
|
1543
1543
|
ex = Shelly::Client::NotFoundException.new("resource" => "virtual_server")
|
1544
1544
|
@client.stub(:tunnel).and_raise(ex)
|
1545
1545
|
@main.options = {:server => "foobar"}
|
1546
|
-
$stdout.should_receive(:puts).with(red "Virtual
|
1546
|
+
$stdout.should_receive(:puts).with(red "Virtual server 'foobar' not found or not configured for running console")
|
1547
1547
|
lambda {
|
1548
1548
|
invoke(@main, :console)
|
1549
1549
|
}.should raise_error(SystemExit)
|
@@ -53,6 +53,21 @@ describe Shelly::CLI::Organization do
|
|
53
53
|
hooks(@cli, :add).should include(:logged_in?)
|
54
54
|
end
|
55
55
|
|
56
|
+
context "for aliases" do
|
57
|
+
[:new, :create].each do |a|
|
58
|
+
it "should respond to '#{a}' alias" do
|
59
|
+
@organization.should_receive(:create)
|
60
|
+
fake_stdin("org-name") do
|
61
|
+
invoke(@cli, a)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should ensure user has logged in for '#{a}' alias" do
|
66
|
+
hooks(@cli, a).should include(:logged_in?)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
56
71
|
it "should create new organization" do
|
57
72
|
@organization.should_receive(:create)
|
58
73
|
$stdout.should_receive(:print).with("Organization name (foo - default): ")
|
@@ -117,6 +117,21 @@ describe Shelly::CLI::User do
|
|
117
117
|
hooks(@cli_user, :add).should include(:logged_in?)
|
118
118
|
end
|
119
119
|
|
120
|
+
context "for aliases" do
|
121
|
+
[:new, :create].each do |a|
|
122
|
+
it "should respond to '#{a}' alias" do
|
123
|
+
@client.should_receive(:send_invitation)
|
124
|
+
fake_stdin(["yes"]) do
|
125
|
+
invoke(@cli_user, a, "megan@example.com")
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
it "should ensure user has logged in for '#{a}' alias" do
|
130
|
+
hooks(@cli_user, a).should include(:logged_in?)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
120
135
|
context "on success" do
|
121
136
|
before do
|
122
137
|
@client.should_receive(:send_invitation).with("foo-org", "megan@example.com", true)
|
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.
|
4
|
+
version: 0.4.25
|
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: 2014-02-
|
11
|
+
date: 2014-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -320,7 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
320
320
|
version: '0'
|
321
321
|
requirements: []
|
322
322
|
rubyforge_project: shelly
|
323
|
-
rubygems_version: 2.2.
|
323
|
+
rubygems_version: 2.2.1
|
324
324
|
signing_key:
|
325
325
|
specification_version: 4
|
326
326
|
summary: Shelly Cloud command line tool
|