编写function.rb方法
def test
puts "test"
end
然后进入irb
irb(main):003:0> require '/m8/ruby/miaoxue/function.rb'
=> true
irb(main):004:0> test
test
=> nil
irb(main):005:0>
[root@master1 miaoxue]# cat function.rb
def add(a,b)
return a+b;
end