开发者

How do I append a value to each array item?

I have this code, it works but it just doesn't look right. I'm creating开发者_Python百科 a string that I'm passing to the server through SSH:

... chmod -R 777 #{remote_path}/#{project}/#{items_to_chmod.join(' ' + remote_path + '/' + project + '/')} ...

The ugly thing is the first "#{remote_path}/#{project}/", it's not being added to the first item value in the array.


How about this?

"... chmod -R 777 #{ items_to_chmod.map{ |item| File.join(remote_path, project, item) }.join(" ") } ..."
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