mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Retrieve vagrant and ruby-libvirt dependencies and modify as needed to allow testing against ruby 3.0 until released versions support. Use conditionals to skip steps when not needed. Note that in order to use the locally built gem added to the cache manually, need to disable checksums. However as all other ruby versions will continue to use it, shouldn't be an issue as long as the cache for ruby 3.0.0 is wiped clean before being used for anything such as publishing. Fixes: #1244
44 lines
1.3 KiB
Ruby
44 lines
1.3 KiB
Ruby
source 'https://rubygems.org'
|
|
|
|
# Specify your gem's dependencies in vagrant-libvirt.gemspec
|
|
gemspec
|
|
|
|
group :development do
|
|
# We depend on Vagrant for development, but we don't add it as a
|
|
# gem dependency because we expect to be installed within the
|
|
# Vagrant environment itself using `vagrant plugin`.
|
|
vagrant_version = ENV['VAGRANT_VERSION']
|
|
if !vagrant_version.nil? && !vagrant_version.empty?
|
|
gem 'vagrant', :git => 'https://github.com/hashicorp/vagrant.git',
|
|
:ref => vagrant_version
|
|
else
|
|
gem 'vagrant', :git => 'https://github.com/hashicorp/vagrant.git',
|
|
:branch => 'main'
|
|
end
|
|
|
|
begin
|
|
raise if vagrant_version.empty?
|
|
vagrant_version = vagrant_version[1..-1] if vagrant_version && vagrant_version.start_with?('v')
|
|
vagrant_gem_version = Gem::Version.new(vagrant_version)
|
|
rescue
|
|
# default to newer if unable to parse
|
|
vagrant_gem_version = Gem::Version.new('2.2.8')
|
|
end
|
|
|
|
if vagrant_gem_version <= Gem::Version.new('2.2.7')
|
|
gem 'vagrant-spec', :github => 'hashicorp/vagrant-spec', :ref => '161128f2216cee8edb7bcd30da18bd4dea86f98a'
|
|
else
|
|
gem 'vagrant-spec', :github => 'hashicorp/vagrant-spec', :branch => "main"
|
|
end
|
|
|
|
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
|
|
gem 'rexml'
|
|
end
|
|
|
|
gem 'pry'
|
|
end
|
|
|
|
group :plugins do
|
|
gemspec
|
|
end
|