shelly 0.4.33 → 0.4.34

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: 70e1c464916a7bec7aac3a4d67f255efd263170e
4
- data.tar.gz: 90d25d494ecb5a2b7a74757fcba6fb7511b1d844
3
+ metadata.gz: fab8b51230c1e3e5b342a51d6ee7a9522251847c
4
+ data.tar.gz: 8d4b291e20ba8c53d84174d2b467f5fc3b836551
5
5
  SHA512:
6
- metadata.gz: 36fe387fcd057d4b0da13632dd887cc2299b44b03fe0bafde42e077798df643ae75355bde9d8af6910b10790b17d8d830ec1d0becee812cec72e8447259177d0
7
- data.tar.gz: 94e6e71387f3f53ad4445181725f3647cf0844a955948bba8d1d13deb9c2391f7b422c269d38710177dcacf22e585c92f60cb0db5993f060803f2fb230feb544
6
+ metadata.gz: 4dac3895b45d4f34274b602a51b643dcad43311d51c0e7a5a72bc7677239eedb1d154cbd8b5f67f22f246d6b48ba5b23d9c5706a18aa45ba12de55093f2a87b7
7
+ data.tar.gz: 95b501aafadc2e1935c0a44354ef64d48bf24681933540676a854d75960d181cc255a0af5dbcd788dd30fea927620c62d5037a9cf7952ebf03a18f5add13035c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.4.34 / 2014-06-12
2
+
3
+ * [improvement] Check if ENV['HOME'] is set on start
4
+ * internal changes
5
+
1
6
  ## 0.4.33 / 2014-05-27
2
7
 
3
8
  * [bugfix] Show info about Windows support
@@ -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)
@@ -0,0 +1,5 @@
1
+ module Shelly
2
+ module CLI
3
+ class HomeNotSetError < ArgumentError; end
4
+ end
5
+ end
@@ -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"] || "large"
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
 
@@ -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.",
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.4.33"
2
+ VERSION = "0.4.34"
3
3
  end
@@ -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=large")
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.33
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-05-27 00:00:00.000000000 Z
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