Elevatore
Welcome to Elevatore. I am an intelligent elevator, programmed to get a bunch of people that schedule their trips inside of me through STDIN or file input. I am written in Ruby, so you have to get it somehow to execute me.
Installation
With Ruby installed in you machine, clone this repository, navigate to it's folder and then execute:
$ bundle
$ bundle exec rake install
Usage
$ bundle exec elevatore
-q
- Output to STDOUT only the travel times.
-v
- Check my version out.
-h
- Take a look at my help menu.
You have 4 options to make people travel with me.
Executing command without arguments:
- This way you will use STDIN to input people until you type 'exit' or interrupt execution(CTRL-C), so that I can finally take them home.
Executing command with arguments:
- You can pass file paths with one person per line
- You can pass people as a formatted string argument
- You can pass people as a JSON array with people objects inside
To make it easier for me to understand you please catalog yourselves with the following information:
attribute_1
- Time in minutes that you plan to begin your travel
attribute_2
- A numeric identification, to make it easier for me to know who you are
attribute_3
- From which floor I should pick you up
attribute_4
- Which floor do you want to go?
When using STDIN or strings in files or arguments, each person should be formatted as follows(without curly brackets):
'attribute_1
m Pattribute_2
attribute_3
attribute_4
'
When using JSON formatting follow a schema like:
[{enter_at: attribute_1
, id: attribute_2
, from: attribute_3
, to: attribute_4
}]
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, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/elevatore. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Elevatore project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.