Sha256: c81a5cce7b3e8705b41a7800528003cf75519f94aff8a9126b2acb8596dab9b8
Contents?: true
Size: 821 Bytes
Versions: 23
Compression:
Stored size: 821 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 "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
Version data entries
23 entries across 23 versions & 1 rubygems