Module: Racket

Defined in:
lib/racket.rb,
lib/racket/utils.rb,
lib/racket/router.rb,
lib/racket/current.rb,
lib/racket/request.rb,
lib/racket/session.rb,
lib/racket/version.rb,
lib/racket/response.rb,
lib/racket/controller.rb,
lib/racket/application.rb,
lib/racket/utils/views.rb,
lib/racket/helpers/file.rb,
lib/racket/helpers/sass.rb,
lib/racket/helpers/view.rb,
lib/racket/plugins/base.rb,
lib/racket/plugins/sass.rb,
lib/racket/view_manager.rb,
lib/racket/settings/base.rb,
lib/racket/utils/helpers.rb,
lib/racket/utils/routing.rb,
lib/racket/helpers/routing.rb,
lib/racket/utils/exceptions.rb,
lib/racket/settings/defaults.rb,
lib/racket/utils/file_system.rb,
lib/racket/settings/controller.rb,
lib/racket/settings/application.rb,
lib/racket/utils/views/renderer.rb,
lib/racket/utils/application/logger.rb,
lib/racket/utils/views/template_cache.rb,
lib/racket/utils/views/template_locator.rb,
lib/racket/utils/views/template_resolver.rb,
lib/racket/utils/application/handler_stack.rb,
lib/racket/utils/application/registry_builder.rb,
lib/racket/utils/application/stateless_services.rb

Overview

Racket - The noisy Rack MVC framework Copyright © 2015-2016 Lars Olsson <[email protected]>

This file is part of Racket.

Racket is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Racket is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Racket. If not, see <www.gnu.org/licenses/>.

Defined Under Namespace

Modules: Helpers, Plugins, Settings, Utils, Version Classes: Application, Controller, Current, Request, Response, Router, Session, ViewManager

Class Method Summary collapse

Class Method Details

.kernel_requireObject



37
# File 'lib/racket.rb', line 37

alias kernel_require require

.require(*args) ⇒ Object

Requires a file relative to the current Racket application dir. Will raise an exception if no Racket application is initialized.

Parameters:

  • args (Array)

Returns:

  • nil



45
46
47
48
49
# File 'lib/racket.rb', line 45

def require(*args)
  raise 'You must have a running Racket application before calling Racket.require' unless
    Controller.context
  (kernel_require resource_path(*args)) && nil
end

.resource_path(*args) ⇒ Pathname

Returns the path to a resource relative to the Racket application dir. Will raise an exception if no Racket is initialized.

Parameters:

  • args (Array)

Returns:

  • (Pathname)


56
57
58
59
60
61
# File 'lib/racket.rb', line 56

def resource_path(*args)
  context = Controller.context
  raise 'You must have a running Racket application before calling Racket.resource_path' unless
    context
  context.utils.build_path(*args)
end

.versionString

Returns the current version of Racket.

Returns:

  • (String)


66
67
68
69
# File 'lib/racket.rb', line 66

def version
  Kernel.require_relative 'racket/version.rb'
  Version.current
end