Sha256: a2ac150b821faeeb34ac75e1c0e9ec41f60b6290a0428636e4071815965f2920

Contents?: true

Size: 1.33 KB

Versions: 40

Compression:

Stored size: 1.33 KB

Contents

require 'haml/engine'

module Haml
  class Template
    class << self
      @@options = {}

      # Gets various options for Haml. See README.rdoc for details.
      def options
        @@options
      end

      # Sets various options for Haml. See README.rdoc for details.
      def options=(value)
        @@options = value
      end
    end
  end
end

# Decide how we want to load Haml into Rails.
# Patching was necessary for versions <= 2.0.1,
# but we can make it a normal handler for higher versions.
if defined?(ActionView::TemplateHandler)
  require 'haml/template/plugin'
else
  require 'haml/template/patch'
end

if defined?(RAILS_ROOT)
  # Update init.rb to the current version
  # if it's out of date.
  #
  # We can probably remove this as of v1.9,
  # because the new init file is sufficiently flexible
  # to not need updating.
  rails_init_file = File.join(RAILS_ROOT, 'vendor', 'plugins', 'haml', 'init.rb')
  haml_init_file = Haml.scope('init.rb')
  begin
    if File.exists?(rails_init_file)
      require 'fileutils'
      FileUtils.cp(haml_init_file, rails_init_file) unless FileUtils.cmp(rails_init_file, haml_init_file)
    end
  rescue SystemCallError
    warn <<END
HAML WARNING:
#{rails_init_file} is out of date and couldn't be automatically updated.
Please run `haml --rails #{File.expand_path(RAILS_ROOT)}' to update it.
END
  end
end

Version data entries

40 entries across 40 versions & 10 rubygems

Version Path
honkster-haml-2.1.0 lib/haml/template.rb
honkster-haml-2.1.1 lib/haml/template.rb
jwhitmire-haml-2.1.0.1 lib/haml/template.rb
jwhitmire-haml-2.1.0.2 lib/haml/template.rb
jwhitmire-haml-2.1.0.3 lib/haml/template.rb
wireframe-haml-2.1.0 lib/haml/template.rb
wireframe-haml-2.1.1 lib/haml/template.rb
radiantcms-couchrest_model-0.2.4 vendor/plugins/haml/lib/haml/template.rb
radiantcms-couchrest_model-0.2.2 vendor/plugins/haml/lib/haml/template.rb
radiantcms-couchrest_model-0.2.1 vendor/plugins/haml/lib/haml/template.rb
radiantcms-couchrest_model-0.2 vendor/plugins/haml/lib/haml/template.rb
radiantcms-couchrest_model-0.1.9 vendor/plugins/haml/lib/haml/template.rb
radiantcms-couchrest_model-0.1.8 vendor/plugins/haml/lib/haml/template.rb
radiantcms-couchrest_model-0.1.7 vendor/plugins/haml/lib/haml/template.rb
radiantcms-couchrest_model-0.1.6 vendor/plugins/haml/lib/haml/template.rb
radiantcms-couchrest_model-0.1.5 vendor/plugins/haml/lib/haml/template.rb
radiant-0.7.2 vendor/plugins/haml/lib/haml/template.rb
radiant-0.8.2 vendor/plugins/haml/lib/haml/template.rb
radiant-rc-0.9.0 vendor/plugins/haml/lib/haml/template.rb
radiant-0.8.1 vendor/plugins/haml/lib/haml/template.rb