Gem Maintainability Test Coverage Build Status

Hesabu

Hesabu : equation solver based on parslet.

sample usage

    solver = Hesabu::Solver.new
    solver.add("c", "a + b")
    solver.add("a", "10")
    solver.add("b", "10 + a")

    solution = solver.solve!

    expect(solution).to eq("a" => 10, "b" => 20, "c" => 30)

The solver will deduce the correct order and find the values of a,b and c.

The expressions can be more complex (excel like), see the supported functions here

Currently the solver is case sensitive (except function names)

Nb: Hesabu is swahili word for arithmetic.

Alternatives

Development

Running the tests

# only the fast
bundle exec rspec --tag ~slow
# all with integration test, expect around 30-40 seconds depending on your machine
bundle exec rspec

deployment to rubygems.org

one time setup

gem install gem-release
curl -u rubygemaccount https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
chmod 0600 ~/.gem/credentials

gem bump --tag --release

License

The gem is available as open source under the terms of the MIT License.