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

Version Path
atome-0.5.6.7.7 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.7.6 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.7.5 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.7.4 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.7.3 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.6.9 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.6.7 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.6.5 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.6.1 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.6.0 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.5.7 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.5.6 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.5.4 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.5.1 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.4.8 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.4.5 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.4.2 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.4.1 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.4.0 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.3.9 lib/platform_specific/opal/extensions/ping.rb