Sha256: cb51bf4f1e99e76b0f016114ad461f0d552dab5eb4f1a83cc0dd29fa8558373c

Contents?: true

Size: 343 Bytes

Versions: 9

Compression:

Stored size: 343 Bytes

Contents

module Specjour
  module Protocol
    TERMINATOR = "|ruojceps|"

    def puts(arg)
      print(arg << "\n")
    end

    def print(arg)
      super dump_object(arg)
    end

    def dump_object(data)
      Marshal.dump(data) << TERMINATOR
    end

    def load_object(data)
      Marshal.load(data.sub(/#{TERMINATOR}$/, ''))
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
specjour-0.1.9 lib/specjour/protocol.rb
specjour-0.1.8 lib/specjour/protocol.rb
specjour-0.1.7 lib/specjour/protocol.rb
specjour-0.1.6 lib/specjour/protocol.rb
specjour-0.1.5 lib/specjour/protocol.rb
specjour-0.1.4 lib/specjour/protocol.rb
specjour-0.1.3 lib/specjour/protocol.rb
specjour-0.1.2 lib/specjour/protocol.rb
specjour-0.1.1 lib/specjour/protocol.rb