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

Version Path
sprinkle-0.7.7 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.6.2 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.6.1 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.6 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.5 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.4 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.3 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.2 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.1.1 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7.1 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.7 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.6.2 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.6.1.1 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.6.1 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.6.0 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.5.2 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.5.1.1 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.5.1 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.5.0 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.5.0.rc1 lib/sprinkle/verifiers/ruby.rb