Skip to content
Ruby interface to [UPower] tool available by default on Ubuntu and Debian distros.
Ruby
Latest commit 2b2240f Dec 4, 2013 @k-nowicki Parser update
Failed to load latest commit information.
lib Parser update Dec 4, 2013
test Parser update Dec 4, 2013
.gitignore proof-of-concept code Mar 24, 2012
Gemfile tests; parser improvements Mar 25, 2012
README.md readme Mar 31, 2012
Rakefile readme Mar 26, 2012
rupower.gemspec Parser update Dec 4, 2013

README.md

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

Something went wrong with that request. Please try again.