The Body Mass Index (BMI) Gem is usefull to calculate your BMI from console, and add this gem to your ruby project and use it. See 'bmi -h' to read the instructions of usage.
Write in your comand line 'bmi -w (YourWeight) -b (Your height)' to calculate your BMI, see 'bmi -h' for more features.
Body Mass Index
Imperial BMI Formula
$bmi -W 189.597 -B 69.6850 Your body mass index is: 27 You are 9% over your ideal weight Overweight
require 'bmi' bmi = BMI.new data =  data='-W 189.597' data='-B 69.6850' bmi.calc(data) Your body mass index is: 27 You are 9% over your ideal weight Overweight
Metric Imperial BMI Formula
$bmi -w 86 -b 1.77 Your body mass index is: 27 You are 9% over your ideal weight Overweight
require 'bmi' bmi = BMI.new data =  data='-w 86' data='-b 1.77' bmi.calc(data) Your body mass index is: 27 You are 9% over your ideal weight Overweight
Requires ~> ruby-1.9.2-p290
To build this Gem were installed the following gems:
gem install newgem gem install hoe gem install rake gem install rubyforge
To install this Gem you only need to run:
Gem install bmi
The Gem is uploaded to rubygems.org/
(The MIT License)
Copyright © 2011 Body Mass Index (BMI)
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.