boss-protocol 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efc0df5f02b78e91df3de6a16c8a87c25d1075bd
4
- data.tar.gz: 11131a67fd7fddca99b4fddb73b2aa29ceb40352
3
+ metadata.gz: 5c0b4f367f0b59d7612093290d9c4b2e9bf32322
4
+ data.tar.gz: 443ba9c925bb3f50efe4ba4b2167c845d4ee68a1
5
5
  SHA512:
6
- metadata.gz: f0246ac59217158e9e0a40df894a7cedb1fff0f33fd61c4c1ae11f7a85a9b4e35f9e3a88796c1c313a6c5c7a9e8caab618d51ad850351b88773c8188e7259c5a
7
- data.tar.gz: c96d6d3c1d85d7d34cd39211dfa09e324b9ac3f57474616f411745a3a1db480f94d677f9749cf5c97fcc86184a5651401eeadf087211379004a9ca84af2254b0
6
+ metadata.gz: 11aa28920cc77dc9fa7cd5ef9b3d1803d3a198ec6e9106223d9d60548ffc8aad1fe55d314547e9e1755ecc9c995547ff9721d8d6551cc714aee607d0ab16f38f
7
+ data.tar.gz: b10a10f3c3b69731ce65f29690008c4a2d6cc7bfc9312dd97a097a4c7c83d2983f4ac22534dd7bfbff73ef7ae89f846281094eb79e0ec32ec70f149acb3c2c5c
data/README.md CHANGED
@@ -6,7 +6,7 @@ BOSS is an acronym for Binary Object Streaming Specification.
6
6
 
7
7
  The bit-effective, platform-independent streamable and traversable
8
8
  typed binary protocol. Allow to effectively store small or any sized integers,
9
- strings or binary data of any size, floats and doubles, arrays and hashes in a
9
+ strings or binary data of any size, floats and doubles, arrays and hashes and time objects in a
10
10
  very effective way. It caches repeating objects and stores/restores links to
11
11
  objects.
12
12
 
@@ -95,6 +95,9 @@ To use the transparent compression:
95
95
 
96
96
  ## Streaming sample
97
97
 
98
+ Boss can work with any stream-like object^ e.g. pipe, file stringIO, whatever that
99
+ provides #eof? #read and #write methods. If the stream supprts #readbyte, it will be used instead.
100
+
98
101
  This sample shows boss object hierarchies passing between 2 forked processes
99
102
  using a pipe (see samples/):
100
103
 
data/lib/boss-protocol.rb CHANGED
@@ -322,7 +322,8 @@ module Boss
322
322
  # object
323
323
  def initialize(src=nil)
324
324
  @io = src.class <= String ? StringIO.new(src) : src
325
- @io.set_encoding Encoding::BINARY
325
+ @io.set_encoding Encoding::BINARY if @io.respond_to? :set_encoding
326
+ @rbyte = @io.respond_to?(:readbyte) ? -> { @io.readbyte } : -> { @io.read(1).ord }
326
327
  @cache = [nil]
327
328
  @stream_mode = false
328
329
  end
@@ -462,7 +463,7 @@ module Boss
462
463
  end
463
464
 
464
465
  def rbyte
465
- @io.readbyte
466
+ @rbyte.call
466
467
  end
467
468
 
468
469
  def rdouble
@@ -1,3 +1,3 @@
1
1
  module Boss
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -5,10 +5,16 @@
5
5
  #
6
6
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
7
  RSpec.configure do |config|
8
- config.treat_symbols_as_metadata_keys_with_true_values = true
8
+ # config.treat_symbols_as_metadata_keys_with_true_values = true
9
9
  config.run_all_when_everything_filtered = true
10
10
  config.filter_run :focus
11
11
 
12
+ config.expect_with :rspec do |expectations|
13
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
14
+ expectations.syntax = [:should, :expect]
15
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
16
+ end
17
+
12
18
  # Run specs in random order to surface order dependencies. If you find an
13
19
  # order dependency and want to debug it, you can fix the order by providing
14
20
  # the seed, which is printed after each run.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boss-protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sergeych
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-29 00:00:00.000000000 Z
11
+ date: 2015-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec