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.7.3.9 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.3.6 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.3.5 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.3.3 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.3.2 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.3.1 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.3.0 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.1.8 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.1.7 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.1.0 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.0.7 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.0.5 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.0.4 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.0.3 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.7.0.2 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.8.7 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.8.6 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.8.5 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.8.3 lib/platform_specific/opal/extensions/ping.rb
atome-0.5.6.7.8 lib/platform_specific/opal/extensions/ping.rb