Sha256: 0e67e0aee4bfb215f0fc9f263288feb60d14e47c857b6d78e6bf3c5e89e054df

Contents?: true

Size: 1.61 KB

Versions: 3

Compression:

Stored size: 1.61 KB

Contents

class Jax::Engine::Configuration < Rails::Railtie::Configuration
  attr_reader :root
  attr_writer :autoload_once_paths, :autoload_paths
  attr_accessor :plugins
  
  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

  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
  
  def autoload_once_paths
    @autoload_once_paths ||= paths.autoload_once
  end

  def autoload_paths
    @autoload_paths ||= paths.autoload_paths
  end

  def root=(path)
    @root = paths.path = Pathname.new(path).expand_path
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jax-1.1.1 lib/jax/engine/configuration.rb
jax-1.1.0 lib/jax/engine/configuration.rb
jax-1.1.0.rc1 lib/jax/engine/configuration.rb