Sha256: 891c57bc55822ede32285d54bf5c1e340a6f627d7ab202a9bb44c9858a201bf2

Contents?: true

Size: 1.94 KB

Versions: 3

Compression:

Stored size: 1.94 KB

Contents

require 'set'
require 'active_support'
require 'active_support/core_ext'

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

module ActsAsMarkup
  # This exception is raised when an unsupported markup language is supplied to acts_as_markup.
  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 => "Redcarpet",
                                   :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/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

ActiveSupport.run_load_hooks(:acts_as_markup, ActsAsMarkup)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
acts_as_markup-1.4.2 lib/acts_as_markup.rb
acts_as_markup-1.4.1 lib/acts_as_markup.rb
acts_as_markup-1.4.0 lib/acts_as_markup.rb