Sha256: d105d1f04b6ed5fb498c2e7571c427189e40626f55eb3abbbcec7468dc194bdb

Contents?: true

Size: 472 Bytes

Versions: 22

Compression:

Stored size: 472 Bytes

Contents

module Capybara::Poltergeist
  module JSON
    def self.load(message)
      if dumpy_multi_json?
        MultiJson.load(message)
      else
        MultiJson.decode(message)
      end
    end

    def self.dump(message)
      if dumpy_multi_json?
        MultiJson.dump(message)
      else
        MultiJson.encode(message)
      end
    end

    private

    def self.dumpy_multi_json?
      MultiJson.respond_to?(:dump) && MultiJson.respond_to?(:load)
    end
  end
end

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
poltergeistFork-0.0.4 lib/capybara/poltergeist/json.rb
poltergeistFork-0.0.3 lib/capybara/poltergeist/json.rb
poltergeist-1.9.0 lib/capybara/poltergeist/json.rb
poltergeistFork-0.0.2 lib/capybara/poltergeist/json.rb
poltergeistFork-0.0.1 lib/capybara/poltergeist/json.rb
poltergeist-1.8.1 lib/capybara/poltergeist/json.rb
poltergeist-1.8.0 lib/capybara/poltergeist/json.rb
poltergeist-1.7.0 lib/capybara/poltergeist/json.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/poltergeist-1.6.0/lib/capybara/poltergeist/json.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/poltergeist-1.6.0/lib/capybara/poltergeist/json.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/poltergeist-1.6.0/lib/capybara/poltergeist/json.rb
poltergeist-1.6.0 lib/capybara/poltergeist/json.rb
poltergeist-cj-1.5.2 lib/capybara/poltergeist/json.rb
poltergeist-1.5.1 lib/capybara/poltergeist/json.rb
poltergeist-1.5.0 lib/capybara/poltergeist/json.rb
poltergeist-1.4.1 lib/capybara/poltergeist/json.rb
poltergeist-1.4.0 lib/capybara/poltergeist/json.rb
poltergeist-1.0.3 lib/capybara/poltergeist/json.rb
poltergeist-1.0.2 lib/capybara/poltergeist/json.rb
poltergeist-1.0.1 lib/capybara/poltergeist/json.rb