README.md in errand-0.8.0 vs README.md in errand-0.8.1

- old
+ new

@@ -1,100 +1,129 @@ -Errand -====== +# Errand -Errand provides Ruby bindings for RRD functions (via librrd), and a clear -API for interacting with RRDs. +Errand provides Ruby bindings for RRD functions (via librrd), and a clear API for interacting with RRDs. -Check under spec/ for usage examples. +## Installing -Using -===== +Install Errand via RubyGems: -To set up an RRD to work with (whether it exists or otherwise): +``` +gem install errand +``` - @rrd = Errand.new(:filename => "data.rrd") +Or adding do your Gemfile: +``` +gem 'errand' +``` + +## Using + +To start working with an RRD: + +``` ruby +@rrd = Errand.new(:filename => "data.rrd") +``` + +This will either read an existing RRD, or stub out the bits to create a new one. + To create an RRD: - @rrd.create(:sources => [ - {:name => "Counter", :type => :counter, :heartbeat => 1800, :min => 0, :max => 4294967295}], - :archives => [ - {:function => :average, :xff => 0.5, :steps => 1, :rows => 2400}]) +``` ruby +options = { + :sources => [ + { + :name => "Counter", + :type => :counter, + :heartbeat => 1800, + :min => 0, + :max => 4294967295 + } + ], + :archives => [ + { + :function => :average, + :xff => 0.5, + :steps => 1, + :rows => 2400 + } + ] +} -To update said RRD: +@rrd.create(options) +``` - @rrd.update(:sources => [{:name => "Counter", :value => 1}] +To update said RRD: -To fetch that data: +``` ruby +@rrd.update(:sources => [{:name => "Counter", :value => 1}] +``` - @rrd.fetch # <= {:start => Time, :end => Time, - :data => {"Counter" => [nil, nil, nil, 1]} +To fetch that data: -Dependencies -============ +``` ruby +@rrd.fetch # <= {:start => Time, :end => Time, + :data => {"Counter" => [nil, nil, nil, 1]} +``` -**Errand** requires RRDtool version 1.2 or later. Some RRD functions such -as rrddump are only available with the latest RRDtool. +Check under `spec/` for more usage examples. -Installation is standard. If you've installed the gem, you should be ready -to go. +## Developing -Otherwise, simply run: +Clone the repository: - ruby extconf.rb - make - make install +``` +git clone git@github.com:auxesis/errand.git +``` -This should build a library named `rrd.so` in the current directory. If it -doesn't, please report bugs at [http://github.com/eric/rubyrrdtool/issues](http://github.com/eric/rubyrrdtool/issues)! +Suck down all the dependencies: -Building the gem -================ +``` bash +cd errand +bundle +``` -Errand is managed by Jeweller, which generates the gemspec for you: +### Dependencies - rake gemspec +Errand requires RRDtool version 1.2 or later. Some RRD functions such +as rrddump are only available with the latest RRDtool. -Once the gemspec is generated, build the gem: +Installation is standard. If you've installed the gem, you should be ready +to go. - gem build errand.gemspec +Otherwise, simply run: -Testing -======= +``` bash +ruby extconf.rb +make +make install +``` -Testing is done with RSpec. +This should build a library named `rrd.so` in the current directory. If it +doesn't, please report bugs at [http://github.com/eric/rubyrrdtool/issues](http://github.com/eric/rubyrrdtool/issues)! -To run tests: - rake spec +### Testing -Todo -==== +Testing is done with RSpec. -* Extend documentation with examples +To run tests: +``` bash +rake spec +``` -License -======= +### Building the gem -(the MIT license) +Build the gem: -Copyright (c) 2006 +``` bash +rake build +``` -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +## TODO -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +* Extend documentation with more examples -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +## License + +Errand is distributed under the MIT license.