0.0
No commit activity in last 3 years
No release in over 3 years
A gem of various methods used in many of my plugins. If you need the namespace, let me know.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.1, >= 0.1.0
~> 1.3
~> 12.3.3
~> 3

Runtime

~> 1.6
 Project Readme

Cinch::Toolbox

Gem Version Dependency Status Build Status Coverage Status Code Climate

This is just a gem required fro many of my plugins, it facilitates a variety of mundane operations.

  • URL Shortening / Expansion.
  • URL Title Scraping.
  • Webpage DOM element retrieval (via xpath or css selectors).
  • Output truncation for sanity proof channel output.

Note: There is a small monkey patch to OpenURI contained in this gem. It allows for redirection on urls that require https. For example, normally if you link to an http://github.com/... url on GitHub you will get redirected to the https version of that link, and OpenURI will lose it's shit.

Note that this only honors redirection requests from HTTP => HTTPS and not HTTPS => HTTP.

Installation

Add this line to your application's Gemfile:

gem 'cinch/toolbox'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cinch-toolbox

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

Changelog

  • 1.0.3
    • [Enhancement] Added Toolbox.sent_via_private_message? for restricting commands to use in channel only
  • 1.0.2
    • [Enhancement] Reorged the file layout a bit to be more canonical (require cinch/toolbox now instead of require cinch-toolbox.
    • [Enhancement] Added support for retrieving the full contents of a html element by passing :css_full or :xpath_full to the Cinch::Toolbox.get_html_element method.
  • 1.0.1
    • [Refactor] Updated how time_format functions.
  • 1.0.0 (
    • Added tests!
    • Added docs!
    • Cleaned up code in Toolbox.get_html_element to be more error resistant
    • Cleaned up code in Toolbox.time_format to be more concise.