Sha256: a2d0d6dfe7edcdb5060694bf965f2dad4847fa6068b3aa977528abb80cea3c58

Contents?: true

Size: 453 Bytes

Versions: 10

Compression:

Stored size: 453 Bytes

Contents

module Stairs
  module EnvAdapters
    class RVM
      def self.present?
        `which rvm`
        $?.success?
      end

      def set(name, value)
        Util::FileMutation.replace_or_append(
          Regexp.new("^export #{name}=(.*)$"),
          "export #{name}=#{value}",
          ".rvmrc",
        )
      end

      def unset(name)
        Util::FileMutation.remove Regexp.new("^export #{name}=(.*)\n"), ".rvmrc"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
stairs-0.9.0 lib/stairs/env_adapters/rvm.rb
stairs-0.8.0 lib/stairs/env_adapters/rvm.rb
stairs-0.7.1 lib/stairs/env_adapters/rvm.rb
stairs-0.7.0 lib/stairs/env_adapters/rvm.rb
stairs-0.6.1 lib/stairs/env_adapters/rvm.rb
stairs-0.6.0 lib/stairs/env_adapters/rvm.rb
stairs-0.5.1 lib/stairs/env_adapters/rvm.rb
stairs-0.5.0 lib/stairs/env_adapters/rvm.rb
stairs-0.4.2 lib/stairs/env_adapters/rvm.rb
stairs-0.4.1 lib/stairs/env_adapters/rvm.rb