class Bundler::Dsl
def gemspec(opts = nil)
def gemspec(opts = nil) path = opts && opts[:path] || '.' name = opts && opts[:name] || '{,*}' development_group = opts && opts[:development_group] || :development expanded_path = File.expand_path(path, Bundler.default_gemfile.dirname) gemspecs = Dir[File.join(expanded_path, "#{name}.gemspec")] case gemspecs.size when 1 spec = Bundler.load_gemspec(gemspecs.first) raise InvalidOption, "There was an error loading the gemspec at #{gemspecs.first}." unless spec gem spec.name, :path => path group(development_group) do spec.development_dependencies.each do |dep| gem dep.name, *(dep.requirement.as_list + [:type => :development]) end end when 0 raise InvalidOption, "There are no gemspecs at #{expanded_path}." else raise InvalidOption, "There are multiple gemspecs at #{expanded_path}. Please use the :name option to specify which one." end end