Sha256: 0b4d1a065fec2c1dd114e67226eff0976a04a4b15f8871c90c93fd25ebadc60a

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

module Gumdrop
  
  module Util
    module ViewHelpers
      
      def hidden(&block)
        #no-op
      end
      
      def markdown(source)
        eng_class= Gumdrop::Renderer.for 'markdown'
        unless eng_class.nil?
          eng= eng_class.new { source }
          eng.render
        else
          raise StandardError, "Markdown is not available: Include a Markdown engine in your Gemfile!"
        end
      end
      
      def textile(source)
        eng_class= Gumdrop::Renderer.for 'textile'
        unless eng_class.nil?
          eng= eng_class.new { source }
          eng.render
        else
          raise StandardError, "Textile is not available: Include a Textile engine in your Gemfile!"
        end
      end
      
      def config
        site.config
      end

      def data
        site.data
      end

      def gumdrop_version
        ::Gumdrop::VERSION
      end
      
    end
  end
  
  class << self

    def view_helpers(&block)
      Util::ViewHelpers.class_eval &block
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gumdrop-1.0.3 lib/gumdrop/util/view_helpers.rb