shelly 0.2.15 → 0.2.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ N2U0NDkwODVjMjg1NGE3MGI1Y2QwYzc2MGVjMzFmYTQzMWYyMzkwYQ==
5
+ data.tar.gz: !binary |-
6
+ NDY3ZWEyNWNiMDVkNWViMjIxZDA3NTI0MjA2MjU2ZTU1OGRhOTdmYQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MzY5ZGRkNDcyMzdhNzk5OTcxNWU4ZmNlNjUxMWFhODQ4NzBlZjU4MWUyZWYw
10
+ NGI1NmFkYTI4MzU0ZTc1YTQ2Njc0NTBhZmZmYTc5MjkzNjZiZDA5ZWI2NzY3
11
+ ZmI3NzM1OTJkYWIyMWEzYzYyZjExNGI4MjEzNTQwZjhmOWM3ZDg=
12
+ data.tar.gz: !binary |-
13
+ Y2FlNjgyMDRhMWI1Mzk5Njg2MDZmZjA2YmE5M2U2M2VhZWVmYmUxNzdiMjkz
14
+ MTczNjZiZDUzNTM4OWUyOTI4NTBhNTU0MjBlY2ZiMWNhNzcyMTVhY2FkOTY0
15
+ NGFiNzZjNmVmMzQ4ZTdlYTI5M2ExZTA2MTk3OTczYTFhNGU4YjA=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.2.16 / 2013-04-04
2
+
3
+ * [bug] `shelly add` now properly sets puma as web server when run under JRuby
4
+ * [bug] `shelly add` now properly sets jruby as ruby_version when run under JRuby
5
+
1
6
  ## 0.2.15 / 2013-03-28
2
7
 
3
8
  * [feature] `shelly files list [PATH]` lists files from cloud's disk
data/lib/shelly/app.rb CHANGED
@@ -17,6 +17,14 @@ module Shelly
17
17
  self.content = content
18
18
  end
19
19
 
20
+ def thin
21
+ size == "small" ? 2 : 4
22
+ end
23
+
24
+ def puma
25
+ size == "small" ? 1 : 2
26
+ end
27
+
20
28
  def databases=(dbs)
21
29
  @databases = dbs - ['none']
22
30
  end
@@ -48,10 +56,7 @@ module Shelly
48
56
  :organization_name => organization,
49
57
  :zone_name => zone_name}
50
58
  response = shelly.create_app(attributes)
51
- self.git_url = response["git_url"]
52
- self.domains = response["domains"]
53
- self.ruby_version = response["ruby_version"]
54
- self.environment = response["environment"]
59
+ assign_attributes(response)
55
60
  end
56
61
 
57
62
  def create_cloudfile
@@ -61,6 +66,11 @@ module Shelly
61
66
  cloudfile.environment = environment
62
67
  cloudfile.domains = domains
63
68
  cloudfile.size = size
69
+ if ruby_version == 'jruby'
70
+ cloudfile.puma = puma
71
+ else
72
+ cloudfile.thin = thin
73
+ end
64
74
  cloudfile.databases = databases
65
75
  cloudfile.create
66
76
  end
@@ -293,6 +303,17 @@ module Shelly
293
303
 
294
304
  private
295
305
 
306
+ def assign_attributes(response)
307
+ self.git_url = response["git_url"]
308
+ self.domains = response["domains"]
309
+ self.ruby_version = jruby? ? 'jruby' : response["ruby_version"]
310
+ self.environment = response["environment"]
311
+ end
312
+
313
+ def jruby?
314
+ RUBY_PLATFORM == 'java'
315
+ end
316
+
296
317
  # Internal: Checks if specified option is present in Cloudfile
297
318
  def option?(option)
298
319
  content["servers"].any? {|_, settings| settings.has_key?(option)}
@@ -5,7 +5,7 @@ module Shelly
5
5
  attr_accessor :content
6
6
  # Cloudfile attributes used for generating Cloudfile from a template
7
7
  attr_accessor :code_name, :ruby_version, :environment, :domains,
8
- :databases, :size
8
+ :databases, :size, :thin, :puma
9
9
 
10
10
  # Public: Return true if Cloudfile is present in current directory
11
11
  def present?
@@ -25,7 +25,6 @@ module Shelly
25
25
  # Returns the generated Cloudfile as String
26
26
  def generate
27
27
  @email = current_user.email
28
- @thin = @size == "small" ? 2 : 4
29
28
  template = File.read(template_path)
30
29
  cloudfile = ERB.new(template, nil, "%<>-")
31
30
  cloudfile.result(binding)
@@ -1,5 +1,5 @@
1
1
  <%= @code_name %>:
