Sha256: 0fc24ff8cc087320ca246a107cceb7c2a1d5cb5b99b7f3438346dd248ac8565a
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
module Volt class App attr_reader :component_paths, :router def initialize(app_path) # Setup root path Volt.root = app_path # Require in config files unless RUBY_PLATFORM == 'opal' Volt.run_files_in_config_folder end # Load component paths @component_paths = ComponentPaths.new(app_path) @component_paths.require_in_components unless RUBY_PLATFORM == 'opal' setup_router require_http_controllers end end unless RUBY_PLATFORM == 'opal' def setup_router # Find the route file home_path = @component_paths.component_paths('main').first routes = File.read("#{home_path}/config/routes.rb") @router = Routes.new.define do eval(routes) end end def require_http_controllers @component_paths.app_folders do |app_folder| # Sort so we get consistent load order across platforms Dir["#{app_folder}/*/controllers/server/*.rb"].each do |ruby_file| #path = ruby_file.gsub(/^#{app_folder}\//, '')[0..-4] #require(path) require(ruby_file) end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
volt-0.9.1.pre3 | lib/volt/volt/app.rb |