diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-02-27 12:35:31 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-02-27 12:35:31 +0000 |
commit | d06f4d013d32465d63c33f436337064d88ccbf6c (patch) | |
tree | c0e1b645f98a9607ecb1d3667795a6c3d304d107 /app/models | |
parent | 2d115bbe707182293cd2dee6878fc0c696900736 (diff) | |
download | redmine-d06f4d013d32465d63c33f436337064d88ccbf6c.tar.gz redmine-d06f4d013d32465d63c33f436337064d88ccbf6c.zip |
Extracts a diff helper from the WikiDiff class.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4952 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/wiki_page.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index b65da2b77..8cd836a31 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -1,5 +1,5 @@ # Redmine - project management software -# Copyright (C) 2006-2009 Jean-Philippe Lang +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -149,17 +149,13 @@ class WikiPage < ActiveRecord::Base end end -class WikiDiff - attr_reader :diff, :words, :content_to, :content_from +class WikiDiff < Redmine::Helpers::Diff + attr_reader :content_to, :content_from def initialize(content_to, content_from) @content_to = content_to @content_from = content_from - @words = content_to.text.split(/(\s+)/) - @words = @words.select {|word| word != ' '} - words_from = content_from.text.split(/(\s+)/) - words_from = words_from.select {|word| word != ' '} - @diff = words_from.diff @words + super(content_to.text, content_from.text) end end |