Sha256: 80d4c4fbb4aa3c96b21d8f533d0dc09304ff2a9f3a99e0c952d6e1614a544609

Contents?: true

Size: 885 Bytes

Versions: 13

Compression:

Stored size: 885 Bytes

Contents

class MissingLibrary < Exception #:nodoc: all
end
begin
  require 'mab'
rescue LoadError => e
  raise MissingLibrary, "Mab could not be loaded (is it installed?): #{e.message}"
end

$MAB_CODE = %q{
  module Mab
    include ::Mab::Mixin::HTML5
    include Views

    alias << text!

    def xhtml(*a, &b)
      warn "xhtml_strict is no longer supported (or an active standard); using HTML5 instead"
      html(*a, &b)
    end

    def xhtml_strict(*a, &b) xhtml(*a, &b) end
    def xhtml_transitional(*a, &b) xhtml(*a, &b) end
    def xhtml_frameset(*a, &b) xhtml(*a, &b) end

    def helpers() self end

    def html(*) doctype!; super end

    def mab_done(tag)
      h=tag._attributes
      [:href,:action,:src].map{|a|h[a]&&=self/h[a]}
    end
  end
}

Camping::S.sub!(/autoload\s*:Mab\s*,\s*['"]camping\/mab['"]/, $MAB_CODE)
Camping::Apps.each do |c|
  c.module_eval $MAB_CODE
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
camping-3.2.6 lib/camping/mab.rb
camping-3.2.5 lib/camping/mab.rb
camping-3.2.4 lib/camping/mab.rb
camping-3.2.3 lib/camping/mab.rb
camping-3.2.2 lib/camping/mab.rb
camping-3.2.1 lib/camping/mab.rb
camping-3.2.0 lib/camping/mab.rb
camping-3.1.3 lib/camping/mab.rb
camping-3.1.2 lib/camping/mab.rb
camping-3.1.0 lib/camping/mab.rb
camping-3.0.2 lib/camping/mab.rb
camping-3.0.1 lib/camping/mab.rb
camping-3.0.0 lib/camping/mab.rb