用于模拟SVN propedit SVN的enter键的Ruby命令行SVN:ignore

用于模拟SVN propedit SVN的enter键的Ruby命令行SVN:ignore,ruby,shell,svn,command-line,automation,Ruby,Shell,Svn,Command Line,Automation,我有一个用Ruby编写的自动化程序。在该计划的过程中,我需要有一个SVN回购忽略2个或更多的文件。此过程没有用户输入,因此不可能使用诸如svn propedit svn:ignore.之类的命令,因为它将打开文本编辑器以请求文件 通常,我直接从shell处理这个问题的方法是利用propset svn:ignore并在文件名之间点击[ENTER],以继续语句: svn propset svn:ignore "filename1 > filename2" . system("svn prop

我有一个用Ruby编写的自动化程序。在该计划的过程中,我需要有一个SVN回购忽略2个或更多的文件。此过程没有用户输入,因此不可能使用诸如
svn propedit svn:ignore.
之类的命令,因为它将打开文本编辑器以请求文件

通常,我直接从shell处理这个问题的方法是利用
propset svn:ignore
并在文件名之间点击
[ENTER]
,以继续语句:

svn propset svn:ignore "filename1
> filename2" .
system("svn propedit svn:ignore 'filename1")
system("filename2' .")
我尝试使用以下Ruby语句模拟此操作:

svn propset svn:ignore "filename1
> filename2" .
system("svn propedit svn:ignore 'filename1")
system("filename2' .")
但在执行时,我收到以下错误:

sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
我还尝试在
.svn
目录中创建一个
dir props
文件,但无法将更改注册到存储库中。我用svn proplist-v-R验证了这一点。即使这真的奏效了,我也不能保证它在所有可能的情况下都会成功

我做这件事已经有一段时间了,已经没有主意了。我尝试搜索一个Ruby命令,该命令允许我在
propedit svn:ignore
命令的两行之间模拟按键,但没有成功


有没有人能解决我该如何处理这件事?这对我的程序正确运行至关重要。提前谢谢。

找到了一个解决办法,似乎可以通过创建一个忽略文件并将其提供给
svn propset
来实现这一点。不确定是否有更好的解决方案,但这至少满足了我的需求:

    File.open("ignore.txt", "wb") { |f| f.write("filename1\nfilename2\n") }
    system("svn propset svn:ignore -F ignore.txt .")
    File.delete("ignore.txt")