Sha256: 65c042ad3b3dfebcfaac6e3f2708454e10aa942c6608ad2ac1aeedf13c0b3d64
Contents?: true
Size: 826 Bytes
Versions: 32
Compression:
Stored size: 826 Bytes
Contents
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 "sudo gem list" and grepping against it. def has_gem(name, version=nil) version = version.nil? ? '' : version.gsub('.', '\.') @commands << "sudo gem list | grep -e '^#{name} (.*#{version}.*)$'" end end end end
Version data entries
32 entries across 32 versions & 8 rubygems