Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (22 sloc) 821 Bytes
module Sprinkle
module Verifiers
# = Ruby Verifiers
#
# The verifiers in this module are ruby specific.
module Ruby
Sprinkle::Verify.register(Sprinkle::Verifiers::Ruby)
# Checks if ruby can require the <tt>files</tt> given. <tt>rubygems</tt>
# is always included first.
def ruby_can_load(*files)
# Always include rubygems first
files = files.unshift('rubygems').collect { |x| "require '#{x}'" }
@commands << "ruby -e \"#{files.join(';')}\""
end
# Checks if a gem exists by calling "gem list" and grepping against it.
def has_gem(name, version = nil)
version = version ? "--version '#{version}'" : ''
@commands << "gem list '#{name}' --installed #{version} > /dev/null"
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.