0.0
No commit activity in last 3 years
No release in over 3 years
Cinch Plugin to alow users to pass mathematical problems to the bot for evaluation
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 2.0.12
 Project Readme

Cinch::Plugins::Calculate

Gem Version Dependency Status Build Status Code Climate Test Coverage Issue Count

Plugin that alows users to find the answers to math problems.

Installation

Add this line to your application's Gemfile:

gem 'cinch-calculate'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cinch-calculate

Usage

Just add the plugin to your list:

@bot = Cinch::Bot.new do
  configure do |c|
    c.plugins.plugins = [Cinch::Plugins::Calculate]
  end
end

You will also need to have GNU Units installed. The Units binary that ships with OSX is old and doesn't work. If you have units installed some place that's not '/usr/bin/units' you will have to specify the alternate location.

c.plugins.options[Cinch::Plugins::Calculate][:units_path] = '/usr/bin/gunits'

Once that's all done, just use !math in the channel.

17:31 <@xentrac> !math 1000 W/m^2 * pi * earthradius^2
17:31 < marvin> xentrac: 1.2751652e+17 kg m^2 / s^3
17:31 <@xentrac> !math (1000 W/m^2 * pi * earthradius^2) / (quadrillion btu / year)
17:31 < marvin> xentrac: 3814043.9

Contributing

  1. Fork it
  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