Module: Fenix

Defined in:
lib/fenix/core.rb,
lib/fenix/core/version.rb,
lib/fenix/core/response.rb,
lib/fenix/core/settings.rb,
lib/fenix/core/rendering.rb,
lib/fenix/core/exceptions.rb,
lib/fenix/core/application.rb

Defined Under Namespace

Classes: Application, NotFound, Rendering, Response, Settings, TemplateNotFound

Constant Summary collapse

VERSION =
'0.0.1'

Class Method Summary collapse

Class Method Details

.after_load(&block) ⇒ Array<Proc>

Examples:

Fenix.after_load do
  # ...
end

Returns:

  • (Array<Proc>)

Since:

  • 1.0.0



70
71
72
73
74
# File 'lib/fenix/core.rb', line 70

def after_load(&block)
  @_after_load ||= []
  @_after_load << block if block_given?
  @_after_load
end

.before_load(&block) ⇒ Array<Proc>

Examples:

Fenix.before_load do
  # ...
end

Returns:

  • (Array<Proc>)

Since:

  • 1.0.0



55
56
57
58
59
# File 'lib/fenix/core.rb', line 55

def before_load(&block)
  @_before_load ||= []
  @_before_load << block if block_given?
  @_before_load
end

.environmentSymbol Also known as: env

Returns the current environmental state

Examples:

Fenix.environment
# => :production

Fenix.environment
# => :test

Returns:

  • (Symbol)

Since:

  • 1.0.0



41
42
43
# File 'lib/fenix/core.rb', line 41

def environment
  @_environment ||= RACK_ENV.to_sym.downcase
end

.load_pathsArray<String>

Examples:

Fenix.load_paths << Dir[Fenix.root('app', 'controllers', '**')]

Returns:

  • (Array<String>)

Since:

  • 1.0.0



83
84
85
86
87
# File 'lib/fenix/core.rb', line 83

def load_paths
  @_load_paths ||= ['app/controllers/**', 'app/models/**', 'lib/**'].map do |directory|
    Dir[Fenix.root(directory)]
  end.flatten
end

.root(*paths) ⇒ String

Examples:

Fenix.root('Application', 'Views')
# => '/Home/Fenix/Application/Views'

Fenix.root
# => '/Home/Fenix'

Returns:

  • (String)

Since:

  • 1.0.0



23
24
25
# File 'lib/fenix/core.rb', line 23

def root(*paths)
  File.join(FENIX_ROOT, *paths)
end

.versionObject



5
6
7
# File 'lib/fenix/core/version.rb', line 5

def version
  VERSION
end