Sha256: cd58496fbc3fee035bf15638a70afcfd4b9c59863892817e69ae9e58d431093c

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

= Pretty Diff

A tiny library for generating pretty HTML listings for unified Diff format. Heavily used in Beanstalk (http://beanstalkapp.com) application.

== Installation

 gem install pretty_diff

== Example

A quick example will tell it all:

 udiff = File.read("awesome.diff")
 pretty = PrettyDiff::Diff.new(udiff)
 pretty.to_html

Wrap it with HTML, add some styles and you will get something like this:

http://ilya.sabanin.ru/projects/pretty_diff_example.html

== Features

The library is really easy to read and change. All HTML is generated by a set of classes called generators, it's very easy to customize the output to suit your needs.

By default PrettyDiff will generate HTML that can be easily colored with the CSS that you can find in the example above.

PrettyDiff will generate 2 columns of line numbers, as it's usually done for diffs. These columns are copy/paste safe, means that line numbers won't be copied when you copy diff contents.

Tabs will be automatically converted to double spaces.

HTML tags will be automatically escaped from the input string.

== To Do

The test suit can be somewhat improved.

== History

The library was extracted from Beanstalk during the awesome Wildbit Open Source Fridays.

Read more about Open Source Fridays here:

http://wildbit.com/blog/2010/01/15/open-source-fridays-at-wildbit/

Copyright (c) 2010 Ilya Sabanin, Wildbit; see LICENSE for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pretty_diff-0.6.0 README.rdoc
pretty_diff-0.5.0 README.rdoc