Sha256: acf315e34c850e2e9babe050c110b0c2455400f317c02e5d185aa18973f63139

Contents?: true

Size: 458 Bytes

Versions: 4

Compression:

Stored size: 458 Bytes

Contents

module Rip
  module Commands
    o 'ruby ENV ARGS'
    x 'Runs a Ruby instance in a particular environment.'
    def ruby(options={}, *args)
      selected_env = File.join(Rip.dir, ARGV.shift, "lib")
      path = (ENV["RUBYLIB"] || "").split(":")
      active_env = File.join(Rip.dir, "active", "lib")
      path -= [active_env]
      path += [selected_env]
      ENV["RUBYLIB"] = path.join(":")
      exec(ENV['RUBYBIN'] || "ruby", *ARGV)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rip-0.0.4 lib/rip/commands/ruby.rb
rip-0.0.5 lib/rip/commands/ruby.rb
rip-0.0.3 lib/rip/commands/ruby.rb
rip-0.0.2 lib/rip/commands/ruby.rb