Sha256: 7be0418466a58be696cefccb229c22e172e5c89e03a9d47715c712ee2044147c

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 Bytes

Contents

require 'singleton'

module Dockdev
  module Context
    class ContextManager
      include Singleton 

      def initialize
        @ctx = {}  
      end

      def register(name, cls)
        @ctx[name] = cls
      end

      def get_context(path)
        ctx = []
        @ctx.values.each do |v|
          vv = v.init_path(path)
          if vv.is_context?
            ctx << vv
          end
        end
        ctx
      end

    end
  end
end

Dockdev.logger.debug File.join(File.dirname(__FILE__),"context","*.rb")
Dir.glob(File.join(File.dirname(__FILE__),"context","*.rb")).each do |f|
  require f
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dockdev-0.3.8 lib/dockdev/context.rb
dockdev-0.3.7 lib/dockdev/context.rb
dockdev-0.3.6 lib/dockdev/context.rb