Mercurial > hg > soundsoftware-site
diff app/models/wiki_page.rb @ 245:051f544170fe
* Update to SVN trunk revision 4993
author | Chris Cannam |
---|---|
date | Thu, 03 Mar 2011 11:42:28 +0000 |
parents | 94944d00e43c |
children | cbce1fd3b1b7 |
line wrap: on
line diff
--- a/app/models/wiki_page.rb Thu Mar 03 11:40:10 2011 +0000 +++ b/app/models/wiki_page.rb Thu Mar 03 11:42:28 2011 +0000 @@ -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 @@ 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