Module: Lotus

Defined in:
lib/lotus.rb,
lib/lotus/cli.rb,
lib/lotus/root.rb,
lib/lotus/loader.rb,
lib/lotus/routes.rb,
lib/lotus/static.rb,
lib/lotus/lotusrc.rb,
lib/lotus/version.rb,
lib/lotus/welcome.rb,
lib/lotus/container.rb,
lib/lotus/middleware.rb,
lib/lotus/application.rb,
lib/lotus/environment.rb,
lib/lotus/rake_helper.rb,
lib/lotus/config/mapper.rb,
lib/lotus/config/routes.rb,
lib/lotus/configuration.rb,
lib/lotus/views/default.rb,
lib/lotus/config/cookies.rb,
lib/lotus/config/mapping.rb,
lib/lotus/commands/routes.rb,
lib/lotus/commands/server.rb,
lib/lotus/config/security.rb,
lib/lotus/config/sessions.rb,
lib/lotus/routing/default.rb,
lib/lotus/views/null_view.rb,
lib/lotus/application_name.rb,
lib/lotus/commands/console.rb,
lib/lotus/commands/db/drop.rb,
lib/lotus/commands/new/app.rb,
lib/lotus/config/configure.rb,
lib/lotus/rendering_policy.rb,
lib/lotus/commands/db/apply.rb,
lib/lotus/config/load_paths.rb,
lib/lotus/commands/db/create.rb,
lib/lotus/cli_sub_commands/db.rb,
lib/lotus/commands/db/console.rb,
lib/lotus/commands/db/migrate.rb,
lib/lotus/commands/db/prepare.rb,
lib/lotus/commands/db/version.rb,
lib/lotus/commands/db/abstract.rb,
lib/lotus/generators/generator.rb,
lib/lotus/commands/generate/app.rb,
lib/lotus/commands/new/abstract.rb,
lib/lotus/action/csrf_protection.rb,
lib/lotus/action/routing_helpers.rb,
lib/lotus/commands/new/container.rb,
lib/lotus/generators/generatable.rb,
lib/lotus/cli_sub_commands/assets.rb,
lib/lotus/commands/generate/model.rb,
lib/lotus/cli_sub_commands/destroy.rb,
lib/lotus/commands/generate/action.rb,
lib/lotus/commands/generate/mailer.rb,
lib/lotus/cli_sub_commands/generate.rb,
lib/lotus/generators/test_framework.rb,
lib/lotus/commands/assets/precompile.rb,
lib/lotus/commands/generate/abstract.rb,
lib/lotus/generators/database_config.rb,
lib/lotus/commands/generate/migration.rb,
lib/lotus/views/default_template_finder.rb,
lib/lotus/config/framework_configuration.rb

Overview

A complete web framework for Ruby

See Also:

Since:

  • 0.1.0

Defined Under Namespace

Modules: Action, Commands, Config, Generators, Mailer, Routing, Views Classes: Application, ApplicationName, Cli, CliSubCommands, Configuration, Container, Environment, Loader, Lotusrc, Middleware, RakeHelper, RenderingPolicy, Routes, Static, Welcome

Constant Summary collapse

DEFAULT_PUBLIC_DIRECTORY =

Since:

  • 0.1.0

'public'.freeze
VERSION =

Defines the version

Since:

  • 0.1.0

'0.6.1'.freeze

Class Method Summary collapse

Class Method Details

.envString

Return the current environment

Examples:

Lotus.env => "development"

Returns:

  • (String)

    the current environment

See Also:

Since:

  • 0.3.1



40
41
42
# File 'lib/lotus.rb', line 40

def self.env
  environment.environment
end

.env?(*names) ⇒ TrueClass, FalseClass

Check to see if specified environment(s) matches the current environment.

If multiple names are given, it returns true, if at least one of them matches the current environment.

Examples:

Single name

puts ENV['LOTUS_ENV'] # => "development"

Lotus.env?(:development)  # => true
Lotus.env?('development') # => true

Lotus.env?(:production)   # => false

Multiple names

puts ENV['LOTUS_ENV'] # => "development"

Lotus.env?(:development, :test)   # => true
Lotus.env?(:production, :staging) # => false

Returns:

  • (TrueClass, FalseClass)

    the result of the check

See Also:

Since:

  • 0.3.1



68
69
70
# File 'lib/lotus.rb', line 68

def self.env?(*names)
  environment.environment?(*names)
end

.environmentLotus::Environment

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return environment

Returns:

Since:

  • 0.3.2



78
79
80
# File 'lib/lotus.rb', line 78

def self.environment
  Environment.new
end

.public_directoryObject

Since:

  • 0.1.0



26
27
28
# File 'lib/lotus.rb', line 26

def self.public_directory
  root.join(DEFAULT_PUBLIC_DIRECTORY)
end

.rootPathname

Return root of the project (top level directory).

Examples:

Lotus.root # => #<Pathname:/Users/luca/Code/bookshelf>

Returns:

  • (Pathname)

    root path

Since:

  • 0.3.2



22
23
24
# File 'lib/lotus.rb', line 22

def self.root
  environment.root
end