/usr/lib/ruby/1.8/ramaze/helper/ultraviolet.rb is in libramaze-ruby1.8 2010.06.18-2.
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 | module Ramaze
module Helper
module Ultraviolet
include Innate::Traited
trait :ultraviolet => {
:output => 'xhtml',
:syntax => nil, # syntax_name, nil|false indicates automatic detection
:line_numbers => false,
:style => 'classic', # render_style
:headers => false, # ouput document with all headers
}
# Parse and output the file at the given path.
# Please head over to the Ultraviolet documentation for more information
# on possible options.
def ultraviolet(path, options = {})
o = ancestral_trait[:ultraviolet].merge(options)
output, syntax, lines, style, headers =
o.values_at(:output, :syntax, :line_numbers, :style, :headers)
syntax ||= Uv.syntax_for_file(path).first.first
code = File.read(path)
p [code, output, syntax, lines, style, headers]
Uv.parse(code, output, syntax, lines, style, headers)
end
# Return absolute path to the css of given name.
#
# Usually this will point to somewhere in the gem tree.
#
# It seems like Uv will add support for user-defined PATH in the future,
# so we will, to be future-proof, traverse the Uv.path even though it
# currently will only have one directory.
def ultraviolet_css(theme)
Uv.path.each do |path|
Dir[path/"render/xhtml/files/css/*.css"].each do |css|
return css if File.basename(css, '.css') == theme
end
end
end
end
end
end
|