Sha256: 93016ef0c7dd6a32c78d12a21d7e6e168e68fca0e011c62211e162c01178e4e7

Contents?: true

Size: 451 Bytes

Versions: 10

Compression:

Stored size: 451 Bytes

Contents

module Stairs
  module EnvAdapters
    class Rbenv
      def self.present?
        `which rbenv-vars`
        $?.success?
      end

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

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