cbor-diag 0.1.1 → 0.1.2
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 +4 -4
- data/cbor-diag.gemspec +1 -1
- data/lib/cbor-pure.rb +12 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc50b81351785251755ccefdd4699d3fc47b05f
|
4
|
+
data.tar.gz: 395b8361bf5e6e8ac25e9ba33fae3932656407eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79c34273050260b7c295a99f00b39c6ce6f99e6858a3d1a2446bdeeb5262b905f5f72becab34d2b10a53f4b92ad8fe628eaddfffee3f63e842d12a0580b82508
|
7
|
+
data.tar.gz: bbc94c97f12177dda1bb3198570332c2e52b71ec10c5b1a07b7cdcedd6ace72816a587b1e255e703fa35d2074a3a43a50351590131dc57d33a7ed9f556ec9b46
|
data/cbor-diag.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cbor-diag"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.2"
|
4
4
|
s.summary = "CBOR (Concise Binary Object Representation) diagnostic notation"
|
5
5
|
s.description = %q{cbor-diag implements diagnostic notation for CBOR, RFC 7049}
|
6
6
|
s.author = "Carsten Bormann"
|
data/lib/cbor-pure.rb
CHANGED
@@ -4,6 +4,17 @@ require "half.rb"
|
|
4
4
|
|
5
5
|
|
6
6
|
class CBOR
|
7
|
+
class OutOfBytesError < RuntimeError
|
8
|
+
def initialize(bytes)
|
9
|
+
@bytes = bytes
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_s
|
13
|
+
"Out of bytes to decode: #{@bytes}"
|
14
|
+
end
|
15
|
+
attr_reader :bytes
|
16
|
+
end
|
17
|
+
|
7
18
|
module Streaming
|
8
19
|
def cbor_stream?
|
9
20
|
@cbor_streaming
|
@@ -174,7 +185,7 @@ class CBOR
|
|
174
185
|
def take(n)
|
175
186
|
opos = @pos
|
176
187
|
@pos += n
|
177
|
-
raise
|
188
|
+
raise OutOfBytesError.new(@pos - @buffer.bytesize) if @pos > @buffer.bytesize
|
178
189
|
@buffer[opos, n]
|
179
190
|
end
|
180
191
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cbor-diag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
102
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.4.
|
103
|
+
rubygems_version: 2.4.8
|
104
104
|
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: CBOR (Concise Binary Object Representation) diagnostic notation
|