Sha256: 57d9b4b8a9127fc835c1c6538c790a59acd47107ade77b6dd007ac1a5e2ef3cc

Contents?: true

Size: 848 Bytes

Versions: 10

Compression:

Stored size: 848 Bytes

Contents

require 'pathname'

module Spider

    class Home
        attr_reader :path

        def initialize(path)
            @path = path
        end

        def controller
            require 'spiderfw/controller/home_controller'
            Spider::HomeController
        end

        def route_apps
            Spider.route_apps
        end

        def load_apps(*args)
            Spider.load_apps(*args)
        end

        def list_apps
            apps_path = Spider.respond_to?(:paths) ? Spider.paths[:apps] : File.join(@path, 'apps')
            apps_dir = Pathname.new(apps_path)
            apps = []
            Dir.glob("#{apps_path}/**/_init.rb").each do |path|
                dir = Pathname.new(File.dirname(path))
                apps << dir.relative_path_from(apps_dir).to_s
            end
            apps
        end

    end


end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spiderfw-0.6.5 lib/spiderfw/home.rb
spiderfw-0.6.4 lib/spiderfw/home.rb
spiderfw-0.6.3 lib/spiderfw/home.rb
spiderfw-0.6.2 lib/spiderfw/home.rb
spiderfw-0.6.1 lib/spiderfw/home.rb
spiderfw-0.6.0 lib/spiderfw/home.rb
spiderfw-0.5.19 lib/spiderfw/home.rb
spiderfw-0.5.18 lib/spiderfw/home.rb
spiderfw-0.5.17 lib/spiderfw/home.rb
spiderfw-0.5.16 lib/spiderfw/home.rb