Sha256: 4388378e16f95b47da681972d5819126b393d9a6b9e5ae9abf0ff6e4a6cfc7c9

Contents?: true

Size: 504 Bytes

Versions: 16

Compression:

Stored size: 504 Bytes

Contents

require 'uv'
module BrighterPlanetHelper
  def render_or_nothing(*args)
    begin
      render(*args)
    rescue ::ActionView::MissingTemplate
      nil
    end
  end

  def syntax(code, lang = 'ruby')
    ::Uv.parse(code, 'xhtml', lang, false, :idle).html_safe
  end
  
  def link_to_homesite(text, path = '')
    if ::BrighterPlanetLayout.application_name == 'Brighter Planet'
      path.insert 0, '/'
    else
      path.insert 0, 'http://brighterplanet.com/'
    end
    link_to text, path
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
brighter_planet_layout-0.2.42 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.41 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-ruby19-0.2.40 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.40 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.39 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.38 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-ruby19-0.2.37.1 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-ruby19-0.2.37 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.37 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.36 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.35 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.34 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.33 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.32 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.31 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.30 app/helpers/brighter_planet_helper.rb