No commit activity in last 3 years
No release in over 3 years
Run algorithms retrieving their codes from Cenit.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.8
~> 10.0

Runtime

~> 0.0.1
~> 0.13.7
>= 1.8.3, ~> 1.8.3
>= 2.3.1.4, ~> 2.3.1.4
 Project Readme

Cenit Algorithms

Run algorithms retrieving their codes from Cenit.

Installation

Add this line to your application's Gemfile:

gem 'cenit-algorithms'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cenit-algorithms

Usage

Run some algorithms

require 'cenit/algorithms'

Cenit::Algorithms('Number Theory').factorial(5)  # 120

Cenit::Algorithms('Number Theory').gcd(20, 15)   # 5

Checkout more shared algorithms at https://cenit.io/algorithm

Algorithms codes are loaded on demand and kept stored. If you want to reset your loaded algorithms then execute:

Cenit::Algorithms.reset

If you want to run your own algorithms then configure your Cenit credentials:

Cenit.access_token 'XXXXXXXXXX'
Cenit.access_key   'KKKKKKKKKK'

If you want to use your own instance of Cenit then configure your host URL by:

Cenit.host 'my-cenit-host-url'

Learn more about Cenit at https://cenit.io

Development

After checking out the repo, run bin/setup to install dependencies. Then, 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 to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/cenit-io/cenit-algorithms/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