Class: Jax::Engine::Configuration

Inherits:
Rails::Railtie::Configuration
  • Object
show all
Defined in:
lib/jax/engine/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ Configuration

Returns a new instance of Configuration.



6
7
8
9
10
11
12
13
# File 'lib/jax/engine/configuration.rb', line 6

def initialize(path = nil)
  super()
  if defined?(JAX_ROOT)
    path ||= JAX_ROOT
  end

  @root = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? Pathname.new(path).expand_path : Pathname.new(path).realpath
end

Instance Attribute Details

#autoload_once_pathsObject



38
39
40
# File 'lib/jax/engine/configuration.rb', line 38

def autoload_once_paths
  @autoload_once_paths ||= paths.autoload_once
end

#autoload_pathsObject



42
43
44
# File 'lib/jax/engine/configuration.rb', line 42

def autoload_paths
  @autoload_paths ||= paths.autoload_paths
end

#pluginsObject

Returns the value of attribute plugins.



4
5
6
# File 'lib/jax/engine/configuration.rb', line 4

def plugins
  @plugins
end

#rootObject

Returns the value of attribute root.



2
3
4
# File 'lib/jax/engine/configuration.rb', line 2

def root
  @root
end

Instance Method Details

#pathsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/jax/engine/configuration.rb', line 15

def paths
  @paths ||= begin
    paths = Rails::Paths::Root.new(@root)
    paths.app                 "app",                 :glob => "*"
    paths.app.controllers     "app/controllers"
    paths.app.helpers         "app/helpers"
    paths.app.models          "app/models"
    paths.app.views           "app/views"
    paths.app.shaders         "app/shaders"
    paths.app.resources       "app/resources",       :glob => "**/*.yml"
    paths.lib                 "lib",                 :load_path => true
    paths.lib.tasks           "lib/tasks",           :glob => "**/*.rake"
    paths.config              "config"
    paths.config.initializers "config/initializers", :glob => "**/*.rb"
    paths.config.locales      "config/locales",      :glob => "*.{rb,yml}"
    paths.config.routes       "config/routes.rb"
    paths.public              "public"
    paths.public.javascripts  "public/javascripts"
    paths.public.stylesheets  "public/stylesheets"
    paths
  end
end