Module: Arbi

Defined in:
lib/arbi/modules/cpu.rb,
lib/arbi.rb,
lib/arbi/client.rb,
lib/arbi/config.rb,
lib/arbi/server.rb,
lib/arbi/modules.rb,
lib/arbi/version.rb,
lib/arbi/cli/client.rb,
lib/arbi/cli/server.rb,
lib/arbi/modules/net.rb,
lib/arbi/modules/ram.rb,
lib/arbi/modules/help.rb,
lib/arbi/modules/version.rb,
lib/arbi/modules/diskstat.rb,
lib/arbi/modules/acpi/utils.rb,
lib/arbi/modules/sys/adapter.rb,
lib/arbi/modules/sys/battery.rb,
lib/arbi/modules/sys/thermal.rb,
lib/arbi/modules/acpi/adapter.rb,
lib/arbi/modules/acpi/battery.rb

Overview

– Copyleft shura. [ [email protected] ]

This file is part of arbi.

arbi is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

arbi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with arbi. If not, see <www.gnu.org/licenses/>. ++

Defined Under Namespace

Modules: Cli, Modules Classes: Client, Config, Server

Constant Summary collapse

VERSION =
'1.0.8.6'

Class Method Summary collapse

Class Method Details

.connect(address = '127.0.0.1', port = 6969) ⇒ Object



24
25
26
# File 'lib/arbi.rb', line 24

def connect(address = '127.0.0.1', port = 6969)
  @@connection = Arbi::Client.new(address, port)
end

.connected?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/arbi.rb', line 28

def connected?
  @@connection ? true : false
end

.connectionObject



32
33
34
# File 'lib/arbi.rb', line 32

def connection
  @@connection.sock
end

.debug(str) ⇒ Object



143
144
145
146
147
# File 'lib/arbi/modules.rb', line 143

def self.debug(str)
  @@logger.puts(str.to_s)
rescue
  STDERR.puts(str.to_s)
end

.get(what) ⇒ Object



36
37
38
39
# File 'lib/arbi.rb', line 36

def get(what)
  self.connect unless self.connected?
  @@connection.get(what)
end

.initObject



149
150
151
# File 'lib/arbi/modules.rb', line 149

def self.init
  Arbi::Modules.init
end

.modulesObject



153
154
155
156
# File 'lib/arbi/modules.rb', line 153

def self.modules
  Arbi.init
  Arbi::Modules.modules
end