Sha256: bfd0e05b587929070475c125a9dc237f083d4003b14aae3e0d64b3f469189e01

Contents?: true

Size: 1.12 KB

Versions: 20

Compression:

Stored size: 1.12 KB

Contents

module Spider

    class HomeController < Controller
        include StaticContent, HTTPMixin
        route 'spider/public', Spider.controller, :prepend => 'public/'
        #        route 'spider', Spider.controller

        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

        def self.pub_path
            Spider.paths[:root]+'/public'
        end

        def self.pub_url
            HTTPMixin.reverse_proxy_mapping('/public')
        end
        
        def self.app_pub_path(app=nil)
            path = self.pub_path+'/apps'
            path += '/'+app.short_name if app
            path
        end
        
        def self.app_routes
            @app_routes ||= []
        end
        
        def self.print_app_routes(routes=app_routes)
            max_length = routes.inject(0){ |m, r| m > r[0].length ? m : r[0].length }
            routes.map{ |r| "#{r[0].ljust(max_length+3)} -> #{r[1]}"}.sort.join("\n")
        end

    end


end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
spiderfw-1.0.1 lib/spiderfw/controller/home_controller.rb
spiderfw-1.0.0 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.39 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.38 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.37 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.35 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.34 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.33 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.32 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.31 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.30 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.29 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.28 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.27 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.26 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.26.pre1 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.25 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.24 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.23 lib/spiderfw/controller/home_controller.rb
spiderfw-0.6.22 lib/spiderfw/controller/home_controller.rb