Class: PI::Cli::Command::Base
- Inherits:
-
Object
show all
- Includes:
- Interactive
- Defined in:
- lib/cli/commands/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/cli/commands/base.rb', line 12
def initialize(options={})
@options = options.dup
if RUBY_PLATFORM =~ /darwin/ && RUBY_VERSION == '1.8.7' && RUBY_PATCHLEVEL <= 174
HighLine.track_eof = false
end
if !!RUBY_PLATFORM['mingw'] || !!RUBY_PLATFORM['mswin32'] || !!RUBY_PLATFORM['cygwin']
PI::Cli::Config.colorize = false
end
end
|
Instance Method Details
#auth_token ⇒ Object
39
40
41
42
|
# File 'lib/cli/commands/base.rb', line 39
def auth_token
return @auth_token if @auth_token
@auth_token = PI::Cli::Config.auth_token
end
|
27
28
29
30
31
32
33
|
# File 'lib/cli/commands/base.rb', line 27
def client
return @client if @client
@client = PI::Client.new(target_url, auth_token)
@client.trace = PI::Cli::Config.trace if PI::Cli::Config.trace
@client.proxy_for @options[:proxy] if @options[:proxy]
@client
end
|