2
- ruby_version: <%= @ruby_version %> # 2.0.0, 1.9.3, 1.9.2 or ree-1.8.7
2
+ ruby_version: <%= @ruby_version %> # 2.0.0, jruby, 1.9.3, 1.9.2 or ree-1.8.7
3
3
  environment: <%= @environment %> # RAILS_ENV
4
4
  monitoring_email: <%= @email %>
5
5
  domains:
@@ -13,7 +13,12 @@
13
13
  servers:
14
14
  app1:
15
15
  size: <%= @size %>
16
+ <%- if @thin -%>
16
17
  thin: <%= @thin %>
18
+ <%- end -%>
19
+ <%- if @puma -%>
20
+ puma: <%= @puma %>
21
+ <%- end -%>
17
22
  # whenever: on
18
23
  # delayed_job: 1
19
24
  databases:
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.2.15"
2
+ VERSION = "0.2.16"
3
3
  end
@@ -280,12 +280,21 @@ describe Shelly::App do
280
280
  it "should assign returned git_url, domains, ruby_version and environment" do
281
281
  @client.stub(:create_app).and_return("git_url" => "git@git.example.com:fooo.git",
282
282
  "domains" => ["fooo.shellyapp.com"], "ruby_version" => "1.9.2", "environment" => "production")
283
+ stub_const('RUBY_PLATFORM', 'i686-linux')
283
284
  @app.create
284
285
  @app.git_url.should == "git@git.example.com:fooo.git"
285
286
  @app.domains.should == ["fooo.shellyapp.com"]
286
287
  @app.ruby_version.should == "1.9.2"
287
288
  @app.environment.should == "production"
288
289
  end
290
+
291
+ it "should assign jruby as ruby_version if gem is running under jruby" do
292
+ @client.stub(:create_app).and_return("git_url" => nil,
293
+ "domains" => nil, "environment" => nil, "ruby_version" => "1.9.2")
294
+ stub_const('RUBY_PLATFORM', 'java')
295
+ @app.create
296
+ @app.ruby_version.should == "jruby"
297
+ end
289
298
  end
290
299
 
291
300
  describe "#redeploy" do
@@ -386,21 +395,35 @@ describe Shelly::App do
386
395
  end
387
396
 
388
397
  describe "#create_cloudfile" do
389
- it "should create cloudfile with app attributes" do
390
- @app.ruby_version = "1.9.3"
398
+ before do
391
399
  @app.environment = "production"
392
400
  @app.domains = ["example.com", "another.example.com"]
393
401
  @app.size = "large"
394
402
  @app.databases = []
395
- cloudfile = mock
396
- cloudfile.should_receive(:code_name=).with("foo-staging")
397
- cloudfile.should_receive(:ruby_version=).with("1.9.3")
398
- cloudfile.should_receive(:environment=).with("production")
399
- cloudfile.should_receive(:domains=).with(["example.com", "another.example.com"])
400
- cloudfile.should_receive(:size=).with("large")
401
- cloudfile.should_receive(:databases=).with([])
402
- cloudfile.should_receive(:create)
403
- Shelly::Cloudfile.should_receive(:new).and_return(cloudfile)
403
+ @cloudfile = mock(:code_name= => nil, :ruby_version= => nil,
404
+ :environment= => nil, :domains= => nil, :size= => nil, :thin= => nil,
405
+ :puma= => nil, :databases= => nil, :create => nil)
406
+ Shelly::Cloudfile.should_receive(:new).and_return(@cloudfile)
407
+ end
408
+
409
+ it "should create cloudfile with app attributes" do
410
+ @app.ruby_version = "1.9.3"
411
+ @cloudfile.should_receive(:code_name=).with("foo-staging")
412
+ @cloudfile.should_receive(:ruby_version=).with("1.9.3")
413
+ @cloudfile.should_receive(:environment=).with("production")
414
+ @cloudfile.should_receive(:domains=).with(["example.com", "another.example.com"])
415
+ @cloudfile.should_receive(:size=).with("large")
416
+ @cloudfile.should_receive(:thin=).with(4)
417
+ @cloudfile.should_not_receive(:puma=)
418
+ @cloudfile.should_receive(:databases=).with([])
419
+ @cloudfile.should_receive(:create)
420
+ @app.create_cloudfile
421
+ end
422
+
423
+ it "should set puma instead of thin under jruby" do
424
+ @app.ruby_version = "jruby"
425
+ @cloudfile.should_not_receive(:thin=)
426
+ @cloudfile.should_receive(:puma=).with(2)
404
427
  @app.create_cloudfile
405
428
  end
406
429
  end
