Sha256: 68c145cb3412278bfe3253db65bc84a79e354ec9bf3d3fe12a90b9a20c8eee38
Contents?: true
Size: 712 Bytes
Versions: 14
Compression:
Stored size: 712 Bytes
Contents
module Brightbox desc 'Set the default api client in the config' arg_name 'alias' command [:client_default] do |c| c.action do |global_options, options, args| info "Using config file #{CONFIG.config_filename}" calias = args.shift if calias.nil? raise "You must specify the api alias you want to set as the default" end client_config = CONFIG.clients.detect{|c| CONFIG[c]['alias'] == calias} if client_config.nil? raise "An api client with the alias #{calias} does not exist in the config" end info "Setting #{calias} as default api client" CONFIG['core']['default_client'] = client_config CONFIG.save! end end end
Version data entries
14 entries across 14 versions & 1 rubygems