Sha256: d6261cd23960da7f983d95462a48f6e63d0f8a7c0c715eff692fbe86c07bdff5

Contents?: true

Size: 983 Bytes

Versions: 44

Compression:

Stored size: 983 Bytes

Contents

module Perus::Pinger
    class ChromeReload < ChromeCommand
        description 'Reloads the top Chrome window. When "ignore_cache" is true
                     the effect is equivalent to performing a force reload.'
        option :ignore_cache, default: false

        def run
            result = false

            execute(['{"id":1,"method":"Page.reload"}']) do |message|
                if message.include?('id') && message['id'] == 1
                    if message.include?('result')
                        if message['result'] == {}
                            result = true
                        else
                            result = message['result'].to_s
                        end
                    elsif message.include?('error')
                        result = message['error'].to_s
                    else
                        result = message.to_s
                    end
                end
            end

            result
        end
    end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
perus-1.0.7 lib/perus/pinger/commands/chrome_reload.rb
perus-1.0.6 lib/perus/pinger/commands/chrome_reload.rb
perus-1.0.5 lib/perus/pinger/commands/chrome_reload.rb
perus-1.0.4 lib/perus/pinger/commands/chrome_reload.rb
perus-1.0.3 lib/perus/pinger/commands/chrome_reload.rb
perus-1.0.2 lib/perus/pinger/commands/chrome_reload.rb
perus-1.0.1 lib/perus/pinger/commands/chrome_reload.rb
perus-1.0.0 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.35 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.34 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.33 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.32 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.31 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.30 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.29 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.28 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.27 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.26 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.25 lib/perus/pinger/commands/chrome_reload.rb
perus-0.1.24 lib/perus/pinger/commands/chrome_reload.rb