@@ -101,6 +101,7 @@ config
101
101
  @cloudfile.ruby_version = "1.9.3"
102
102
  @cloudfile.environment = "production"
103
103
  @cloudfile.size = "large"
104
+ @cloudfile.thin = 4
104
105
  @cloudfile.stub(:current_user => mock(:email => "bob@example.com"))
105
106
  end
106
107
 
@@ -109,7 +110,7 @@ config
109
110
  FakeFS.deactivate!
110
111
  expected = <<-config
111
112
  foo-staging:
112
- ruby_version: 1.9.3 # 2.0.0, 1.9.3, 1.9.2 or ree-1.8.7
113
+ ruby_version: 1.9.3 # 2.0.0, jruby, 1.9.3, 1.9.2 or ree-1.8.7
113
114
  environment: production # RAILS_ENV
114
115
  monitoring_email: bob@example.com
115
116
  domains:
@@ -135,9 +136,10 @@ config
135
136
  it "should generate sample Cloudfile with given attributes and 2 thins" do
136
137
  FakeFS.deactivate!
137
138
  @cloudfile.size = "small"
139
+ @cloudfile.thin = 2
138
140
  expected = <<-config
139
141
  foo-staging:
140
- ruby_version: 1.9.3 # 2.0.0, 1.9.3, 1.9.2 or ree-1.8.7
142
+ ruby_version: 1.9.3 # 2.0.0, jruby, 1.9.3, 1.9.2 or ree-1.8.7
141
143
  environment: production # RAILS_ENV
142
144
  monitoring_email: bob@example.com
143
145
  domains:
metadata CHANGED
@@ -1,236 +1,179 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelly
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.15
4
+ version: 0.2.16
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-03-28 00:00:00.000000000 Z
11
+ date: 2013-04-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
- type: :development
17
15
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
16
  requirements:
20
17
  - - ~>
21
18
  - !ruby/object:Gem::Version
22
19
  version: 2.11.0
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
29
26
  version: 2.11.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
- type: :development
33
29
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
30
  requirements:
36
31
  - - ! '>='
37
32
  - !ruby/object:Gem::Version
38
33
  version: '0'
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
- type: :development
49
43
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
44
  requirements:
52
45
  - - ! '>='
53
46
  - !ruby/object:Gem::Version
54
47
  version: '0'
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
- type: :development
65
57
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
58
  requirements:
75
59
  - - ! '>='
76
60
  - !ruby/object:Gem::Version
77
61
  version: '0'
78
- - !ruby/object:Gem::Dependency
79
- name: simplecov
80
62
  type: :development
81
- requirement: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ! '>='
85
- - !ruby/object:Gem::Version
86
- version: '0'
87
63
  prerelease: false
88
64
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
65
  requirements:
91
66
  - - ! '>='
92
67
  - !ruby/object:Gem::Version
93
68
  version: '0'
94
69
  - !ruby/object:Gem::Dependency
95
- name: ruby_gntp
96
- type: :development
70
+ name: simplecov
97
71
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
72
  requirements:
100
73
  - - ! '>='
101
74
  - !ruby/object:Gem::Version
102
75
  version: '0'
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- - !ruby/object:Gem::Dependency
111
- name: rb-fsevent
112
76
  type: :development
113
- requirement: !ruby/object:Gem::Requirement
114
- none: false
115
- requirements:
116
- - - ! '>='
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
77
  prerelease: false
120
78
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
79
  requirements:
123
80
  - - ! '>='
124
81
  - !ruby/object:Gem::Version
125
82
  version: '0'
126
83
  - !ruby/object:Gem::Dependency
127
84
  name: fakefs
128
- type: :development
129
85
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
86
  requirements:
132
87
  - - ! '>='
133
88
  - !ruby/object:Gem::Version
134
89
  version: '0'
90
+ type: :development
135
91
  prerelease: false
136
92
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
93
  requirements:
139
94
  - - ! '>='
140
95
  - !ruby/object:Gem::Version
141
96
  version: '0'
142
97
  - !ruby/object:Gem::Dependency
143
98
  name: fakeweb
144
- type: :development
145
99
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
100
  requirements:
148
101
  - - ! '>='
149
102
  - !ruby/object:Gem::Version
150
103
  version: '0'
104
+ type: :development
151
105
  prerelease: false
152
106
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
107
  requirements:
155
108
  - - ! '>='
156
109
  - !ruby/object:Gem::Version
157
110
  version: '0'
158
111
  - !ruby/object:Gem::Dependency
159
112
  name: wijet-thor
160
- type: :runtime
161
113
  requirement: !ruby/object:Gem::Requirement
162
- none: false
163
114
  requirements:
164
115
  - - ~>
