Guest User

Untitled

a guest
Mar 17th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. //get jruby engine
  2. ScriptEngine jruby = new ScriptEngineManager().getEngineByName("jruby");
  3.  
  4. //process a ruby file
  5. jruby.eval(new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("/ruby/lti_outcome_util.rb"))));
  6.  
  7. //call a method defined in the ruby source
  8. jruby.put("score", score);
  9. jruby.put("message_id", messageId);
  10. jruby.put("sourcedid", sourcedId);
  11. jruby.put("key", key);
  12. jruby.put("secret", secret);
  13. jruby.put("lis_outcome_service_url", lisOutcomeServiceUrl);
  14.  
  15. String res = (String) jruby.eval("postScore($score, $message_id, $sourcedid, $key, $secret, $lis_outcome_service_url)");
Add Comment
Please, Sign In to add comment