How can I pass to IRB if I don't specify ?

前端 未结 3 1937
慢半拍i
慢半拍i 2021-02-05 22:47

Since:

irb --help

Usage: irb.rb [options] [programfile] [arguments]


I know I can pass arguments to ARGV if I include a prog

3条回答
  •  青春惊慌失措
    2021-02-05 23:02

    quite strange solution is to create file with variables

    # defaults.rb
    @a = "hello world"
    

    And

    # terminal
    => irb -r defaults.rb
    irb=> @a
    irb=> "hello world"
    

提交回复
热议问题