Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby interface to [UPower] tool available by default on Ubuntu and Debian distros.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
Gemfile
README.md
Rakefile
rupower.gemspec

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.