vmc 0.4.0.beta.44 → 0.4.0.beta.45

Sign up to get free protection for your applications and to get access to all the features.
@@ -378,8 +378,6 @@ module VMC
378
378
  :desc => "Applications to start",
379
379
  :from_given => by_name("app")
380
380
  def instances
381
- no_v2
382
-
383
381
  apps = input[:apps]
384
382
  fail "No applications given." if apps.empty?
385
383
 
@@ -391,7 +389,7 @@ module VMC
391
389
 
392
390
  spaced(instances) do |i|
393
391
  if quiet?
394
- line i.index
392
+ line i.id
395
393
  else
396
394
  line
397
395
  display_instance(i)
@@ -451,20 +449,18 @@ module VMC
451
449
  input :app, :argument => true,
452
450
  :desc => "Application to get the logs of",
453
451
  :from_given => by_name("app")
454
- input :instance, :type => :numeric, :default => 0,
452
+ input :instance, :default => "0",
455
453
  :desc => "Instance of application to get the logs of"
456
454
  input :all, :default => false,
457
455
  :desc => "Get logs for every instance"
458
456
  def logs
459
- no_v2
460
-
461
457
  app = input[:app]
462
458
 
463
459
  instances =
464
460
  if input[:all]
465
461
  app.instances
466
462
  else
467
- app.instances.select { |i| i.index == input[:instance] }
463
+ app.instances.select { |i| i.id == input[:instance] }
468
464
  end
469
465
 
470
466
  if instances.empty?
@@ -479,7 +475,7 @@ module VMC
479
475
  logs =
480
476
  with_progress(
481
477
  "Getting logs for #{c(app.name, :name)}" +
482
- c("\##{i.index}", :instance)) do
478
+ c("\##{i.id}", :instance)) do
483
479
  i.files("logs")
484
480
  end
485
481
 
@@ -513,9 +509,15 @@ module VMC
513
509
  app.file(*input[:path].split("/"))
514
510
  end
515
511
 
516
- line unless quiet?
512
+ if quiet?
513
+ print file
514
+ else
515
+ line
517
516
 
518
- print file
517
+ file.split("\n").each do |l|
518
+ line l
519
+ end
520
+ end
519
521
  end
520
522
 
521
523
  desc "Examine an app's files"
@@ -527,15 +529,19 @@ module VMC
527
529
  :desc => "Path of directory to list"
528
530
  def files
529
531
  app = input[:app]
532
+ path = input[:path]
530
533
 
531
- files =
532
- with_progress("Getting file listing") do
533
- app.files(*input[:path].split("/"))
534
- end
534
+ if quiet?
535
+ files =
536
+ with_progress("Getting file listing") do
537
+ app.files(*path.split("/"))
538
+ end
535
539
 
536
- line unless quiet?
537
- files.each do |file|
538
- line file.join("/")
540
+ files.each do |file|
541
+ line file.join("/")
542
+ end
543
+ else
544
+ invoke :file, :app => app, :path => path
539
545
  end
540
546
  end
541
547
 
@@ -569,8 +575,6 @@ module VMC
569
575
  :desc => "Application to get the stats for",
570
576
  :from_given => by_name("app")
571
577
  def stats
572
- no_v2
573
-
574
578
  app = input[:app]
575
579
 
576
580
  stats =
@@ -920,7 +924,7 @@ module VMC
920
924
  end
921
925
 
922
926
  def display_instance(i)
923
- start_line "instance #{c("\##{i.index}", :instance)}: "
927
+ start_line "instance #{c("\##{i.id}", :instance)}: "
924
928
  puts "#{b(c(i.state.downcase, state_color(i.state)))} "
925
929
 
926
930
  indented do
@@ -106,7 +106,6 @@ module VMCHelpers
106
106
 
107
107
  thd_group = ThreadGroup.new
108
108
  thd = Thread.new do
109
- thd_group.add(thd)
110
109
  begin
111
110
  VMC::CLI.new.invoke(command, inputs, given, :quiet => true)
112
111
  rescue SystemExit => e
@@ -126,6 +125,8 @@ EOF
126
125
  end
127
126
  end
128
127
 
128
+ thd_group.add(thd)
129
+
129
130
  begin
130
131
  $vmc_event.process = thd
131
132
 
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.4.0.beta.44"
2
+ VERSION = "0.4.0.beta.45"
3
3
  end
@@ -60,7 +60,7 @@ describe "App#push" do
60
60
 
61
61
  app.should be
62
62
  app.name.should == name
63
- app.instances.should == instances
63
+ app.total_instances.should == instances
64
64
  app.framework.should == framework
65
65
  app.runtime.should == runtime
66
66
  #app.url.should == url # TODO v2
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmc
3
3
  version: !ruby/object:Gem::Version
4
- hash: -842654508
4
+ hash: 2094814611
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 0
10
10
  - beta
11
- - 44
12
- version: 0.4.0.beta.44
11
+ - 45
12
+ version: 0.4.0.beta.45
13
13
  platform: ruby
14
14
  authors:
15
15
  - VMware
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-09-05 00:00:00 Z
20
+ date: 2012-09-06 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: json_pure
@@ -265,12 +265,12 @@ dependencies:
265
265
  requirements:
266
266
  - - ~>
267
267
  - !ruby/object:Gem::Version
268
- hash: 43
268
+ hash: 41
269
269
  segments:
270
270
  - 0
271
271
  - 3
272
- - 28
273
- version: 0.3.28
272
+ - 29
273
+ version: 0.3.29
274
274
  type: :runtime
275
275
  version_requirements: *id015
276
276
  - !ruby/object:Gem::Dependency