RunningOnRails

Running On Rails gem provide some tools for running or cycling as pace converter, split calculator, training pace...

Version 0.0.2:

Done

  • Pace Converter

Todo

  • still a long list

Installation

Add this line to your application's Gemfile:

gem 'running_on_rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install running_on_rails

Usage

Pace unit available

mins / miles
miles / hour
mins / km
kms / hour
meters /sec

Float (meters/second) to unit

You can convert Float (as meters/second) to any of the following unit:

Example

> @pace = 3.2 # float wil be meters / second
=> 3.2
> @pace.to_mins_mile
=> 8.382
@pace.to_miles_hour
=> 7.158
@pace.to_mins_km
=> 5.208
@pace.to_kms_hour
=> 11.52
@pace.to_meters_sec
=> 3.2

Float to mm:ss

mins per km and mins per miles can be converted to "mm:ss" with Float#to_mm_ss

From one unit to another unit

All PaceConverter::from_* method return a Float which is the convertion in meters/second

from_mins_mile(mins, secs)
from_miles_hour(miles)
from_mins_km(mins, secs)
from_kms_hour(kms)
from_meters_sec(meters)

Example

> @pace_converter = PaceConverter.new
=> PaceConverter
> @pace_converter.from_mins_miles(10, 30)
=> 2.555 
> @pace_converter.from_kms_hour(11.52)
=> 3.2

Contact

It's my first gem, so all advice are more than welcome! @manzan_46 // [email protected]

Contributing

  1. Fork it ( https://github.com/manzan_a/running_on_rails/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request