Sha256: e299fd3f3084685e309a903056f9bd09ca04ffa1788a8bcf3f654a1393e833dc
Contents?: true
Size: 833 Bytes
Versions: 6
Compression:
Stored size: 833 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 '#{version}'" @commands << "sudo gem list '#{name}' --installed #{version} > /dev/null" end end end end
Version data entries
6 entries across 6 versions & 2 rubygems