Sha256: 2ce6083a0aa3466e7b37004341d7c447fb5c1c008cc8c61403a11b79f310a487

Contents?: true

Size: 1.34 KB

Versions: 28

Compression:

Stored size: 1.34 KB

Contents

# If this is a frozen gem in Rails 2.1 and RedCloth 3.x was already
# loaded by Rails' ActionView::Helpers::TextHelper, the user will get
# "redcloth_scan.bundle: Class is not a module (TypeError)"
# This hack is to work around that Rails loading problem.  The problem
# appears to be fixed in Edge Rails [51e4106].
Object.send(:remove_const, :RedCloth) if Object.const_defined?(:RedCloth) && RedCloth.is_a?(Class)

require 'rbconfig'
begin
  conf = Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG
  prefix = conf['arch'] =~ /mswin|mingw/ ? "#{conf['MAJOR']}.#{conf['MINOR']}/" : ''
  lib = "#{prefix}redcloth_scan"
  require lib
rescue LoadError => e
  e.message << %{\nCouldn't load #{lib}\nThe $LOAD_PATH was:\n#{$LOAD_PATH.join("\n")}}
  raise e
end

require 'redcloth/version'
require 'redcloth/textile_doc'
require 'redcloth/formatters/base'
require 'redcloth/formatters/html'
require 'redcloth/formatters/latex'

module RedCloth
  
  # A convenience method for creating a new TextileDoc. See
  # RedCloth::TextileDoc.
  def self.new( *args, &block )
    RedCloth::TextileDoc.new( *args, &block )
  end
  
  # Include extension modules (if any) in TextileDoc.
  def self.include(*args)
    RedCloth::TextileDoc.send(:include, *args)
  end
  
end

begin
  require 'erb'
  require 'redcloth/erb_extension'
  include ERB::Util
rescue LoadError
end

Version data entries

28 entries across 28 versions & 7 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/RedCloth-4.3.3/lib/redcloth.rb
RedCloth-4.3.3 lib/redcloth.rb
gv-RedCloth-4.3.2 lib/redcloth.rb
RedCloth-4.3.2 lib/redcloth.rb
RedCloth-4.3.1 lib/redcloth.rb
RedCloth-4.3.0 lib/redcloth.rb
parity-RedCloth-4.2.13 lib/redcloth.rb
parity-RedCloth-4.2.12 lib/redcloth.rb
parity-RedCloth-4.2.11 lib/redcloth.rb
parity-RedCloth-4.2.10 lib/redcloth.rb
parity-RedCloth-4.2.9 lib/redcloth.rb
YSRedCloth-4.2.18 lib/redcloth.rb
assplecake-RedCloth-4.2.10 lib/redcloth.rb
YSRedCloth-4.2.17 lib/redcloth.rb
YSRedCloth-4.2.16 lib/redcloth.rb
gv-RedCloth-4.2.9 lib/redcloth.rb
YSRedCloth-4.2.15 lib/redcloth.rb
YSRedCloth-4.2.14 lib/redcloth.rb
YSRedCloth-4.2.13 lib/redcloth.rb
YSRedCloth-4.2.12 lib/redcloth.rb