# -*- mode: ruby; coding: utf-8 -*- source 'https://rubygems.org' SUBMODULES = %w[xot rucy rays reflexion] def local_path (name) File.expand_path "../#{name.gsub /xion/, 'x'}", __FILE__ end def have_local (name) File.directory? local_path name end def submodule (*names) names.each do |name| if have_local name gem name, path: local_path(name) else gem name end end end group :development do gem 'rake' end submodule *SUBMODULES gem 'spacy', path: '.' if SUBMODULES.all? {|name| have_local name}