Class: Spider::HomeController
- Inherits:
-
Controller
- Object
- Controller
- Spider::HomeController
- Includes:
- StaticContent
- Defined in:
- lib/spiderfw/controller/home_controller.rb
Instance Attribute Summary
Attributes inherited from Controller
#dispatch_action, #executed_method, #is_target, #request, #response, #scene
Attributes included from Dispatcher
Class Method Summary collapse
- .app_pub_path(app = nil) ⇒ Object
- .app_routes ⇒ Object
- .print_app_routes ⇒ Object
- .pub_path ⇒ Object
- .pub_url ⇒ Object
-
.route_app(app) ⇒ Object
route ‘spider’, Spider.controller.
Methods inherited from Controller
#action_target?, #after, app, #before, before, before_methods, before_unless, #call_path, #check_action, controller_action?, controller_actions, default_action, #done, #done=, #done?, #execute, find_resource, find_resource_path, #get_action_method, #get_scene, #init, #initialize, #inspect, #is_target?, layout_path, option, options, #prepare_scene, #request_path, template_path, url, url=
Methods included from Annotations
Methods included from Logger
add, close, close_all, datetime_format, datetime_format=, #debug, debug, debug?, #debug?, enquire_loggers, #error, error, #error?, error?, #fatal, fatal, #fatal?, fatal?, info, #info, info?, #info?, method_missing, open, reopen, send_to_loggers, unknown, #unknown, #warn, warn, warn?, #warn?
Methods included from Dispatcher
#add_chain_item, #can_dispatch?, #dispatch, #dispatch_chain, #dispatch_next, #do_dispatch, #get_route, included, #route, #routes, #run_chain
Constructor Details
This class inherits a constructor from Spider::Controller
Class Method Details
.app_pub_path(app = nil) ⇒ Object
23 24 25 26 27 |
# File 'lib/spiderfw/controller/home_controller.rb', line 23 def self.app_pub_path(app=nil) path = self.pub_path+'/apps' path += '/'+app.short_name if app path end |
.app_routes ⇒ Object
29 30 31 |
# File 'lib/spiderfw/controller/home_controller.rb', line 29 def self.app_routes @app_routes ||= [] end |
.print_app_routes ⇒ Object
33 34 35 36 |
# File 'lib/spiderfw/controller/home_controller.rb', line 33 def self.print_app_routes max_length = app_routes.inject(0){ |m, r| m > r[0].length ? m : r[0].length } app_routes.map{ |r| "#{r[0].ljust(max_length+3)} -> #{r[1]}"}.sort.join("\n") end |
.pub_path ⇒ Object
15 16 17 |
# File 'lib/spiderfw/controller/home_controller.rb', line 15 def self.pub_path Spider.paths[:root]+'/public' end |
.pub_url ⇒ Object
19 20 21 |
# File 'lib/spiderfw/controller/home_controller.rb', line 19 def self.pub_url HTTPMixin.reverse_proxy_mapping('/public') end |
.route_app(app) ⇒ Object
route ‘spider’, Spider.controller
8 9 10 11 12 13 |
# File 'lib/spiderfw/controller/home_controller.rb', line 8 def self.route_app(app) #app_path = app.name.gsub('::', '/') app_path = app.route_url route(app_path, app.controller, :ignore_case => true) self.app_routes << [app_path, app.controller] end |