Top Level Namespace

Defined Under Namespace

Modules: PowerIQ, RestClient

Instance Method Summary collapse

Instance Method Details

#check_compatabilityObject



52
53
54
55
56
57
58
59
60
# File 'bin/poweriq_client', line 52

def check_compatability
  client_version = PowerIQ::Compatibility.client_version
  server_version = PowerIQ::Compatibility.server_version
  unless(PowerIQ::Compatibility.compatible?)
    raise Error.new("This client (#{client_version}) is not supported by your version of Power IQ (#{server_version})")
  else
    puts "This client (#{client_version}) is supported by your version of Power IQ (#{server_version})"
  end
end

#less_typingObject



43
44
45
46
47
48
49
50
# File 'bin/poweriq_client', line 43

def less_typing
  resources = Dir.entries(File.join(File.dirname(__FILE__), '..', 'lib','poweriq_client','resource')).select { |x| x=~%r{\.rb$} }
  resources.each { |r| load File.join(File.dirname(__FILE__), '..', 'lib','poweriq_client','resource',r) }
  classes = ObjectSpace.each_object(Class).map { |x| x.to_s}.select { |x| x=~/PowerIQ::Resource/ }.reject { |x| x=~/Base$/ }
  classes.each { |c|
    Object.const_set(c.demodulize,c.constantize)
  }
end