Sha256: 6e38b391fb8d29a70aa59ed1422b298a48ce31d9c274d3e9790147c46e230a1a
Contents?: true
Size: 694 Bytes
Versions: 73
Compression:
Stored size: 694 Bytes
Contents
# frozen_string_literal: true # Add on the Atome class class Atome def ping(my_proc = false) instance_exec(my_proc) if my_proc.is_a?(Proc) # ` var p = new Ping(); # p.ping('https://'+#{address}+'', function (err, data) { # if (err) { # return false; # } else { # console.log("the site "+#{address}+" is up!"); # } # }); # ` js_code = <<-JS var p = new Ping(); p.ping('https://' + "#{address}" + '', function (err, data) { if (err) { return false; } else { console.log("the site " + "#{address}" + " is up!"); } }); JS # Exécute le code JavaScript JS.eval(js_code) end end
Version data entries
73 entries across 73 versions & 1 rubygems