Jorge Cuevas
Jorge Cuevas

Reputation: 774

How to store values that result from executing an app using system(" ") on ruby on rails 4?

I'm using system(" ") on the rails console to execute an application that takes inside a file, processes it and outputs another file.

The application also logs statistics for said file on the terminal before closing.

My objective is to save those logged statistics as variables inside rails, although I'm not exactly sure how I can do that.

How can I save the logged statistics inside rails variables?

Upvotes: 0

Views: 26

Answers (1)

oreoluwa
oreoluwa

Reputation: 5633

I don't think the system method is the best method to use here, as I think this would either return true or false. However to get back the value, you should try to use the backticks

statistics = `method to call on computer`

let me know if that works

Upvotes: 1

Related Questions