This file is indexed.

/usr/lib/ruby/vendor_ruby/ramaze/helper/erector.rb is in ruby-ramaze 2012.12.08-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#          Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the MIT license.

require 'erector'

module Ramaze
  module Helper
    ##
    # Allows you to use some shortcuts for Erector in your Controller.
    #
    # use this inside your controller to directly build Erector
    # Refer to the Erector-documentation and testsuite for more examples.
    #
    # @example
    #   erector { h1 "Apples & Oranges" } #=> "<h1>Apples &amp; Oranges</h1>"
    #   erector { h1(:class => 'fruits&floots'){ text 'Apples' } }
    #
    module Erector
      include ::Erector::Mixin

      class ::Erector::Widget
        alias :raw! :rawtext
        alias :old_css :css

        ##
        # Method that generates a XHTML 1.0 Strict doctype.
        #
        # @example
        #   strict_html do
        #     head do
        #       title "Ramaze Rocks!"
        #     end
        #     body
        #       div do
        #
        #       end
        #     end
        #   end
        #
        # @param [Hash] args Hash containing extra options such as the xml:lang
        #  and xmlns attribute.
        # @param [Block] block Block that contains the inner data of the <html>
        #  element.
        #
        def strict_xhtml(*args, &block)
          raw! '<?xml version="1.0" encoding="UTF-8"?>'
          raw! '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">'
          html(:xmlns => "http://www.w3.org/1999/xhtml", :"xml:lang" => "en", :lang => "en", &block)
        end

        ##
        # Generate a Javascript tag.
        #
        # @example
        #   js 'javascript/jquery.js'
        #
        # @param [String] src The full or relative path to the Javascript file.
        #
        def js(src)
          script :src => src
        end

        ##
        # Generate a pair of conditional tags for a specific browser.
        #
        # @example
        #   ie_if 'IE' do
        #     ......
        #   end
        #
        # @param [String] expr The if expression, such as 'IE' or 'lte IE7'.
        # @param [block] block Block that contains the data that needs to be
        #  loaded for the specified browser.
        #
        def ie_if(expr, &block)
          raw! "<!--[if #{expr}]>"
          yield
          raw! "<![endif]-->"
        end

        ##
        # Inspect the specified element.
        #
        # @param [String] elem The element to inspect.
        #
        def inspect(elem)
          text elem.inspect
        end

        ##
        # Generate a stylesheet tag.
        #
        # @example
        #   css 'css/reset.css', :media => 'print'
        #
        # @param [String] href The path (either absolute or relative) to the CSS
        #  file.
        # @param [Hash] args A hash containing additional arguments to add to
        #  the CSS tag.
        #
        def css(href, args = {})
          attrs = {
            :rel => "stylesheet",
            :href => href,
            :type => "text/css"
          }.merge(args)

          link attrs
        end
      end # Erector::Widget
    end # Erector
  end # Helper
end # Ramaze