shelly 0.4.11 → 0.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/shelly/cli/file.rb +8 -0
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/cli/file_spec.rb +52 -0
- metadata +4 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3db6979b83360ab5ec5289105c40db990afeb6ec
|
4
|
+
data.tar.gz: a897299673d1c2e26a1702bd7b69a4ab3de9b694
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ea8b51d8271633030d0647bcc6da3b96801506d82de8245a9ba082047185a6e6f9f3d7c7e43885e6ad8a41419f27131a8f4ae503bee67b87bc036a8975b96d0
|
7
|
+
data.tar.gz: 5a018835c3e98760a88f0cec95658b6db742f38833e738db8d815efbd6f12226b1628c3bbf0879dd3830be9d74c0bf89d9272baa7fad5b89b77e0ed19787748e
|
data/CHANGELOG.md
CHANGED
data/lib/shelly/cli/file.rb
CHANGED
@@ -14,6 +14,8 @@ module Shelly
|
|
14
14
|
def list(path = "/")
|
15
15
|
app = multiple_clouds(options[:cloud], "file list #{path}")
|
16
16
|
app.list_files(path)
|
17
|
+
rescue Client::NotFoundException => e
|
18
|
+
say_error e["message"]
|
17
19
|
rescue Client::ConflictException
|
18
20
|
say_error "Cloud #{app} wasn't deployed properly. Cannot list files."
|
19
21
|
end
|
@@ -22,6 +24,8 @@ module Shelly
|
|
22
24
|
def upload(path)
|
23
25
|
app = multiple_clouds(options[:cloud], "file upload #{path}")
|
24
26
|
app.upload(path)
|
27
|
+
rescue Client::NotFoundException => e
|
28
|
+
say_error e["message"]
|
25
29
|
rescue Client::ConflictException
|
26
30
|
say_error "Cloud #{app} wasn't deployed properly. Cannot upload files."
|
27
31
|
end
|
@@ -35,6 +39,8 @@ module Shelly
|
|
35
39
|
def download(relative_source = ".", destination = ".")
|
36
40
|
app = multiple_clouds(options[:cloud], "file download #{relative_source} #{destination}")
|
37
41
|
app.download(relative_source, destination)
|
42
|
+
rescue Client::NotFoundException => e
|
43
|
+
say_error e["message"]
|
38
44
|
rescue Client::ConflictException
|
39
45
|
say_error "Cloud #{app} wasn't deployed properly. Cannot download files."
|
40
46
|
end
|
@@ -51,6 +57,8 @@ module Shelly
|
|
51
57
|
end
|
52
58
|
|
53
59
|
app.delete_file(path)
|
60
|
+
rescue Client::NotFoundException => e
|
61
|
+
say_error e["message"]
|
54
62
|
rescue Client::ConflictException
|
55
63
|
say_error "Cloud #{app} wasn't deployed properly. Cannot delete files."
|
56
64
|
end
|
data/lib/shelly/version.rb
CHANGED
@@ -37,6 +37,19 @@ describe Shelly::CLI::File do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
context "when cloud is not deployed" do
|
41
|
+
it "should display error" do
|
42
|
+
@app.stub(:attributes => {"system_user" => "system_user"})
|
43
|
+
exception = Shelly::Client::NotFoundException.
|
44
|
+
new({"message" => "Virtual server not found or not configured"})
|
45
|
+
@client.stub(:tunnel).and_raise(exception)
|
46
|
+
$stdout.should_receive(:puts).
|
47
|
+
with(red "Virtual server not found or not configured")
|
48
|
+
lambda {
|
49
|
+
invoke(@cli_files, :list, "some/path")
|
50
|
+
}.should raise_error(SystemExit)
|
51
|
+
end
|
52
|
+
end
|
40
53
|
end
|
41
54
|
|
42
55
|
describe "#upload" do
|
@@ -67,6 +80,19 @@ describe Shelly::CLI::File do
|
|
67
80
|
}.should raise_error(SystemExit)
|
68
81
|
end
|
69
82
|
end
|
83
|
+
|
84
|
+
context "when cloud is not deployed" do
|
85
|
+
it "should display error" do
|
86
|
+
exception = Shelly::Client::NotFoundException.
|
87
|
+
new({"message" => "Virtual server not found or not configured"})
|
88
|
+
@client.stub(:tunnel).and_raise(exception)
|
89
|
+
$stdout.should_receive(:puts).
|
90
|
+
with(red "Virtual server not found or not configured")
|
91
|
+
lambda {
|
92
|
+
invoke(@cli_files, :upload, "some/path")
|
93
|
+
}.should raise_error(SystemExit)
|
94
|
+
end
|
95
|
+
end
|
70
96
|
end
|
71
97
|
|
72
98
|
describe "#download" do
|
@@ -96,6 +122,19 @@ describe Shelly::CLI::File do
|
|
96
122
|
}.should raise_error(SystemExit)
|
97
123
|
end
|
98
124
|
end
|
125
|
+
|
126
|
+
context "when cloud is not deployed" do
|
127
|
+
it "should display error" do
|
128
|
+
exception = Shelly::Client::NotFoundException.
|
129
|
+
new({"message" => "Virtual server not found or not configured"})
|
130
|
+
@client.stub(:tunnel).and_raise(exception)
|
131
|
+
$stdout.should_receive(:puts).
|
132
|
+
with(red "Virtual server not found or not configured")
|
133
|
+
lambda {
|
134
|
+
invoke(@cli_files, :download, "some/path")
|
135
|
+
}.should raise_error(SystemExit)
|
136
|
+
end
|
137
|
+
end
|
99
138
|
end
|
100
139
|
|
101
140
|
describe "#delete" do
|
@@ -151,5 +190,18 @@ describe Shelly::CLI::File do
|
|
151
190
|
}.should raise_error(SystemExit)
|
152
191
|
end
|
153
192
|
end
|
193
|
+
|
194
|
+
context "when cloud is not deployed" do
|
195
|
+
it "should display error" do
|
196
|
+
exception = Shelly::Client::NotFoundException.
|
197
|
+
new({"message" => "Virtual server not found or not configured"})
|
198
|
+
@app.stub(:delete_file).and_raise(exception)
|
199
|
+
$stdout.should_receive(:puts).
|
200
|
+
with(red "Virtual server not found or not configured")
|
201
|
+
lambda {
|
202
|
+
fake_stdin(["yes"]) { invoke(@cli_files, :delete, "some/path") }
|
203
|
+
}.should raise_error(SystemExit)
|
204
|
+
end
|
205
|
+
end
|
154
206
|
end
|
155
207
|
end
|
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.12
|
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
|
+
date: 2013-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -52,34 +52,6 @@ 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'
|
83
55
|
- !ruby/object:Gem::Dependency
|
84
56
|
name: fakefs
|
85
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -316,32 +288,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
288
|
version: '0'
|
317
289
|
requirements: []
|
318
290
|
rubyforge_project: shelly
|
319
|
-
rubygems_version: 2.1.
|
291
|
+
rubygems_version: 2.1.10
|
320
292
|
signing_key:
|
321
293
|
specification_version: 4
|
322
294
|
summary: Shelly Cloud command line tool
|
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
|
295
|
+
test_files: []
|