Sha256: ea6887810b5b8466c86ddec396d19171631b5b61365d6fb5e5e17df1c9056c88
Contents?: true
Size: 1.33 KB
Versions: 4
Compression:
Stored size: 1.33 KB
Contents
require 'rubygems' require 'terminal-table/import' require 'highline/import' module VMC::Cli module Command class Base attr_reader :no_prompt, :prompt_ok def initialize(options={}) @options = options.dup @no_prompt = @options[:noprompts] @prompt_ok = !no_prompt # Fix for system ruby and Highline (stdin) on MacOSX if RUBY_PLATFORM =~ /darwin/ && RUBY_VERSION == '1.8.7' && RUBY_PATCHLEVEL <= 174 HighLine.track_eof = false end # Suppress colorize on Windows systems for now. if !!RUBY_PLATFORM['mingw'] || !!RUBY_PLATFORM['mswin32'] || !!RUBY_PLATFORM['cygwin'] VMC::Cli::Config.colorize = false end end def client return @client if @client @client = VMC::Client.new(target_url, auth_token) @client.trace = true if VMC::Cli::Config.trace @client.proxy_for @options[:proxy] if @options[:proxy] @client end def client_info return @client_info if @client_info @client_info = client.info end def target_url return @target_url if @target_url @target_url = VMC::Cli::Config.target_url end def auth_token return @auth_token if @auth_token @auth_token = VMC::Cli::Config.auth_token end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
vmc-0.2.11 | lib/cli/commands/base.rb |
vmc-0.2.10 | lib/cli/commands/base.rb |
vmc-0.2.6 | lib/cli/commands/base.rb |
vmc-0.2.4 | lib/cli/commands/base.rb |