This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
README.rdoc | Tue Nov 25 09:03:57 -0800 2008 | |
| |
diff_to_html.rb.gemspec | Tue Nov 25 09:03:57 -0800 2008 | |
| |
examples/ | Tue Nov 25 09:03:57 -0800 2008 | |
| |
lib/ | Wed Nov 26 01:00:03 -0800 2008 | |
| |
nbproject/ | Tue Nov 25 09:03:57 -0800 2008 |
README.rdoc
diff_to_html
This is a Ruby class for converting unified diff, like the one you get with ‘svn diff’, to HTML like in changeset viewer of a tool like Trac, GitHub or Codenotifier, e.g. codenotifier.com/projects/49/commits/47#F0.
It’s based on code from gurge.com/blog/2006/10/03/subversion-diff-viewer-cgi-in-ruby (thanks Adam Doppelt!), adopted lightly to support multifile diffs and to have more familiar output. It definitely have things to improve, so contribution/patches are very welcome.
- install the gem:
gem install artemv-diff_to_html --source=http://gems.github.com
- go to gem’s ‘examples’ dir (it’s …/ruby/lib/ruby/gems/1.8/gems/artemv-diff_to_html-x.x.x/examples/) and run ‘ruby test.rb >out.html’ - this will get diff from sample ‘svn diff’ and generate out.html. Resulting html is linked to diff.css in ‘examples’ directory - you’ll need to copy it to your project’s dir to use it.
- To use in Rails project:
require 'diff_to_html' diff = `cat #{File.join(File.dirname(__FILE__), 'diff.svn')}` converter = SvnDiffToHtml.new #there's also GitDiffToHtml puts converter.composite_to_html(diff) - to use in any Ruby program:
require 'rubygems' require 'diff_to_html' ...
License
diff_to_html is released under the MIT license.
Authors and credits
| Authors: | Artem Vasiliev |
| Original code: | Adam Doppelt, gurge.com/blog/2006/10/03/subversion-diff-viewer-cgi-in-ruby |







