From 8df0674667fba3ece9176f2918f54664a2c77042 Mon Sep 17 00:00:00 2001 From: Alex Dubovskoy Date: Sat, 7 Jun 2014 19:57:39 +0400 Subject: [PATCH] updated readme --- README.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e3886f0..e9dda52 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # TopoSort -TODO: Write a gem description +Take a hash of elements and their dependencies and sort +them in an order where each element required is before +the elements that require it. + +Note. Each element can have only one dependency. ## Installation @@ -16,14 +20,15 @@ Or install it yourself as: $ gem install topo_sort -## Usage +## Example usage + + nodes = { 'a' => nil, 'b' => 'c', 'c' => 'f', 'd' => 'a', 'e' => 'b', 'f' => nil } + + TopoSort.sort(nodes) + #=> ["a", "f", "c", "b", "d", "e"] -TODO: Write usage instructions here +## Run tests -## Contributing +Run tests with: -1. Fork it ( http://github.com//topo_sort/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 new Pull Request + rake