Sha256: f19bf349080eeba38c297daa2879354c5f3e09279b771ebfedd51a5882939184

Contents?: true

Size: 1.03 KB

Versions: 19

Compression:

Stored size: 1.03 KB

Contents

module Boson
  # This class manages indexing/storing all commands and libraries. See RepoIndex for details
  # about the index created for each Repo.
  module Index
    extend self
    # Array of indexes, one per repo in Boson.repos.
    def indexes
      @indexes ||= Boson.repos.map {|e| RepoIndex.new(e) }
    end

    # Updates all repo indexes.
    def update(options={})
      indexes.each {|e| e.update(options) }
    end

    #:stopdoc:
    def read
      indexes.each {|e| e.read }
    end

    def find_library(command, object=false)
      indexes.each {|e|
        (lib = e.find_library(command, object)) and return lib
      }
      nil
    end

    def find_command(command)
      indexes.each {|e|
        (cmd = Command.find(command, e.commands)) and return(cmd)
      }
      nil
    end

    def commands
      indexes.map {|e| e.commands}.flatten
    end

    def libraries
      indexes.map {|e| e.libraries}.flatten
    end

    def all_main_methods
      indexes.map {|e| e.all_main_methods}.flatten
    end
    #:startdoc:
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
boson-more-0.3.1 lib/boson/index.rb
boson-more-0.3.0 lib/boson/index.rb
boson-more-0.2.2 lib/boson/index.rb
boson-more-0.2.1 lib/boson/index.rb
boson-more-0.2.0 lib/boson/index.rb
boson-more-0.1.0 lib/boson/index.rb
boson-0.4.0 lib/boson/index.rb
bosonson-0.304.3 lib/boson/index.rb
bosonson-0.304.2 lib/boson/index.rb
bosonson-0.304.1 lib/boson/index.rb
boson-0.3.4 lib/boson/index.rb
boson-0.3.3 lib/boson/index.rb
boson-0.3.2 lib/boson/index.rb
boson-0.3.1 lib/boson/index.rb
boson-0.3.0 lib/boson/index.rb
boson-0.2.5 lib/boson/index.rb
boson-0.2.4 lib/boson/index.rb
boson-0.2.3 lib/boson/index.rb
boson-0.2.2 lib/boson/index.rb