class Romyow::Path

Attributes

home[RW]
ruby_version[RW]

Public Class Methods

new(options={}) click to toggle source
# File lib/romyow/path.rb, line 4
def initialize(options={})
  self.ruby_version = options[:ruby_version].strip if options[:ruby_version]
  self.home = ENV["HOME"]
end

Public Instance Methods

ruby() click to toggle source
# File lib/romyow/path.rb, line 9
def ruby
  existing_path("#{self.home}/.rubies/#{self.ruby_version}/bin") || '/usr/bin'
end

Private Instance Methods

existing_path(path) click to toggle source
# File lib/romyow/path.rb, line 15
def existing_path(path)
  File.directory?(path) ? path : nil
end