Sha256: 2b784f054bc38280f1a472e1154935e7590b2805ea2474469005c707ef4ef31e

Contents?: true

Size: 615 Bytes

Versions: 3

Compression:

Stored size: 615 Bytes

Contents

# https://github.com/opal/opal/pull/1104, fixed in Opal 0.9
# Opal hasn't been using $stdout as a default value
unless Opal::RSpec::Compatibility.pp_uses_stdout_default?
  class PP
    class << self
      if `(typeof(console) === "undefined" || typeof(console.log) === "undefined")`
        def pp(obj, out=$stdout, width=79)
          p(*args)
        end
      else
        def pp(obj, out=$stdout, width=79)
          if String === out
            out + obj.inspect + "\n"
          else
            out << obj.inspect + "\n"
          end
        end
      end

      alias :singleline_pp :pp
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
opal-connect-rspec-0.5.0 opal/opal/rspec/fixes/opal/stdlib/pp.rb
opal-rspec-0.5.0 opal/opal/rspec/fixes/opal/stdlib/pp.rb
opal-rspec-0.5.0.beta3 opal/opal/rspec/fixes/opal/stdlib/pp.rb