Class: Junebug::Controllers::Diff

Inherits:
R
  • Object
show all
Includes:
HTMLDiff
Defined in:
lib/junebug/controllers.rb

Instance Method Summary collapse

Methods included from HTMLDiff

#diff

Instance Method Details

#get(page_name, v1, v2) ⇒ Object



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/junebug/controllers.rb', line 181

def get page_name, v1, v2
  page_name_spc = page_name.gsub(/_/,' ')
  @page_title = "Diff: #{page_name_spc}"
  @page = Page.find_by_title(page_name_spc)    
  @v1 = @page.find_version(v1)
  @v2 = @page.find_version(v2)
  
  #@v1_markup = ( @v1.body ? _markup( @v1.body ) : '' )
  #@v2_markup = ( @v2.body ? _markup( @v2.body ) : '' )
  @v1_markup = @v1.body || ''
  @v2_markup = @v2.body || ''
  
  @difftext = diff( @v1_markup , @v2_markup)
  
  render :diff
end