Skip to content

Ruby interface to [UPower] tool available by default on Ubuntu and Debian distros.

Notifications You must be signed in to change notification settings

k-nowicki/Rupower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rupower

Ruby interface to UPower.Device tool available by default on Ubuntu and Debian distros.

Example

battery = Rupower::Battery.new
battery.serial          # =>   5981
battery.voltage         # =>  12.15     # [V]
battery.energy_rate:    # =>   18.97    # [W]
percentage:             # =>   77.36    # [%]
capacity:               # =>   100      # [%]
technology:             # =>   'lithium-ion'

See the UPower documentation for full list of properties that can be used as methods, or look at the acceptance tests.

Installation

Add this to your Gemfile:

gem 'rupower'

Then run:

bundle

Requirements

  • Ruby >= 1.9.2

Running tests

bundle exec rake test

License

Released under the MIT license. Copyright (C) 2012 Karol Nowicki

About

Ruby interface to [UPower] tool available by default on Ubuntu and Debian distros.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages