Sha256: 7b781c38508a589071e7787d0bfe38127b0a94930e5b9c749a7429b3a201390c

Contents?: true

Size: 1.93 KB

Versions: 1

Compression:

Stored size: 1.93 KB

Contents

require 'set'
require 'active_support/concern'
require 'active_support/core_ext/module/attribute_accessors'

require 'acts_as_markup_on/version'
require 'acts_as_markup_on/railtie' if defined?(Rails)

module ActsAsMarkupOn
  # This exception is raised when an unsupported markup language is supplied to acts_as_markup_on.
  class UnsupportedMarkupLanguage < ArgumentError
  end
  
  # This exception is raised when an unsupported Markdown library is set to the config value.
  class UnsportedMarkdownLibrary < ArgumentError
  end
  
  # This exception is raised when an unsupported Mediawiki library is set to the config value.
  class UnsportedMediawikiLibrary < ArgumentError
  end
  
  MARKDOWN_LIBS = { :rdiscount => {:class_name => "RDiscount",
                                   :lib_name   => "rdiscount"}, 
                    :bluecloth => {:class_name => "BlueClothText",
                                   :lib_name   => "bluecloth"},
                    :rpeg      => {:class_name => "PEGMarkdown",
                                   :lib_name   => "peg_markdown"},
                    :maruku    => {:class_name => "Maruku",
                                   :lib_name   => "maruku"},
                    :redcarpet => {:class_name => "RedcarpetText",
                                   :lib_name   => 'redcarpet'} }

  MEDIAWIKI_LIBS = { :wikitext  => {:class_name => "WikitextString",
                                   :lib_name   => "wikitext"},
                     :wikicloth => {:class_name => "WikiClothText",
                                    :lib_name   => 'wikicloth'} }
                                   
  LIBRARY_EXTENSIONS = ::Set.new(Dir[File.join(File.expand_path(File.dirname(__FILE__)), 'acts_as_markup_on/exts/*.rb')].map {|file| File.basename(file, '.rb')}).delete('string')

  mattr_accessor :markdown_library
  mattr_accessor :mediawiki_library

  # Returns the version string for the library.
  def self.version
    VERSION
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts_as_markup_on-1.0.0 lib/acts_as_markup_on.rb