There are two ways to do this (well, there are several, but there are two good ones). First, using File.expand_path:
original_path = "/repos/something/test-folder/features/support"
target_path = File.expand_path("../../lib/resources", original_path)
p target_path
, File.expand_path , , . , , , , , , ( ).
, Pathname#join ( Pathname#+):
require "pathname"
original_path = Pathname("/repos/something/test-folder/features/support")
target_path = original_path + "../../lib/resources"
p target_path
Pathname#parent, :
p original_path.parent.parent
p original_path.parent.parent + "lib/resources"
Pathname, . Pathname , , - , String, :
p target_path.to_s
P.S. foo = "#{bar}" Ruby. bar , , .. foo = bar. bar ( ), to_s, .. foo = bar.to_s.
P.P.S. - Ruby. , .