Call PHP from Ruby and get response -
i've got open source charity website built in ruby on rails , we're trying integrate payment validation system , 1 exists in php - trying find if there way these 2 play nice together?
can call php script ruby , have ruby read echo'd response etc?
yes can done using system calls such
def your_method(path,file) system("cd #{path} && #{file} ") end
btw, know there io
class input/output , 1 of fundamental method command is
def popen(cmd) open3.popen3(cmd) {|stdin, stdout, stderr, wait_thr| exit_status = wait_thr.value if (exit_status !=0) raise commanderror, "something went wrong" // supposing customize class //command < standarderror ; end end } end
on antoher side, if both codes runs on different codes, of course possible "apize" rails app, in order fetch , pull data
Comments
Post a Comment