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

Version Path
crafterm-sprinkle-0.1.6 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.1.7 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.1.8 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.1.9 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.2.0 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.2.1 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.2.2 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.2.3 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.2.4 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.2.5 lib/sprinkle/verifiers/ruby.rb
crafterm-sprinkle-0.2.6 lib/sprinkle/verifiers/ruby.rb
jsierles-sprinkle-0.1.9 lib/sprinkle/verifiers/ruby.rb
justsee-sprinkle-0.2.4 lib/sprinkle/verifiers/ruby.rb
mdwan-sprinkle-0.2.2 lib/sprinkle/verifiers/ruby.rb
mdwan-sprinkle-0.2.3 lib/sprinkle/verifiers/ruby.rb
trevorturk-sprinkle-0.2.2 lib/sprinkle/verifiers/ruby.rb
trevorturk-sprinkle-0.2.6 lib/sprinkle/verifiers/ruby.rb
powcloud-sprinkle-0.3.4 lib/sprinkle/verifiers/ruby.rb
powcloud-sprinkle-0.3.0 lib/sprinkle/verifiers/ruby.rb
sprinkle-0.3.1 lib/sprinkle/verifiers/ruby.rb