Module: Halcyon

Includes:
Config::Helpers
Defined in:
lib/halcyon.rb,
lib/halcyon/client.rb,
lib/halcyon/config.rb,
lib/halcyon/runner.rb,
lib/halcyon/logging.rb,
lib/halcyon/client/ssl.rb,
lib/halcyon/controller.rb,
lib/halcyon/exceptions.rb,
lib/halcyon/application.rb,
lib/halcyon/config/file.rb,
lib/halcyon/config/paths.rb,
lib/halcyon/logging/log4r.rb,
lib/halcyon/config/helpers.rb,
lib/halcyon/logging/logger.rb,
lib/halcyon/runner/helpers.rb,
lib/halcyon/logging/helpers.rb,
lib/halcyon/logging/logging.rb,
lib/halcyon/runner/commands.rb,
lib/halcyon/application/hooks.rb,
lib/halcyon/logging/analogger.rb,
lib/halcyon/application/router.rb,
lib/halcyon/runner/helpers/command_helper.rb

Overview

Provides global values, like the root of the current application directory, the current logger, the application name, and the framework version.

Examples

Halcyon.app #=> AppName
Halcyon.root #=> Dir.pwd
Halcyon.config #=> {:allow_from => :all, :logging => {...}, ...}
Halcyon.paths #=> {:config => Halcyon.root/'config', ...}
Halcyon.logger #=> #<Logger>
Halcyon.version #=> "0.5.2"

Defined Under Namespace

Modules: Exceptions, Logging Classes: Application, Client, Config, Controller, Runner

Constant Summary collapse

VERSION =
[0,5,4]

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Config::Helpers

included

Class Attribute Details

.configObject

Configuration accessor which creates a configuration object when necessary.



51
52
53
# File 'lib/halcyon.rb', line 51

def config
  @config ||= Halcyon::Config.new
end

.loggerObject

Returns the value of attribute logger.



32
33
34
# File 'lib/halcyon.rb', line 32

def logger
  @logger
end

Class Method Details

.linux?Boolean

Tests for Linux platform.

Returns Boolean:is_linux

Returns:

  • (Boolean)


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

def linux?
  RUBY_PLATFORM =~ /linux/
end

.rootObject

The default root setting, overwritten by a configuration helper. This is so that the paths can be loaded when first booting the app. This won’t be necessary for certain cases where the paths the root is manually configured, but for all other cases it can cause problems.



44
45
46
# File 'lib/halcyon.rb', line 44

def root
  Dir.pwd
end

.versionObject



35
36
37
# File 'lib/halcyon.rb', line 35

def version
  VERSION.join('.')
end

.windows?Boolean

Tests for Windows platform (to compensate for numerous Windows-specific bugs and oddities.)

Returns Boolean:is_windows

Returns:

  • (Boolean)


60
61
62
# File 'lib/halcyon.rb', line 60

def windows?
  RUBY_PLATFORM =~ /mswin/
end