• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umbrellio / rabbit_messaging / 23530097232

25 Mar 2026 07:36AM UTC coverage: 91.944% (-0.1%) from 92.075%
23530097232

Pull #38

github

JustSnow
f
Pull Request #38: Add compression when publish and receive big messages

63 of 84 branches covered (75.0%)

Branch coverage included in aggregate %.

33 of 35 new or added lines in 5 files covered. (94.29%)

2 existing lines in 1 file now uncovered.

462 of 487 relevant lines covered (94.87%)

9.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/lib/rabbit/compressor.rb
1
# frozen_string_literal: true
2

3
require "msgpack"
1✔
4
require "zlib"
1✔
5

6
module Rabbit::Compressor
1✔
7
  Error = Class.new(StandardError)
1✔
8
  UncompressingError = Class.new(Error)
1✔
9

10
  extend self
1✔
11

12
  def dump(data, msgpack_options: {})
1✔
13
    Zlib::Deflate.deflate(MessagePack.pack(data, msgpack_options))
1✔
14
  end
15

16
  def load(data, msgpack_options: {})
1✔
17
    return {} unless data
4!
18

19
    MessagePack.unpack(Zlib::Inflate.inflate(data), msgpack_options)
4✔
20
  rescue Zlib::Error, MessagePack::UnpackError => error
NEW
21
    raise UncompressingError, "Unable to uncompress data, #{error}"
×
22
  end
23
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc