~ubuntu-branches/ubuntu/quantal/ruby-vmc/quantal-201206142105

« back to all changes in this revision

Viewing changes to lib/cli/core_ext.rb

  • Committer: Michael Terry
  • Date: 2012-06-14 17:21:18 UTC
  • mfrom: (5.1.1 ruby-vmc)
  • Revision ID: michael.terry@canonical.com-20120614172118-8m3f2k7ugyki6sir
New upstream release (LP: #998111).

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    raise VMC::Cli::CliExit, "#{prefix}#{message}"
39
39
  end
40
40
 
 
41
  def warn(msg)
 
42
    say "#{"[WARNING]".yellow} #{msg}"
 
43
  end
 
44
 
41
45
  def quit(message = nil)
42
46
    raise VMC::Cli::GracefulExit, message
43
47
  end
64
68
    return sprintf("%.#{prec}fM", size/(1024.0*1024.0)) if size < (1024*1024*1024)
65
69
    return sprintf("%.#{prec}fG", size/(1024.0*1024.0*1024.0))
66
70
  end
67
 
 
68
71
end
69
72
 
70
73
module VMCStringExtensions