Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Jun 05 09:30:34 -0700 2008 | [ianwhite] |
| |
CHANGELOG | Sat Jan 05 11:26:20 -0800 2008 | [ian] |
| |
MIT-LICENSE | Sat May 31 04:02:22 -0700 2008 | [ianwhite] |
| |
README.rdoc | Thu Jun 05 09:31:24 -0700 2008 | [ianwhite] |
| |
Rakefile | Sat May 31 04:02:22 -0700 2008 | [ianwhite] |
| |
SPECDOC | Sat Jan 05 11:26:20 -0800 2008 | [ian] |
| |
garlic_example.rb | Sat May 31 04:12:52 -0700 2008 | [ianwhite] |
| |
init.rb | Sat Jan 05 11:26:20 -0800 2008 | [ian] |
| |
install.rb | Sat Jan 05 11:26:20 -0800 2008 | [ian] |
| |
lib/ | Sat Jun 14 06:01:48 -0700 2008 | [ianwhite] |
| |
spec/ | Sat May 31 04:14:21 -0700 2008 | [ianwhite] |
http://plugins.ardes.com > truncate_html
truncate_html
Ardes::TruncateHtml is just like the vanilla truncate rails helper, except it respects tags and html entities, and returns valid html.
Rexml and HtmlEntities are used for the parsing. If the input is invalid html, then hpricot is used to fix it up (but is not used when the input is fine).
Inspired and heavily influenced by http://mikeburnscoder.wordpress.com/2006/11/11/truncating-html-in-ruby/ and the links contained therein.
Dependencies
Requires the htmlentities and hpricot gems:
gem install htmlentities gem install hpricot
or - in your environment.rb file (>= rails 2.1)
config.gem "hpricot" config.gem "htmlentities"
Specs and Coverage
- The SPECDOC lists the specifications
- Coverage is 100% (C0)
- CI: tested against all 2.x branches and stable tags
RSpec is used for testing, so the tests are in spec/ rather than test/ Do rake —tasks for more details.
Continuous Integration
garlic (at http://github.com/ianwhite/garlic) is used for CI. To run the CI suite have a look at garlic_example.rb




