lib/jax/application.rb in jax-0.0.0.4 vs lib/jax/application.rb in jax-0.0.0.5
- old
+ new
@@ -1,11 +1,9 @@
-require "active_support/core_ext"
-
module Jax
class Application
autoload :Configuration, "jax/application/configuration"
-
+
class << self
def inherited(base)
raise "You cannot have more than one Jax::Application" if Jax.application
super
@@ -41,10 +39,11 @@
end
delegate :config, :to => "self.class"
delegate :root, :to => :config
delegate :routes, :to => :config
+ delegate :shader_load_paths, :to => :config
def shaders
# @shaders ||= begin
shaders = []
@@ -60,21 +59,21 @@
# end
end
def shader_paths
shader_paths = {}
- config.shader_load_paths.each do |path|
+ shader_load_paths.each do |path|
full_path = File.directory?(path) ? path : File.expand_path(path, config.root)
glob = File.join(full_path, "*/{fragment,vertex}.ejs")
Dir[glob].each do |dir|
shader_base = File.dirname(dir)
shader_name = File.basename(shader_base)
shader_paths[shader_name] = shader_base
end
end
shader_paths
end
-
+
def find_root_with_flag(flag, default=nil)
root_path = self.class.called_from
while root_path && File.directory?(root_path) && !File.exist?("#{root_path}/#{flag}")
parent = File.dirname(root_path)
\ No newline at end of file