Running another ruby script from a ruby script

后端 未结 7 1002
终归单人心
终归单人心 2020-12-01 04:48

In ruby, is it possible to specify to call another ruby script using the same ruby interpreter as the original script is being run by?

For example, if a.rb runs b.rb

7条回答
  •  孤独总比滥情好
    2020-12-01 04:54

    Avdi Grimm wrote a series of articles on the Devver blog about different ways to start Ruby subprocesses last summer:

    • A Dozen (or so) Ways to Start Subprocesses in Ruby: Part 1
    • A Dozen (or so) Ways to Start Subprocesses in Ruby: Part 2
    • A Dozen (or so) Ways to Start Subprocesses in Ruby: Part 3
    • Beware of pipe duplication in subprocesses

    [Note: it appears that part 4 hasn't been published yet.]

提交回复
热议问题