Fuelator

The goal of this application is to calculate fuel to launch from one planet of the Solar system, and to land on another planet of the Solar system, depending on the flight route.

Installation

Add this line to your application's Gemfile:

gem 'fuelator.rb'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install fuelator

Usage

If you plan a trip to Moon, once you are at fuel station, run:

$ fuelator  -m 28801 -p launch,9.807 -p land,1.62 -p launch,1.62 -p land,9.807

To get help:

$ fuelator -h 

Or use API provided:

require 'fuelator'

Fuelator::Calc.run(28801, [[:launch, 9.807], [:land, 1.62], [:launch, 1.62], [:land, 9.807]])
# => 51898

Be ready do handle errors:

Fuelator::Parameters::Error

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, push new tag to github and travis will take care,