shelly 0.4.41 → 0.4.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c51d37e659ed7cc8bc5bee3233fac5a548fb6ed8
4
- data.tar.gz: 38461f9c3e60cff1987f97371b0c62119ffd6f13
3
+ metadata.gz: bd0f3635267e3be6e9d6fbff86054582b6ac3b9f
4
+ data.tar.gz: 63d62d167f8245525f44a317e39d72529f1a0037
5
5
  SHA512:
6
- metadata.gz: efb13c5c2604592df1d851bdecc0f38757238f37729e3e6909ea71c28ced80614e4449f2970efc1782b8e6a9ade1aeb05451bc4d3c99d4d9df7f30e213d602a5
7
- data.tar.gz: 9d1a88f31501cc14966a420de0b2e011d793a7c2ec65f6239a61bee206484cd6fc47b30f7d5f255fc1d23ec2a31a874ba92f6948bd77935f3c6177971fadda57
6
+ metadata.gz: 7c4780ffcc4713f920354d5e7a4c9a8421b51382a956f3b0acea83023d28c016fe2a7cb1091093464ec8799d4963ed4c2a3b2f14a6d2d73233d85d332bb29593
7
+ data.tar.gz: 7dee1731a302343f71c175fe6dc87695639d21e55f77ee1d8b8a77d95d7f75a65a3ff11ddf61b4d1822422cae98877194eb9de834d1d7fb5acf3c65c94f20b51
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.4.42 / 2014-12-14
2
+
3
+ * [improvement] Added --server / -s option for shelly rake command, so user
4
+ is able to run rake task on given virtual server
5
+
1
6
  ## 0.4.41 / 2014-12-11
2
7
 
3
8
  * [improvement] Updated mime-types dependency
data/lib/shelly/app.rb CHANGED
@@ -235,8 +235,8 @@ module Shelly
235
235
  shelly.delete_endpoint(code_name, uuid)
236
236
  end
237
237
 
238
- def rake(task)
239
- ssh(:command => "rake_runner \"#{task}\"")
238
+ def rake(task, server = nil)
239
+ ssh(:command => "rake_runner \"#{task}\"", :server => server)
240
240
  end
241
241
 
242
242
  def dbconsole
@@ -289,13 +289,20 @@ Wait until cloud is in 'turned off' state and try again.}
289
289
  end
290
290
 
291
291
  desc "rake TASK", "Run rake task"
292
- method_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
292
+ method_option :cloud, :type => :string, :aliases => "-c",
293
+ :desc => "Specify cloud"
294
+ method_option :server, :type => :string, :aliases => "-s",
295
+ :desc => "Specify virtual server, it's random by default"
293
296
  def rake(task = nil)
294
297
  task = rake_args.join(" ")
295
298
  app = multiple_clouds(options[:cloud], "rake #{task}")
296
- app.rake(task)
299
+ app.rake(task, options[:server])
297
300
  rescue Client::ConflictException
298
301
  say_error "Cloud #{app} is not running. Cannot run rake task."
302
+ rescue Client::NotFoundException => e
303
+ raise unless e.resource == :virtual_server
304
+ say_error "Virtual server '#{options[:server]}' not found or" \
305
+ " not configured for running rake task."
299
306
  end
300
307
 
301
308
  desc "dbconsole", "Run rails dbconsole"
@@ -393,7 +400,7 @@ Wait until cloud is in 'turned off' state and try again.}
393
400
  args.each do |arg|
394
401
  case arg
395
402
  when "rake", "--debug"
396
- when "--cloud", "-c"
403
+ when "--cloud", "-c", "--server", "-s"
397
404
  skip_next = true
398
405
  else
399
406
  out << arg unless skip_next
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.4.41"
2
+ VERSION = "0.4.42"
3
3
  end
@@ -421,6 +421,15 @@ describe Shelly::App do
421
421
  @app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com rake_runner \"test\"")
422
422
  @app.rake("test")
423
423
  end
424
+
425
+ context "when server option is present" do
426
+ it "should run rake task on given server" do
427
+ @client.should_receive(:tunnel).
428
+ with("foo-staging", "ssh", "app1").and_return({})
429
+ @app.should_receive(:childprocess)
430
+ @app.rake("test", "app1")
431
+ end
432
+ end
424
433
  end
425
434
 
426
435
  describe "#dbconsole" do
@@ -1442,7 +1442,7 @@ Wait until cloud is in 'turned off' state and try again.")
1442
1442
  end
1443
1443
 
1444
1444
  it "should invoke rake task" do
1445
- @app.should_receive(:rake).with("db:migrate")
1445
+ @app.should_receive(:rake).with("db:migrate", nil)
1446
1446
  invoke(@main, :rake, "db:migrate")
1447
1447
  end
1448
1448
 
@@ -1450,7 +1450,7 @@ Wait until cloud is in 'turned off' state and try again.")
1450
1450
  before { @main.unstub!(:rake_args) }
1451
1451
 
1452
1452
  it "should return Array of rake arguments (skipping shelly gem arguments)" do
1453
- argv = %w(rake -T db --cloud foo-production --debug)
1453
+ argv = %w(rake -T db --server app1 --cloud foo-production --debug)
1454
1454
  @main.rake_args(argv).should == %w(-T db)
1455
1455
  end
1456
1456
 
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.41
4
+ version: 0.4.42
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-12-11 00:00:00.000000000 Z
11
+ date: 2014-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
359
359
  version: '0'
360
360
  requirements: []
361
361
  rubyforge_project: shelly
362
- rubygems_version: 2.2.2
362
+ rubygems_version: 2.4.5
363
363
  signing_key:
364
364
  specification_version: 4
365
365
  summary: Shelly Cloud command line tool