/usr/lib/ruby/vendor_ruby/ramaze.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 | # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the MIT license.
# Namespace for Ramaze
#
# THINK:
# * for now, we don't extend this with Innate to keep things clean. But we
# should eventually do it for a simple API, or people always have to find
# out whether something is in Innate or Ramaze.
# No matter which way we go, we should keep references point to the
# original location to avoid too much confusion for core developers.
module Ramaze
ROOT = File.expand_path(File.dirname(__FILE__)) unless defined?(Ramaze::ROOT)
# 3rd party
require 'innate'
@options = Innate.options
class << self; attr_accessor :options; end
unless $LOAD_PATH.any?{|lp| File.expand_path(lp) == ROOT }
$LOAD_PATH.unshift(ROOT)
end
extend Innate::SingletonMethods
# vendored, will go into rack-contrib
require 'vendor/route_exceptions'
# Ramaze itself
require 'ramaze/version'
require 'ramaze/log'
require 'ramaze/snippets'
require 'ramaze/helper'
require 'ramaze/view'
require 'ramaze/controller'
require 'ramaze/cache'
require 'ramaze/reloader'
require 'ramaze/app'
require 'ramaze/files'
require 'ramaze/request'
require 'ramaze/current'
# Usually it's just mental overhead to remember which module has which
# constant, so we just assign them here as well.
# This will not affect any of the module functions on Innate, you still have
# to reference the correct module for them.
# We do not set constants already set from the requires above.
Innate.constants.each do |const|
begin
Ramaze.const_get(const)
rescue NameError
Ramaze.const_set(const, Innate.const_get(const))
end
end
##
# @see Innate.core
#
def self.core
roots, publics = options[:roots], options[:publics]
joined = roots.map { |r| publics.map { |p| File.join(r, p) } }
joined = joined.flatten.map { |p| Rack::File.new(p) }
current = Current.new(Route.new(AppMap), Rewrite.new(AppMap))
return Rack::Cascade.new(joined << current, [404, 405])
end
require 'ramaze/default_middleware'
end
|