Cinch::Plugins::Calculate
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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request