lib/gitdocs/manager.rb in gitdocs-0.5.0.pre1 vs lib/gitdocs/manager.rb in gitdocs-0.5.0.pre2
- old
+ new
@@ -9,22 +9,10 @@
@logger = Logger.new(File.expand_path('log', @config.config_root))
@debug = debug
yield @config if block_given?
end
- RepoDescriptor = Struct.new(:name, :index)
-
- def search(term)
- results = {}
- @runners.each_with_index do |runner, index|
- descriptor = RepoDescriptor.new(runner.root, index)
- repo_results = runner.search(term)
- results[descriptor] = repo_results unless repo_results.empty?
- end
- results
- end
-
def start(web_port = nil)
log("Starting Gitdocs v#{VERSION}...")
log("Using configuration root: '#{config.config_root}'")
log("Shares: (#{config.shares.length}) #{config.shares.map(&:inspect).join(', ')}")
@@ -36,10 +24,11 @@
@runners = Runner.start_all(config.shares)
# Start the web front-end
if config.global.start_web_frontend
web_port ||= config.global.web_frontend_port
- web_server = Server.new(self, web_port, *@runners)
+ repositories = config.shares.map { |x| Repository.new(x) }
+ web_server = Server.new(self, web_port, repositories)
web_server.start
web_server.wait_for_start_and_open(restarting)
end
end
rescue Restart