165
116
  - !ruby/object:Gem::Version
166
117
  version: 0.14.9
118
+ type: :runtime
167
119
  prerelease: false
168
120
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
121
  requirements:
171
122
  - - ~>
172
123
  - !ruby/object:Gem::Version
173
124
  version: 0.14.9
174
125
  - !ruby/object:Gem::Dependency
175
126
  name: rest-client
176
- type: :runtime
177
127
  requirement: !ruby/object:Gem::Requirement
178
- none: false
179
128
  requirements:
180
129
  - - ! '>='
181
130
  - !ruby/object:Gem::Version
182
131
  version: '0'
132
+ type: :runtime
183
133
  prerelease: false
184
134
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
135
  requirements:
187
136
  - - ! '>='
188
137
  - !ruby/object:Gem::Version
189
138
  version: '0'
190
139
  - !ruby/object:Gem::Dependency
191
140
  name: json
192
- type: :runtime
193
141
  requirement: !ruby/object:Gem::Requirement
194
- none: false
195
142
  requirements:
196
143
  - - ! '>='
197
144
  - !ruby/object:Gem::Version
198
145
  version: '0'
146
+ type: :runtime
199
147
  prerelease: false
200
148
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
149
  requirements:
203
150
  - - ! '>='
204
151
  - !ruby/object:Gem::Version
205
152
  version: '0'
206
153
  - !ruby/object:Gem::Dependency
207
154
  name: progressbar
208
- type: :runtime
209
155
  requirement: !ruby/object:Gem::Requirement
210
- none: false
211
156
  requirements:
212
157
  - - ! '>='
213
158
  - !ruby/object:Gem::Version
214
159
  version: '0'
160
+ type: :runtime
215
161
  prerelease: false
216
162
  version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
163
  requirements:
219
164
  - - ! '>='
220
165
  - !ruby/object:Gem::Version
221
166
  version: '0'
222
167
  - !ruby/object:Gem::Dependency
223
168
  name: launchy
224
- type: :runtime
225
169
  requirement: !ruby/object:Gem::Requirement
226
- none: false
227
170
  requirements:
228
171
  - - ! '>='
229
172
  - !ruby/object:Gem::Version
230
173
  version: '0'
174
+ type: :runtime
231
175
  prerelease: false
232
176
  version_requirements: !ruby/object:Gem::Requirement
233
- none: false
234
177
  requirements:
235
178
  - - ! '>='
236
179
  - !ruby/object:Gem::Version
@@ -305,47 +248,25 @@ files:
305
248
  - spec/thor/options_spec.rb
306
249
  homepage: http://shellycloud.com
307
250
  licenses: []
251
+ metadata: {}
308
252
  post_install_message:
309
253
  rdoc_options: []
310
254
  require_paths:
311
255
  - lib
312
256
  required_ruby_version: !ruby/object:Gem::Requirement
313
- none: false
314
257
  requirements:
315
258
  - - ! '>='
316
259
  - !ruby/object:Gem::Version
317
260
  version: '0'
318
261
  required_rubygems_version: !ruby/object:Gem::Requirement
319
- none: false
320
262
  requirements:
321
263
  - - ! '>='
322
264
  - !ruby/object:Gem::Version
323
265
  version: '0'
324
266
  requirements: []
325
267
  rubyforge_project: shelly
326
- rubygems_version: 1.8.23
268
+ rubygems_version: 2.0.2
327
269
  signing_key:
328
- specification_version: 3
270
+ specification_version: 4
329
271
  summary: Shelly Cloud command line tool
330
- test_files:
331
- - spec/helpers.rb
332
- - spec/input_faker.rb
333
- - spec/shelly/app_spec.rb
334
- - spec/shelly/backup_spec.rb
335
- - spec/shelly/cli/backup_spec.rb
336
- - spec/shelly/cli/config_spec.rb
337
- - spec/shelly/cli/deploy_spec.rb
338
- - spec/shelly/cli/file_spec.rb
339
- - spec/shelly/cli/main_spec.rb
340
- - spec/shelly/cli/organization_spec.rb
341
- - spec/shelly/cli/runner_spec.rb
342
- - spec/shelly/cli/user_spec.rb
343
- - spec/shelly/client_spec.rb
344
- - spec/shelly/cloudfile_spec.rb
345
- - spec/shelly/download_progress_bar_spec.rb
346
- - spec/shelly/model_spec.rb
347
- - spec/shelly/organization_spec.rb
348
- - spec/shelly/structure_validator_spec.rb
349
- - spec/shelly/user_spec.rb
350
- - spec/spec_helper.rb
351
- - spec/thor/options_spec.rb
272
+ test_files: []