shelly 0.4.33 → 0.4.34
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 +5 -0
- data/lib/shelly/cli/command.rb +2 -0
- data/lib/shelly/cli/errors.rb +5 -0
- data/lib/shelly/cli/main/add.rb +1 -1
- data/lib/shelly/cli/runner.rb +3 -0
- data/lib/shelly/helpers.rb +4 -0
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/cli/command_spec.rb +17 -0
- data/spec/shelly/cli/main_spec.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fab8b51230c1e3e5b342a51d6ee7a9522251847c
|
4
|
+
data.tar.gz: 8d4b291e20ba8c53d84174d2b467f5fc3b836551
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dac3895b45d4f34274b602a51b643dcad43311d51c0e7a5a72bc7677239eedb1d154cbd8b5f67f22f246d6b48ba5b23d9c5706a18aa45ba12de55093f2a87b7
|
7
|
+
data.tar.gz: 95b501aafadc2e1935c0a44354ef64d48bf24681933540676a854d75960d181cc255a0af5dbcd788dd30fea927620c62d5037a9cf7952ebf03a18f5add13035c
|
data/CHANGELOG.md
CHANGED
data/lib/shelly/cli/command.rb
CHANGED
@@ -5,6 +5,7 @@ require "thor/group"
|
|
5
5
|
require "thor/options"
|
6
6
|
require "thor/arguments"
|
7
7
|
require "thor/basic"
|
8
|
+
require "shelly/cli/errors"
|
8
9
|
|
9
10
|
module Shelly
|
10
11
|
module CLI
|
@@ -15,6 +16,7 @@ module Shelly
|
|
15
16
|
|
16
17
|
def initialize(*)
|
17
18
|
super
|
19
|
+
check_for_home
|
18
20
|
if options[:help]
|
19
21
|
help(self.class.send(:retrieve_task_name, ARGV.dup))
|
20
22
|
exit(0)
|
data/lib/shelly/cli/main/add.rb
CHANGED
@@ -26,7 +26,7 @@ module Shelly
|
|
26
26
|
app = Shelly::App.new
|
27
27
|
app.code_name = options["code-name"] || ask_for_code_name
|
28
28
|
app.databases = options["databases"] || ask_for_databases
|
29
|
-
app.size = options["size"] || "
|
29
|
+
app.size = options["size"] || "small"
|
30
30
|
app.organization_name = options["organization"] || ask_for_organization(options)
|
31
31
|
app.zone_name = options["zone"]
|
32
32
|
|
data/lib/shelly/cli/runner.rb
CHANGED
@@ -42,6 +42,9 @@ module Shelly
|
|
42
42
|
rescue Netrc::Error => e
|
43
43
|
raise if debug?
|
44
44
|
say_error e.message
|
45
|
+
rescue HomeNotSetError
|
46
|
+
raise if debug?
|
47
|
+
say_error "Please set HOME environment variable."
|
45
48
|
rescue Client::APIException => e
|
46
49
|
raise if debug?
|
47
50
|
say_error "You have found a bug in the shelly gem. We're sorry.",
|
data/lib/shelly/helpers.rb
CHANGED
@@ -210,5 +210,9 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository}
|
|
210
210
|
say_warning "https://shellycloud.com/documentation/faq#windows"
|
211
211
|
say_new_line
|
212
212
|
end
|
213
|
+
|
214
|
+
def check_for_home
|
215
|
+
raise Shelly::CLI::HomeNotSetError if ENV['HOME'].nil? || ENV['HOME'].empty?
|
216
|
+
end
|
213
217
|
end
|
214
218
|
end
|
data/lib/shelly/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "shelly/cli/command"
|
3
|
+
|
4
|
+
describe Shelly::CLI::Command do
|
5
|
+
before { @command = Shelly::CLI::Command.new }
|
6
|
+
|
7
|
+
context "when ENV['HOME'] is not set" do
|
8
|
+
|
9
|
+
it 'should raise HomeNotSetError' do
|
10
|
+
ENV.stub(:[]).with('HOME').and_return('')
|
11
|
+
lambda {
|
12
|
+
invoke(@command)
|
13
|
+
}.should raise_error(Shelly::CLI::HomeNotSetError)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -475,7 +475,7 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
|
|
475
475
|
@app.should_receive(:create).and_raise(exception)
|
476
476
|
$stdout.should_receive(:puts).with(red "Code name has been already taken")
|
477
477
|
$stdout.should_receive(:puts).with(red "Fix erros in the below command and type it again to create your cloud")
|
478
|
-
$stdout.should_receive(:puts).with(red "shelly add --code-name=big-letters --databases=postgresql --organization=org-name --size=
|
478
|
+
$stdout.should_receive(:puts).with(red "shelly add --code-name=big-letters --databases=postgresql --organization=org-name --size=small")
|
479
479
|
lambda {
|
480
480
|
fake_stdin(["BiG_LETTERS", ""]) do
|
481
481
|
invoke(@main, :add)
|
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.34
|
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-
|
11
|
+
date: 2014-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -262,6 +262,7 @@ files:
|
|
262
262
|
- lib/shelly/cli/config.rb
|
263
263
|
- lib/shelly/cli/database.rb
|
264
264
|
- lib/shelly/cli/deploy.rb
|
265
|
+
- lib/shelly/cli/errors.rb
|
265
266
|
- lib/shelly/cli/file.rb
|
266
267
|
- lib/shelly/cli/logs.rb
|
267
268
|
- lib/shelly/cli/main.rb
|
@@ -308,6 +309,7 @@ files:
|
|
308
309
|
- spec/shelly/backup_spec.rb
|
309
310
|
- spec/shelly/cli/backup_spec.rb
|
310
311
|
- spec/shelly/cli/cert_spec.rb
|
312
|
+
- spec/shelly/cli/command_spec.rb
|
311
313
|
- spec/shelly/cli/config_spec.rb
|
312
314
|
- spec/shelly/cli/database_spec.rb
|
313
315
|
- spec/shelly/cli/deploy_spec.rb
|
@@ -359,6 +361,7 @@ test_files:
|
|
359
361
|
- spec/shelly/backup_spec.rb
|
360
362
|
- spec/shelly/cli/backup_spec.rb
|
361
363
|
- spec/shelly/cli/cert_spec.rb
|
364
|
+
- spec/shelly/cli/command_spec.rb
|
362
365
|
- spec/shelly/cli/config_spec.rb
|
363
366
|
- spec/shelly/cli/database_spec.rb
|
364
367
|
- spec/shelly/cli/deploy_spec.rb
|