%w(1.0.5 2.7.2 2.6.4 2.2.1).each do |version| gemfile <<-RB gem 'dalli', '~> #{version}' RB end %w(1.8.5 1.5.0).each do |version| gemfile <<-RB gem 'memcache-client', '~> #{version}', :require => 'memcache' # version lockdown for ZenTest that cooperates with all Rubies # and the build VMs gem 'ZenTest', '3.4.2' unless RUBY_VERSION >= '2.2.0' RB end unless RUBY_PLATFORM == 'java' gemfile <<-RB gem 'memcached', '~> 1.8.0' RB end def memcache_running? begin require 'socket' TCPSocket.new('localhost', 11211) true rescue false end end before_suite do system('memcached -d -l localhost') unless memcache_running? end # vim: ft=ruby