Sha256: cc845e0f146db610f72602bb6e5f3b9630bec96b1ce7d75a9b74586e0c8f8b6b

Contents?: true

Size: 748 Bytes

Versions: 1

Compression:

Stored size: 748 Bytes

Contents

# -*- encoding: utf-8 -*-

class String

  def force_html_extension
    self.gsub /markdown$/, 'html'
  end
  
  def force_html_extension!
    self.gsub! /markdown$/, 'html'
  end
  
  def markdown_ext?
    self.end_with?('.markdown')
  end
  
end

module Nokogiri
  module XML
  
    # I think it's a bad idea to extend the Nokogiri library cause it makes a
    # too big dependency on Genit.
    # It will be much better to do a little wrapper over Nokogiri::XML::Node.
    class Node
    
      def genit_class?
        if self['class']
          true
        else
          false
        end
      end
      
      def genit_var?
        if self['var']
          true
        else
          false
        end
      end
      
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
genit-0.5 lib/genit/extensions.rb