shelly 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/shelly/structure_validator.rb +3 -3
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/structure_validator_spec.rb +77 -9
- metadata +63 -86
- checksums.yaml +0 -15
data/CHANGELOG.md
CHANGED
@@ -33,9 +33,9 @@ module Shelly
|
|
33
33
|
|
34
34
|
# Public: Check all requirements that app has to fulfill
|
35
35
|
def valid?
|
36
|
-
gemfile? && gemfile_lock? && gem?("
|
37
|
-
gem?("
|
38
|
-
task?("db:migrate") && task?("db:setup")
|
36
|
+
gemfile? && gemfile_lock? && gem?("rake") &&
|
37
|
+
(gem?("thin") || gem?("puma")) && config_ru? &&
|
38
|
+
rakefile? && task?("db:migrate") && task?("db:setup")
|
39
39
|
end
|
40
40
|
|
41
41
|
def invalid?
|
data/lib/shelly/version.rb
CHANGED
@@ -9,14 +9,14 @@ describe Shelly::StructureValidator do
|
|
9
9
|
describe "#gemfile?" do
|
10
10
|
context "when Gemfile exists" do
|
11
11
|
it "should return true" do
|
12
|
-
@validator.gemfile?.should
|
12
|
+
@validator.gemfile?.should be_true
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
context "when Gemfile doesn't exist" do
|
17
17
|
it "should return false" do
|
18
18
|
@validator.stub(:repo_paths => ["Gemfile.lock"])
|
19
|
-
@validator.gemfile?.should
|
19
|
+
@validator.gemfile?.should be_false
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -24,14 +24,14 @@ describe Shelly::StructureValidator do
|
|
24
24
|
describe "#gemfile_lock?" do
|
25
25
|
context "when Gemfile.lock exists" do
|
26
26
|
it "should return true" do
|
27
|
-
@validator.gemfile_lock?.should
|
27
|
+
@validator.gemfile_lock?.should be_true
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
context "when Gemfile.lock doesn't exist" do
|
32
32
|
it "should return false" do
|
33
33
|
@validator.stub(:repo_paths => ["Gemfile"])
|
34
|
-
@validator.gemfile_lock?.should
|
34
|
+
@validator.gemfile_lock?.should be_false
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -39,14 +39,14 @@ describe Shelly::StructureValidator do
|
|
39
39
|
describe "#config_ru?" do
|
40
40
|
context "when config.ru exists" do
|
41
41
|
it "should return true" do
|
42
|
-
@validator.config_ru?.should
|
42
|
+
@validator.config_ru?.should be_true
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
context "when config.ru doesn't exist" do
|
47
47
|
it "should return false" do
|
48
48
|
@validator.stub(:repo_paths => ["Gemfile.lock"])
|
49
|
-
@validator.config_ru?.should
|
49
|
+
@validator.config_ru?.should be_false
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -68,7 +68,6 @@ describe Shelly::StructureValidator do
|
|
68
68
|
|
69
69
|
describe "#gem?" do
|
70
70
|
before do
|
71
|
-
@validator.stub(:gemfile? => true, :gemfile_lock? => true)
|
72
71
|
Bundler::Definition.stub_chain(:build, :specs).and_return(
|
73
72
|
[mock(:name => "thin"), mock(:name => "mysql")])
|
74
73
|
end
|
@@ -98,8 +97,8 @@ describe Shelly::StructureValidator do
|
|
98
97
|
|
99
98
|
describe "#task?" do
|
100
99
|
before do
|
101
|
-
@validator.should_receive(:'`').at_most(1).with("rake -P")
|
102
|
-
|
100
|
+
@validator.should_receive(:'`').at_most(1).with("rake -P") \
|
101
|
+
.and_return("rake db:migrate")
|
103
102
|
end
|
104
103
|
|
105
104
|
it "should return true if task is present" do
|
@@ -117,4 +116,73 @@ describe Shelly::StructureValidator do
|
|
117
116
|
end
|
118
117
|
end
|
119
118
|
end
|
119
|
+
|
120
|
+
describe "#valid?" do
|
121
|
+
before do
|
122
|
+
@validator.stub(:tasks).and_return(["rake db:migrate", "rake db:setup"])
|
123
|
+
@validator.stub(:gems).and_return(["thin", "rake"])
|
124
|
+
end
|
125
|
+
|
126
|
+
context "when requirements are fulfilled" do
|
127
|
+
context "and 'thin' has been chosen as a web server" do
|
128
|
+
it "should return true" do
|
129
|
+
@validator.valid?.should be_true
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
context "and 'puma' has been chosen as a web server" do
|
134
|
+
it "should return true" do
|
135
|
+
@validator.stub(:gems).and_return(["puma", "rake"])
|
136
|
+
@validator.valid?.should be_true
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
context "when Gemfile doesn't exist" do
|
142
|
+
it "should return false" do
|
143
|
+
@validator.stub(:repo_paths => ["Gemfile.lock", "config.ru", "Rakefile"])
|
144
|
+
@validator.valid?.should be_false
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
context "when Gemfile.lock doesn't exist" do
|
149
|
+
it "should return false" do
|
150
|
+
@validator.stub(:repo_paths => ["Gemfile", "config.ru", "Rakefile"])
|
151
|
+
@validator.valid?.should be_false
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
context "when Rakefile doesn't exist" do
|
156
|
+
it "should return false" do
|
157
|
+
@validator.stub(:repo_paths => ["Gemfile", "Gemfile.lock", "config.ru"])
|
158
|
+
@validator.valid?.should be_false
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
context "when config.ru doesn't exist" do
|
163
|
+
it "should return false" do
|
164
|
+
@validator.stub(:repo_paths => ["Gemfile", "Gemfile.lock", "Rakefile"])
|
165
|
+
@validator.valid?.should be_false
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
context "when web server is missed" do
|
170
|
+
it "should return false" do
|
171
|
+
@validator.stub(:gems).and_return(["rake"])
|
172
|
+
@validator.valid?.should be_false
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
context "when task is missed" do
|
177
|
+
it "should return false if db:setup is missing" do
|
178
|
+
@validator.stub(:tasks).and_return(["rake db:migrate"])
|
179
|
+
@validator.valid?.should be_false
|
180
|
+
end
|
181
|
+
|
182
|
+
it "should return false if db:migrate is missing" do
|
183
|
+
@validator.stub(:tasks).and_return(["rake db:setup"])
|
184
|
+
@validator.valid?.should be_false
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
120
188
|
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.14
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Shelly Cloud team
|
@@ -11,201 +12,197 @@ cert_chain: []
|
|
11
12
|
date: 2013-03-28 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
14
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
15
18
|
requirements:
|
16
19
|
- - ~>
|
17
20
|
- !ruby/object:Gem::Version
|
18
21
|
version: 2.11.0
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
19
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ~>
|
22
28
|
- !ruby/object:Gem::Version
|
23
29
|
version: 2.11.0
|
24
|
-
type: :development
|
25
|
-
prerelease: false
|
26
|
-
name: rspec
|
27
30
|
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
28
32
|
requirement: !ruby/object:Gem::Requirement
|
29
|
-
|
30
|
-
- - ! '>='
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
|
-
version_requirements: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
34
|
requirements:
|
35
35
|
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
|
-
name: rake
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
requirement: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - ! '>='
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0'
|
47
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
48
42
|
requirements:
|
49
43
|
- - ! '>='
|
50
44
|
- !ruby/object:Gem::Version
|
51
45
|
version: '0'
|
52
|
-
type: :development
|
53
|
-
prerelease: false
|
54
|
-
name: guard
|
55
46
|
- !ruby/object:Gem::Dependency
|
47
|
+
name: guard
|
56
48
|
requirement: !ruby/object:Gem::Requirement
|
57
|
-
|
58
|
-
- - ! '>='
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0'
|
61
|
-
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
62
50
|
requirements:
|
63
51
|
- - ! '>='
|
64
52
|
- !ruby/object:Gem::Version
|
65
53
|
version: '0'
|
66
54
|
type: :development
|
67
55
|
prerelease: false
|
68
|
-
name: guard-rspec
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
requirement: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - ! '>='
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0'
|
75
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
76
58
|
requirements:
|
77
59
|
- - ! '>='
|
78
60
|
- !ruby/object:Gem::Version
|
79
61
|
version: '0'
|
80
|
-
type: :development
|
81
|
-
prerelease: false
|
82
|
-
name: simplecov
|
83
62
|
- !ruby/object:Gem::Dependency
|
63
|
+
name: guard-rspec
|
84
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
85
66
|
requirements:
|
86
67
|
- - ! '>='
|
87
68
|
- !ruby/object:Gem::Version
|
88
69
|
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
89
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
90
74
|
requirements:
|
91
75
|
- - ! '>='
|
92
76
|
- !ruby/object:Gem::Version
|
93
77
|
version: '0'
|
94
|
-
type: :development
|
95
|
-
prerelease: false
|
96
|
-
name: ruby_gntp
|
97
78
|
- !ruby/object:Gem::Dependency
|
79
|
+
name: simplecov
|
98
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
99
82
|
requirements:
|
100
83
|
- - ! '>='
|
101
84
|
- !ruby/object:Gem::Version
|
102
85
|
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
103
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
104
90
|
requirements:
|
105
91
|
- - ! '>='
|
106
92
|
- !ruby/object:Gem::Version
|
107
93
|
version: '0'
|
108
|
-
type: :development
|
109
|
-
prerelease: false
|
110
|
-
name: rb-fsevent
|
111
94
|
- !ruby/object:Gem::Dependency
|
95
|
+
name: fakefs
|
112
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
113
98
|
requirements:
|
114
99
|
- - ! '>='
|
115
100
|
- !ruby/object:Gem::Version
|
116
101
|
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
117
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
118
106
|
requirements:
|
119
107
|
- - ! '>='
|
120
108
|
- !ruby/object:Gem::Version
|
121
109
|
version: '0'
|
122
|
-
type: :development
|
123
|
-
prerelease: false
|
124
|
-
name: fakefs
|
125
110
|
- !ruby/object:Gem::Dependency
|
111
|
+
name: fakeweb
|
126
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
127
114
|
requirements:
|
128
115
|
- - ! '>='
|
129
116
|
- !ruby/object:Gem::Version
|
130
117
|
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
131
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
132
122
|
requirements:
|
133
123
|
- - ! '>='
|
134
124
|
- !ruby/object:Gem::Version
|
135
125
|
version: '0'
|
136
|
-
type: :development
|
137
|
-
prerelease: false
|
138
|
-
name: fakeweb
|
139
126
|
- !ruby/object:Gem::Dependency
|
127
|
+
name: wijet-thor
|
140
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
141
130
|
requirements:
|
142
131
|
- - ~>
|
143
132
|
- !ruby/object:Gem::Version
|
144
133
|
version: 0.14.9
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
145
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
146
138
|
requirements:
|
147
139
|
- - ~>
|
148
140
|
- !ruby/object:Gem::Version
|
149
141
|
version: 0.14.9
|
150
|
-
type: :runtime
|
151
|
-
prerelease: false
|
152
|
-
name: wijet-thor
|
153
142
|
- !ruby/object:Gem::Dependency
|
143
|
+
name: rest-client
|
154
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
155
146
|
requirements:
|
156
147
|
- - ! '>='
|
157
148
|
- !ruby/object:Gem::Version
|
158
149
|
version: '0'
|
150
|
+
type: :runtime
|
151
|
+
prerelease: false
|
159
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
160
154
|
requirements:
|
161
155
|
- - ! '>='
|
162
156
|
- !ruby/object:Gem::Version
|
163
157
|
version: '0'
|
164
|
-
type: :runtime
|
165
|
-
prerelease: false
|
166
|
-
name: rest-client
|
167
158
|
- !ruby/object:Gem::Dependency
|
159
|
+
name: json
|
168
160
|
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
169
162
|
requirements:
|
170
163
|
- - ! '>='
|
171
164
|
- !ruby/object:Gem::Version
|
172
165
|
version: '0'
|
166
|
+
type: :runtime
|
167
|
+
prerelease: false
|
173
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
174
170
|
requirements:
|
175
171
|
- - ! '>='
|
176
172
|
- !ruby/object:Gem::Version
|
177
173
|
version: '0'
|
178
|
-
type: :runtime
|
179
|
-
prerelease: false
|
180
|
-
name: json
|
181
174
|
- !ruby/object:Gem::Dependency
|
175
|
+
name: progressbar
|
182
176
|
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
183
178
|
requirements:
|
184
179
|
- - ! '>='
|
185
180
|
- !ruby/object:Gem::Version
|
186
181
|
version: '0'
|
182
|
+
type: :runtime
|
183
|
+
prerelease: false
|
187
184
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
188
186
|
requirements:
|
189
187
|
- - ! '>='
|
190
188
|
- !ruby/object:Gem::Version
|
191
189
|
version: '0'
|
192
|
-
type: :runtime
|
193
|
-
prerelease: false
|
194
|
-
name: progressbar
|
195
190
|
- !ruby/object:Gem::Dependency
|
191
|
+
name: launchy
|
196
192
|
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
197
194
|
requirements:
|
198
195
|
- - ! '>='
|
199
196
|
- !ruby/object:Gem::Version
|
200
197
|
version: '0'
|
198
|
+
type: :runtime
|
199
|
+
prerelease: false
|
201
200
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
202
|
requirements:
|
203
203
|
- - ! '>='
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
|
-
type: :runtime
|
207
|
-
prerelease: false
|
208
|
-
name: launchy
|
209
206
|
description: Tool for managing applications and clouds at shellycloud.com
|
210
207
|
email:
|
211
208
|
- devs@shellycloud.com
|
@@ -276,46 +273,26 @@ files:
|
|
276
273
|
- spec/thor/options_spec.rb
|
277
274
|
homepage: http://shellycloud.com
|
278
275
|
licenses: []
|
279
|
-
metadata: {}
|
280
276
|
post_install_message:
|
281
277
|
rdoc_options: []
|
282
278
|
require_paths:
|
283
279
|
- lib
|
284
280
|
required_ruby_version: !ruby/object:Gem::Requirement
|
281
|
+
none: false
|
285
282
|
requirements:
|
286
283
|
- - ! '>='
|
287
284
|
- !ruby/object:Gem::Version
|
288
285
|
version: '0'
|
289
286
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
287
|
+
none: false
|
290
288
|
requirements:
|
291
289
|
- - ! '>='
|
292
290
|
- !ruby/object:Gem::Version
|
293
291
|
version: '0'
|
294
292
|
requirements: []
|
295
293
|
rubyforge_project: shelly
|
296
|
-
rubygems_version:
|
294
|
+
rubygems_version: 1.8.24
|
297
295
|
signing_key:
|
298
|
-
specification_version:
|
296
|
+
specification_version: 3
|
299
297
|
summary: Shelly Cloud command line tool
|
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
|
298
|
+
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
YzAwOWRmMjEyZDA5OWNlOTg1NTJjYzkxNjY1MTFjODA5MzI0NDA5Yw==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NDg0YjA5MTcxMDdkYTE2NDJiY2Q3NDRlNmM2NzJjODk1ZDM2NTIxMQ==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NjRlYjYzMzUzOGFiMTljNmYxNzNhMWUzMjE5OWZiNmQ0MDFlZjNiMzI1OGIy
|
10
|
-
ZjVkNmQxNWMzMzllZDU1NDcxMmFmMGUyYjA0ZGYwYmY3NGI0ZTJiZjE5NzVj
|
11
|
-
NWU1NzNjZGRkZDc0NjUzYjZiZGE4MjQ2ZWY2ODY3YWE4NzhmODA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NzYwZGVlMWVlNWY5NTk3ODU0YTM0MzJmNGI2ZjljM2RhODU3MDk4NjMyOTJm
|
14
|
-
MTc1N2I0MWQyZTFiYWNlMmUwZDEzYWI0M2M2ODA2YzNlZWY4Y2JlN2YzZjcw
|
15
|
-
MWQzZjc5MTUwYTFkZmQyZTFiMjQxZmY1NjRiY2M5NzdjODYzNTY=
|