save = Dir.pwd
Dir.chdir "./data"
# 作業
Dir.chdir save
とかかな

同じディレクトリにあるファイルを使うってことなら
open(File.dirname(__FILE__)+"/1.txt")
でもいいかも