shelly 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +4 -0
- data/lib/shelly/app.rb +4 -0
- data/lib/shelly/cli/main.rb +10 -6
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/app_spec.rb +9 -2
- data/spec/shelly/cli/main_spec.rb +19 -23
- metadata +77 -54
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a07cc071938f6bb5c849911f4ce586696defdb0a
|
4
|
+
data.tar.gz: dd4978354e6889f603d27fd9e281904dcc0c2ba9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6e0848e3a498550f2ac9d5a6d5785cc7b1d0de377d3a45841b493e72a064a8606cc733db493452cc9ececaea70061c0fc1c768622c8be42a85e7c1127f55a54e
|
7
|
+
data.tar.gz: 59ba72b5979aa81a3a406c51c2987f2eba428f59d416b9bd2cd421ac557474ee18c87af107328c1c914f91c08bfc9f978bd2c70e6ccc0032cf9446830899cfce
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.2.18 / 2013-04-25
|
2
|
+
|
3
|
+
* [bug] `shelly add` doesn't prompt the user to provide billing details when adding to existing organization.
|
4
|
+
|
1
5
|
## 0.2.17 / 2013-04-12
|
2
6
|
|
3
7
|
* [feature] Added '--cloud code_name' to command given in output after failed `shelly redeploy` and `shelly stop`.
|
data/lib/shelly/app.rb
CHANGED
@@ -214,6 +214,10 @@ module Shelly
|
|
214
214
|
attributes["organization"]["credit"].to_f
|
215
215
|
end
|
216
216
|
|
217
|
+
def organization_details_present?
|
218
|
+
attributes["organization"]["details_present"]
|
219
|
+
end
|
220
|
+
|
217
221
|
def self.inside_git_repository?
|
218
222
|
system("git status > /dev/null 2>&1")
|
219
223
|
end
|
data/lib/shelly/cli/main.rb
CHANGED
@@ -116,12 +116,16 @@ module Shelly
|
|
116
116
|
|
117
117
|
say "Creating Cloudfile", :green
|
118
118
|
app.create_cloudfile
|
119
|
-
if app.credit > 0
|
119
|
+
if app.credit > 0 || !app.organization_details_present?
|
120
120
|
say_new_line
|
121
121
|
say "Billing information", :green
|
122
|
-
|
123
|
-
|
124
|
-
|
122
|
+
if app.credit > 0
|
123
|
+
say "#{app.credit.to_i} Euro credit remaining."
|
124
|
+
end
|
125
|
+
if !app.organization_details_present?
|
126
|
+
say "Remember to provide billing details before trial ends."
|
127
|
+
say app.edit_billing_url
|
128
|
+
end
|
125
129
|
end
|
126
130
|
|
127
131
|
info_adding_cloudfile_to_repository
|
@@ -201,7 +205,7 @@ module Shelly
|
|
201
205
|
case e[:state]
|
202
206
|
when "running"
|
203
207
|
say_error "Not starting: cloud '#{app}' is already running"
|
204
|
-
when "deploying"
|
208
|
+
when "deploying"
|
205
209
|
say_error "Not starting: cloud '#{app}' is currently deploying"
|
206
210
|
when "no_code"
|
207
211
|
say_error "Not starting: no source code provided", :with_exit => false
|
@@ -372,7 +376,7 @@ Wait until cloud is in 'turned off' state and try again.}
|
|
372
376
|
deployment_progress(app, deployment_id, "Cloud redeploy")
|
373
377
|
rescue Client::ConflictException => e
|
374
378
|
case e[:state]
|
375
|
-
when "deploying"
|
379
|
+
when "deploying"
|
376
380
|
say_error "Your application is being redeployed at the moment"
|
377
381
|
when "no_code", "no_billing", "turned_off"
|
378
382
|
say_error "Cloud #{app} is not running", :with_exit => false
|
data/lib/shelly/version.rb
CHANGED
data/spec/shelly/app_spec.rb
CHANGED
@@ -134,7 +134,8 @@ describe Shelly::App do
|
|
134
134
|
@response = {"web_server_ip" => "192.0.2.1",
|
135
135
|
"state" => "running",
|
136
136
|
"organization" => {
|
137
|
-
"credit" => 23.0
|
137
|
+
"credit" => 23.0,
|
138
|
+
"details_present" => true
|
138
139
|
},
|
139
140
|
"git_info" => {
|
140
141
|
"deployed_commit_message" => "Commit message",
|
@@ -145,11 +146,17 @@ describe Shelly::App do
|
|
145
146
|
end
|
146
147
|
|
147
148
|
describe "#credit" do
|
148
|
-
it "should return
|
149
|
+
it "should return free credit that app has" do
|
149
150
|
@app.credit.should == 23.0
|
150
151
|
end
|
151
152
|
end
|
152
153
|
|
154
|
+
describe "#organization_details_present?" do
|
155
|
+
it "should return app's organization's details_present?" do
|
156
|
+
@app.organization_details_present?.should == true
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
153
160
|
it "should fetch app attributes from API and cache them" do
|
154
161
|
@client.should_receive(:app).with("foo-staging").exactly(:once).and_return(@response)
|
155
162
|
2.times { @app.attributes }
|
@@ -9,6 +9,7 @@ describe Shelly::CLI::Main do
|
|
9
9
|
Shelly::CLI::Main.stub(:new).and_return(@main)
|
10
10
|
@client = mock
|
11
11
|
@client.stub(:token).and_return("abc")
|
12
|
+
@client.stub(:shellyapp_url).and_return("https://example.com")
|
12
13
|
Shelly::Client.stub(:new).and_return(@client)
|
13
14
|
Shelly::User.stub(:guess_email).and_return("")
|
14
15
|
$stdout.stub(:puts)
|
@@ -291,7 +292,8 @@ describe Shelly::CLI::Main do
|
|
291
292
|
Shelly::App.stub(:inside_git_repository?).and_return(true)
|
292
293
|
Shelly::App.stub(:new).and_return(@app)
|
293
294
|
@client.stub(:token).and_return("abc")
|
294
|
-
@app.stub(:attributes).and_return(
|
295
|
+
@app.stub(:attributes).and_return(
|
296
|
+
{"organization" => {"credit" => 0, "details_present" => true}})
|
295
297
|
@app.stub(:git_remote_exist?).and_return(false)
|
296
298
|
@main.stub(:check => true)
|
297
299
|
@main.stub(:ask_for_organization)
|
@@ -418,14 +420,14 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
|
|
418
420
|
end
|
419
421
|
|
420
422
|
it "should create the app on shelly cloud and show credit information" do
|
421
|
-
@app.stub(:attributes).and_return(
|
423
|
+
@app.stub(:attributes).and_return(
|
424
|
+
"organization" => {"credit" => "40", "details_present" => false})
|
422
425
|
@app.stub(:organization).and_return("example")
|
423
|
-
@client.stub(:shellyapp_url).and_return("http://example.com")
|
424
426
|
@app.should_receive(:create)
|
425
427
|
$stdout.should_receive(:puts).with(green "Billing information")
|
426
|
-
$stdout.should_receive(:puts).with("
|
428
|
+
$stdout.should_receive(:puts).with("40 Euro credit remaining.")
|
427
429
|
$stdout.should_receive(:puts).with("Remember to provide billing details before trial ends.")
|
428
|
-
$stdout.should_receive(:puts).with("
|
430
|
+
$stdout.should_receive(:puts).with("https://example.com/organizations/example/edit")
|
429
431
|
|
430
432
|
fake_stdin(["", ""]) do
|
431
433
|
invoke(@main, :add)
|
@@ -754,12 +756,10 @@ More info at http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository\e[0m
|
|
754
756
|
lambda { invoke(@main, :start) }.should raise_error(SystemExit)
|
755
757
|
end
|
756
758
|
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
lambda { invoke(@main, :start) }.should raise_error(SystemExit)
|
762
|
-
end
|
759
|
+
it "should show information that cloud is deploying" do
|
760
|
+
raise_conflict("state" => "deploying")
|
761
|
+
$stdout.should_receive(:puts).with(red "Not starting: cloud 'foo-production' is currently deploying")
|
762
|
+
lambda { invoke(@main, :start) }.should raise_error(SystemExit)
|
763
763
|
end
|
764
764
|
|
765
765
|
it "should show information that cloud has no code" do
|
@@ -793,7 +793,6 @@ We have been notified about it. We will be adding new resources shortly")
|
|
793
793
|
@app.stub(:edit_billing_url).and_return("http://example.com/billing/edit")
|
794
794
|
$stdout.should_receive(:puts).with(red "Please fill in billing details to start foo-production.")
|
795
795
|
$stdout.should_receive(:puts).with(red "Visit: http://example.com/billing/edit")
|
796
|
-
@client.stub(:shellyapp_url).and_return("http://example.com")
|
797
796
|
lambda { invoke(@main, :start) }.should raise_error(SystemExit)
|
798
797
|
end
|
799
798
|
|
@@ -895,7 +894,6 @@ Wait until cloud is in 'turned off' state and try again.")
|
|
895
894
|
|
896
895
|
it "should show messge about app's no_code" do
|
897
896
|
raise_conflict("state" => "no_code")
|
898
|
-
@client.stub(:shellyapp_url).and_return("https://example.com")
|
899
897
|
$stdout.should_receive(:puts).with(red "You need to deploy your cloud first.")
|
900
898
|
$stdout.should_receive(:puts).with('More information can be found at:')
|
901
899
|
$stdout.should_receive(:puts).with('https://example.com/documentation/deployment')
|
@@ -1360,16 +1358,14 @@ Wait until cloud is in 'turned off' state and try again.")
|
|
1360
1358
|
end
|
1361
1359
|
end
|
1362
1360
|
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
}.should raise_error(SystemExit)
|
1372
|
-
end
|
1361
|
+
context "when application is in deploying state" do
|
1362
|
+
it "should display error that deploy is in progress" do
|
1363
|
+
exception = Shelly::Client::ConflictException.new("state" => "deploying")
|
1364
|
+
@client.should_receive(:redeploy).with("foo-production").and_raise(exception)
|
1365
|
+
$stdout.should_receive(:puts).with(red "Your application is being redeployed at the moment")
|
1366
|
+
lambda {
|
1367
|
+
invoke(@main, :redeploy)
|
1368
|
+
}.should raise_error(SystemExit)
|
1373
1369
|
end
|
1374
1370
|
end
|
1375
1371
|
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.18
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Shelly Cloud team
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,103 +27,118 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: guard
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: guard-rspec
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: simplecov
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: ruby_gntp
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rb-fsevent
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
92
109
|
- !ruby/object:Gem::Version
|
93
110
|
version: '0'
|
94
111
|
- !ruby/object:Gem::Dependency
|
95
112
|
name: fakefs
|
96
113
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
114
|
requirements:
|
99
|
-
- -
|
115
|
+
- - '>='
|
100
116
|
- !ruby/object:Gem::Version
|
101
117
|
version: '0'
|
102
118
|
type: :development
|
103
119
|
prerelease: false
|
104
120
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
121
|
requirements:
|
107
|
-
- -
|
122
|
+
- - '>='
|
108
123
|
- !ruby/object:Gem::Version
|
109
124
|
version: '0'
|
110
125
|
- !ruby/object:Gem::Dependency
|
111
126
|
name: fakeweb
|
112
127
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
128
|
requirements:
|
115
|
-
- -
|
129
|
+
- - '>='
|
116
130
|
- !ruby/object:Gem::Version
|
117
131
|
version: '0'
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
135
|
requirements:
|
123
|
-
- -
|
136
|
+
- - '>='
|
124
137
|
- !ruby/object:Gem::Version
|
125
138
|
version: '0'
|
126
139
|
- !ruby/object:Gem::Dependency
|
127
140
|
name: wijet-thor
|
128
141
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
142
|
requirements:
|
131
143
|
- - ~>
|
132
144
|
- !ruby/object:Gem::Version
|
@@ -134,7 +146,6 @@ dependencies:
|
|
134
146
|
type: :runtime
|
135
147
|
prerelease: false
|
136
148
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
149
|
requirements:
|
139
150
|
- - ~>
|
140
151
|
- !ruby/object:Gem::Version
|
@@ -142,65 +153,57 @@ dependencies:
|
|
142
153
|
- !ruby/object:Gem::Dependency
|
143
154
|
name: rest-client
|
144
155
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
156
|
requirements:
|
147
|
-
- -
|
157
|
+
- - '>='
|
148
158
|
- !ruby/object:Gem::Version
|
149
159
|
version: '0'
|
150
160
|
type: :runtime
|
151
161
|
prerelease: false
|
152
162
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
163
|
requirements:
|
155
|
-
- -
|
164
|
+
- - '>='
|
156
165
|
- !ruby/object:Gem::Version
|
157
166
|
version: '0'
|
158
167
|
- !ruby/object:Gem::Dependency
|
159
168
|
name: json
|
160
169
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
170
|
requirements:
|
163
|
-
- -
|
171
|
+
- - '>='
|
164
172
|
- !ruby/object:Gem::Version
|
165
173
|
version: '0'
|
166
174
|
type: :runtime
|
167
175
|
prerelease: false
|
168
176
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
177
|
requirements:
|
171
|
-
- -
|
178
|
+
- - '>='
|
172
179
|
- !ruby/object:Gem::Version
|
173
180
|
version: '0'
|
174
181
|
- !ruby/object:Gem::Dependency
|
175
182
|
name: progressbar
|
176
183
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
184
|
requirements:
|
179
|
-
- -
|
185
|
+
- - '>='
|
180
186
|
- !ruby/object:Gem::Version
|
181
187
|
version: '0'
|
182
188
|
type: :runtime
|
183
189
|
prerelease: false
|
184
190
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
191
|
requirements:
|
187
|
-
- -
|
192
|
+
- - '>='
|
188
193
|
- !ruby/object:Gem::Version
|
189
194
|
version: '0'
|
190
195
|
- !ruby/object:Gem::Dependency
|
191
196
|
name: launchy
|
192
197
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
198
|
requirements:
|
195
|
-
- -
|
199
|
+
- - '>='
|
196
200
|
- !ruby/object:Gem::Version
|
197
201
|
version: '0'
|
198
202
|
type: :runtime
|
199
203
|
prerelease: false
|
200
204
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
205
|
requirements:
|
203
|
-
- -
|
206
|
+
- - '>='
|
204
207
|
- !ruby/object:Gem::Version
|
205
208
|
version: '0'
|
206
209
|
description: Tool for managing applications and clouds at shellycloud.com
|
@@ -273,26 +276,46 @@ files:
|
|
273
276
|
- spec/thor/options_spec.rb
|
274
277
|
homepage: http://shellycloud.com
|
275
278
|
licenses: []
|
279
|
+
metadata: {}
|
276
280
|
post_install_message:
|
277
281
|
rdoc_options: []
|
278
282
|
require_paths:
|
279
283
|
- lib
|
280
284
|
required_ruby_version: !ruby/object:Gem::Requirement
|
281
|
-
none: false
|
282
285
|
requirements:
|
283
|
-
- -
|
286
|
+
- - '>='
|
284
287
|
- !ruby/object:Gem::Version
|
285
288
|
version: '0'
|
286
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
287
|
-
none: false
|
288
290
|
requirements:
|
289
|
-
- -
|
291
|
+
- - '>='
|
290
292
|
- !ruby/object:Gem::Version
|
291
293
|
version: '0'
|
292
294
|
requirements: []
|
293
295
|
rubyforge_project: shelly
|
294
|
-
rubygems_version:
|
296
|
+
rubygems_version: 2.0.2
|
295
297
|
signing_key:
|
296
|
-
specification_version:
|
298
|
+
specification_version: 4
|
297
299
|
summary: Shelly Cloud command line tool
|
298
|
-
test_files:
|
300
|
+
test_files:
|
301
|
+
- spec/helpers.rb
|
302
|
+
- spec/input_faker.rb
|
303
|
+
- spec/shelly/app_spec.rb
|
304
|
+
- spec/shelly/backup_spec.rb
|
305
|
+
- spec/shelly/cli/backup_spec.rb
|
306
|
+
- spec/shelly/cli/config_spec.rb
|
307
|
+
- spec/shelly/cli/deploy_spec.rb
|
308
|
+
- spec/shelly/cli/file_spec.rb
|
309
|
+
- spec/shelly/cli/main_spec.rb
|
310
|
+
- spec/shelly/cli/organization_spec.rb
|
311
|
+
- spec/shelly/cli/runner_spec.rb
|
312
|
+
- spec/shelly/cli/user_spec.rb
|
313
|
+
- spec/shelly/client_spec.rb
|
314
|
+
- spec/shelly/cloudfile_spec.rb
|
315
|
+
- spec/shelly/download_progress_bar_spec.rb
|
316
|
+
- spec/shelly/model_spec.rb
|
317
|
+
- spec/shelly/organization_spec.rb
|
318
|
+
- spec/shelly/structure_validator_spec.rb
|
319
|
+
- spec/shelly/user_spec.rb
|
320
|
+
- spec/spec_helper.rb
|
321
|
+
- spec/thor/options_spec.rb
|